Skip to content

Telegram notifications are not sent when longer than 4096 chars #222

@davtur19

Description

@davtur19

Describe the bug
I get this error when I have too many containers that need updating or fail:

Failed to send notification via shoutrrr (url=telegram://1234:AA1234BCDEF@telegram?channels=225533):  message exceeds the max length

The problem is that Telegram does not support messages longer than 4096 characters

Possible solution
A simple fix would be to split the message once it reaches 4096 characters (preferably when there is a newline before the 4096 character, to have it cleaner to see).

To avoid problems with Telegram, you could send a warning message if it is longer than 20(?) messages (4096 * 20 characters), saying that it is impossible to send all notifications because they are too long to display in Telegram, is better than not receiving a warning at all.

To Reproduce
Steps to reproduce the behavior:

  1. Create many containers that need to be updated in order to have a long message
  2. Wait for the watchtower update check
  3. See error

Expected behavior
Receive notifications on Telegram when a message is too long

Environment
I am using containrrr/watchtower:latest image (arm64).
Docker version 20.10.12, build e91ed57

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions