Telegram Notification Error

Hello,
I am desperately trying to set up a Telegram bot which notifies me when a backup was successful or canceled.
I specify the following parameters in the UI:

–send-telegram-bot-id=
–send-telegram-channel-id=
–send-telegram-any-operation=true
–send-telegram-message=Duplicati %OPERATIONNAME% report for %backup-name%

%RESULT%

I have also tried other entries but always get the following error message:

System.ArgumentNullException: Value cannot be null. (Parameter ‘stringToEscape’)
at System.ArgumentNullException.Throw(String paramName)
at System.UriHelper.EscapeString(String stringToEscape, Boolean checkExistingEscaped, SearchValues`1 noEscape)
at Duplicati.Library.Modules.Builtin.SendTelegramMessage.SendMessageChunk(String message, Int32 partNumber, Int32 totalParts)

I am using the version Duplicati - 2.1.0.5_stable_2025-03-04

Can anyone help me with this?

It looks like this could happen if you forget to set --send-telegram-channel-id, but you show that it is indeed set. You are missing --send-telegram-api-key in the list, but that should give a different error.

With 2.1.0.5 there is an issue with the modules (including the Telegram module) where they are not unloaded, but instead re-used. This can sometimes cause weird behavior, where settings on one backup run are “lingering” on another backup run. This has been fixed in the latest canary build.

Can you try to restart Duplicati and then run with all the options correctly set?

I have entered the API key (long string) of BotFather under

–send-telegram-bot-id=

I have not entered the actual bot ID (Name of the bot) at all.

When I enter the API key under --send-telegram-API-key and the BOT ID under --send-telegram-Bot-ID I get the following error message:

Failed to send to telegram messages part 1/1: {“ok”:false, “error_code”:404, ‘description’: “Not Found”}

I have already restarted several times. But nothing helps so far

That sounds a bit more helpful. At least now it does not crash, but actually sends a message and gets a response.

Some quick guesses to the cause:

  • The bot has not been added to the target chat or channel.
  • The bot does not have the necessary permissions to send messages in the chat or channel.
  • The --send-telegram-channel-id is not set to the chat or channel’s unique identifier.

But the conditions are met. I already use the same bot for UptimeKuma and the messages arrive without any problems.
I have also created a new bot and tried it again. It didn’t work there either.

My entire configuration looks like this:

–send-telegram-bot-id=123456789x:xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXXXXX
–send-telegram-any-operation=true
–send-telegram-message=Duplicati %OPERATIONNAME% report for %backup-name%

%RESULT%
–send-telegram-api-key=XXXXXXXXXXXXXXXXXXXXXX_bot
–send-telegram-channel-id=123456789

Do I have an error in the notation? Do the values have to be entered in “” or other enclosing characters?

Hi.
Same problem here. Creating the telegram app wasnt easy either, constantly gave me errors no matter what i put into the form.

Is there no option to run it with just the bot token? Works fine for my unraid notifications.

I have found the solution.
The entries at

-send-telegram-bot-id=123456789x:xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXXXXXXXXXXXXXXXXXXXX
   and
 -send-telegram-api-key=XXXXXXXXXXXXXXXXXXXXXXXX_bot

were wrong.

In Duplicati only the numeric ID belongs in --send-telegram-bot-id and everything after the colon in --send-telegram-api-key, without the _bot suffix

So in my example the token is:

123456789x : xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXXXXXXX

and this must be entered as follows:

-send-telegram-bot-id=123456789x:
-send-telegram-api-key=xXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXXXXXXXXXXXXX
1 Like