Telegram problem 409

Hi

I have a problem with the telegram bot. This message is in the log approximately two times per minute:

2020-04-09 07:22:54 ERROR (updater) [telegram.ext.updater] Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)

I do not have Node-RED running! I configured Telegram bot like this:

telegram_bot:
  - platform: polling
    api_key: !secret telegram_api_key
    allowed_chat_ids:
      - !secret telegram_chat_id

notify:
  - platform: telegram
    name: telegram
    chat_id: !secret telegram_chat_id

I send messages from automations.yaml like this:

  action:
    - service: notify.telegram
      data:
        message: "Test message"

The bot indeed sends duplicates:

image

So there should be really only one instance running! How can I fix that (HASS 0.108)?

Thx a lot!

Have you tried restarting home assistant?

Sure! Many times… :wink:

Hm :thinking: Am I really the only one who uses Telegram and has this problem? My log is growing like crazy:

2020-04-09 23:45:20 ERROR (updater) [telegram.ext.updater] Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)
2020-04-09 23:45:28 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:45:54 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:46:20 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:46:26 ERROR (updater) [telegram.ext.updater] Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)
2020-04-09 23:46:46 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:46:59 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:47:18 WARNING (updater) [telegram.vendor.ptb_urllib3.urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fed21122490>: Failed to establish a new connection: [Errno -3] Try again')': /bot583862141:AAHC3BKXijUZ3udxgbfXJN-E8sMbl3eA6kI/getUpdates
2020-04-09 23:47:23 WARNING (updater) [telegram.vendor.ptb_urllib3.urllib3.connectionpool] Retrying (Retry(total=1, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fed22ac8f90>: Failed to establish a new connection: [Errno -3] Try again')': /bot583862141:AAHC3BKXijUZ3udxgbfXJN-E8sMbl3eA6kI/getUpdates
2020-04-09 23:47:25 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:47:28 WARNING (updater) [telegram.vendor.ptb_urllib3.urllib3.connectionpool] Retrying (Retry(total=0, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fed1d373510>: Failed to establish a new connection: [Errno -3] Try again')': /bot583862141:AAHC3BKXijUZ3udxgbfXJN-E8sMbl3eA6kI/getUpdates
2020-04-09 23:47:33 ERROR (updater) [telegram.ext.updater] Error while getting Updates: urllib3 HTTPError HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot583862141:AAHC3BKXijUZ3udxgbfXJN-E8sMbl3eA6kI/getUpdates (Caused by NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fed1c4bf1d0>: Failed to establish a new connection: [Errno -3] Try again'))
2020-04-09 23:47:38 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12
2020-04-09 23:47:39 WARNING (updater) [telegram.vendor.ptb_urllib3.urllib3.connectionpool] Retrying (Retry(total=2, connect=None, read=None, redirect=None)) after connection broken by 'NewConnectionError('<telegram.vendor.ptb_urllib3.urllib3.connection.VerifiedHTTPSConnection object at 0x7fed1d3a8850>: Failed to establish a new connection: [Errno -3] Try again')': /bot583862141:AAHC3BKXijUZ3udxgbfXJN-E8sMbl3eA6kI/getUpdates

I opened an issue on github.
Stay healthy! Have a nice weekend! :slight_smile:

Did you find a resolution to this issue?
I had telegram notifications working, but they stopped and I have similar errors in my log file.
I’m not sure what changed, and I am new to HA so I’m not good at troubleshooting it.

Hi

For me it was definitely related to the changes in the init system of HA. I actually had two instances running at the same time. I was running core, not HassOS. So I assume that your problem is totally different from mine. So it might be better to open a new issue? Anyway. I reopen it again if it helps…

Maybe you find a solution there and/or reopen the issue on Github?!

I am having the same issue after create the telegram notify, do you have any update on the issue? THanks