docker-icloudpd icon indicating copy to clipboard operation
docker-icloudpd copied to clipboard

Problem about telegram notification proxy server settings

Open zsbai opened this issue 1 month ago • 1 comments

System:

  • OS: Debian
  • Version 12

Describe the bug I'm experiencing an issue with Telegram notifications after updating the Docker image (v1.0.1289). It seems the application is handling the telegram_server setting (proxy/custom base URL) incorrectly.

The core problem: The startup notification is failing because the program attempts to connect to the official Telegram API, which is inaccessible in my region.

Here's what the logs show:

  • The custom base URL is correctly loaded: DEBUG | - Telegram base URL: https://my.telegram.proxy.server/p/bot/bot81********w4

  • However, the final notification URL defaults to the official one: DEBUG | - Telegram notification URL: https://api.telegram.org/bot81********w4/sendMessage

This results in an error: ERROR Telegram startup notification failed with http status code: 000 and curl exit code: 7

Context / When the issue started:

Few days ago, I noticed that the iCloudPD cloud not sync the new update of icloud photos, and no new message send to my telegram bot. However, I am not pay much attention about that because iCloudPD work fine in past three month, so I just pull the latest docker images and problem occur.

This issue appeared right after I pulled the latest image (v1.0.1289) and restarted the container.

The odd part: I have not changed my configuration file, and the same setup (with the custom telegram_server defined) was running perfectly fine for months on an older image (about 3 months ago). The Telegram notifications worked correctly on that old version. I checked the changelog but couldn't find any recent changes related to Telegram notifications.

Debug log file

2025-11-24 09:22:32 INFO      | Live Photo MOV Filename Policy: suffix

2025-11-24 09:22:32 INFO      | File Match Policy: name-size-dedup-with-suffix

2025-11-24 09:22:32 INFO      | Download interval: 86400

2025-11-24 09:22:32 INFO      | Download delay (minutes): 0

2025-11-24 09:22:32 INFO      | Set EXIF date/time: false

2025-11-24 09:22:32 INFO      | Auto delete: true

2025-11-24 09:22:32 INFO      | Delete after download: false

2025-11-24 09:22:32 INFO      | Delete empty directories: false

2025-11-24 09:22:32 INFO      | Photo size: original

2025-11-24 09:22:32 INFO      | Align RAW: as-is

2025-11-24 09:22:32 INFO      | Single pass mode: false

2025-11-24 09:22:32 INFO      | Skip download check: true

2025-11-24 09:22:32 INFO      | Skip live photos: false

2025-11-24 09:22:32 INFO      | Number of most recently added photos to download: Download All Photos

2025-11-24 09:22:32 INFO      | Downloading photos from: Download All Photos

2025-11-24 09:22:32 INFO      | Stop downloading when prexisiting files count is: Download All Photos

2025-11-24 09:22:32 INFO      | Live photo size: original

2025-11-24 09:22:32 INFO      | Skip videos: false

2025-11-24 09:22:32 INFO      | Convert HEIC to JPEG: false

2025-11-24 09:22:32 DEBUG     | User agent impersonation for curl: Disabled

2025-11-24 09:22:32 DEBUG     | Nextcloud upload: Disabled

2025-11-24 09:22:32 DEBUG     | Ignore Synology extended attribute directories: Disabled

2025-11-24 09:22:32 INFO     Finished loading configuration file

2025-11-24 09:22:32 INFO     Configuring notifications

2025-11-24 09:22:32 INFO      | Telegram notifications enabled

2025-11-24 09:22:32 DEBUG       - Telegram token: 81********w4

2025-11-24 09:22:32 DEBUG       - Telegram chat id: 84********24

2025-11-24 09:22:32 DEBUG       - Telegram polling: true

2025-11-24 09:22:32 DEBUG       - Telegram uses HTTP: false

2025-11-24 09:22:32 DEBUG       - Telegram base URL: https://my.telegram.proxy.server/p/bot/bot81********w4

2025-11-24 09:22:32 DEBUG       - Telegram notification URL: https://api.telegram.org/bot81********w4/sendMessage

2025-11-24 09:22:32 DEBUG       - Checking my.telegram.proxy.server/p/bot for updates

2025-11-24 09:22:32 INFO        - Latest update id: 0

2025-11-24 09:22:32 DEBUG       - Silent file notifications: false

2025-11-24 09:22:32 DEBUG     | Notification title: boredazfcuk/iCloudPD

2025-11-24 09:22:32 DEBUG     | Startup notification: Enabled

2025-11-24 09:22:32 DEBUG     | Download notifications: Enabled

2025-11-24 09:22:32 DEBUG     | Delete notifications: Enabled

2025-11-24 09:22:32 INFO     Configuring of notifications complete

2025-11-24 09:22:32 INFO     Sending Telegram startup notification

2025-11-24 09:22:32 ERROR    Telegram startup notification failed with http status code: 000 and curl exit code: 7

2025-11-24 09:22:32 ERROR    ***** Please post the above debug log, along with a description of your problem, here: https://github.com/boredazfcuk/docker-icloudpd/issues *****

zsbai avatar Nov 24 '25 01:11 zsbai

This was just a log display issue as far as I can see:

 if [ "${telegram_server}" ]
 then
    telegram_base_url="${telegram_protocol}://${telegram_server}/bot${telegram_token}"
 else
    telegram_base_url="${telegram_protocol}://api.telegram.org/bot${telegram_token}"
 fi

The above lines correctly set the telegram_base_url which is used for the remainder of the calls to the Telegram API.

 notification_url="${telegram_base_url}/sendMessage"
 log_info " | ${notification_type_tc} notifications enabled"
 log_debug "   - ${notification_type_tc} token: ${telegram_token:0:2}********${telegram_token:0-2}"
 log_debug "   - ${notification_type_tc} chat id: ${telegram_chat_id:0:2}********${telegram_chat_id:0-2}"
 log_debug "   - ${notification_type_tc} polling: ${telegram_polling}"
 log_debug "   - ${notification_type_tc} uses HTTP: ${telegram_http}"
 if [ "${telegram_server}" ]
 then
    log_debug "   - ${notification_type_tc} base URL: ${telegram_protocol}://${telegram_server}/bot${telegram_token:0:2}********${telegram_token:0-2}"
else
  log_debug "   - ${notification_type_tc} base URL: ${telegram_protocol}://api.telegram.org/bot${telegram_token:0:2}********${telegram_token:0-2}"
 fi

These lines above correctly displays the base URL in the logs

 log_debug "   - ${notification_type_tc} notification URL: ${telegram_protocol}://api.telegram.org/bot${telegram_token:0:2}********${telegram_token:0-2}/sendMessage"

But this line above doesn't print out the correct URL if a proxy server is being used.

I've changed it all to:

 if [ "${telegram_server}" ]
 then
    telegram_base_url="${telegram_protocol}://${telegram_server}/bot${telegram_token}"
 else
    telegram_base_url="${telegram_protocol}://api.telegram.org/bot${telegram_token}"
 fi
 notification_url="${telegram_base_url}/sendMessage"
 log_info " | ${notification_type_tc} notifications enabled"
 log_debug "   - ${notification_type_tc} token: ${telegram_token:0:2}********${telegram_token:0-2}"
 log_debug "   - ${notification_type_tc} chat id: ${telegram_chat_id:0:2}********${telegram_chat_id:0-2}"
 log_debug "   - ${notification_type_tc} polling: ${telegram_polling}"
 log_debug "   - ${notification_type_tc} uses HTTP: ${telegram_http}"
 if [ "${telegram_server}" ]
 then
    log_debug "   - ${notification_type_tc} base URL: ${telegram_protocol}://${telegram_server}/bot${telegram_token:0:2}********${telegram_token:0-2}"
    log_debug "   - ${notification_type_tc} notification URL: ${telegram_protocol}://${telegram_server}y/bot${telegram_token:0:2}********${telegram_token:0-2}/sendMessage"
 else
    log_debug "   - ${notification_type_tc} base URL: ${telegram_protocol}://api.telegram.org/bot${telegram_token:0:2}********${telegram_token:0-2}"
    log_debug "   - ${notification_type_tc} notification URL: ${telegram_protocol}://api.telegram.org/bot${telegram_token:0:2}********${telegram_token:0-2}/sendMessage"
 fi

which will correct the logs, but it shouldn't have any effect to how it all operates.

boredazfcuk avatar Dec 06 '25 13:12 boredazfcuk

Thanks for the reply! I finally found that my telegram proxy server will continous refused to response in some specific situation. I hope the script could print the http error info from curl, not just a http status code, this will be very helpful when debugging the proxy server, but this is just a advice :D

zsbai avatar Dec 14 '25 00:12 zsbai