Help on telegram extension "Error while getting Updates: Conflict: terminated by other getUpdates request; make sure that only one bot instance is running (409)"

Hi all,
I just installed the telegram platform and it apparently works, but I suspect it misses some notifications and my home_assistant.log is flooded every few seconds by these error messages:

2020-03-09 19:50:59 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-03-09 19:51:05 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-03-09 19:51:11 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-03-09 19:51:18 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-03-09 19:51:33 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-03-09 19:51:38 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-03-09 19:51:44 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-03-09 19:51:51 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-03-09 19:51:59 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-03-09 19:52:09 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 followed the official guide and here is my structured configuration.yaml

integrations/telegram_bot.yaml :

telegram_bot:
  - platform: polling
    api_key: !secret telegram_bot_api_key
    allowed_chat_ids:
      - !secret telegram_bot_piero_chat_id

integrations/notify.yaml :

notify:
  - name: telegram_piero
    platform: telegram
    chat_id: !secret telegram_bot_piero_chat_id

automations.yaml (generated by the WEB UI):

- id: '1583691545817'
  alias: Corona virus
  description: ''
  trigger:
  - entity_id: sensor.italy_coronavirus_confirmed
    platform: state
  condition: []
  action:
  - data:
      message: 'Corona virus confirmed Italy:  {{ states("sensor.italy_coronavirus_confirmed")
        }}'
    service: notify.telegram_piero

automations/notify_failed_logins.yaml :

alias: "Notify failed logins"

initial_state: true

trigger:
  - platform: state
    entity_id: persistent_notification.http_login

condition:
  - condition: template
    value_template: "{{ trigger.to_state.state != 'None' }}"

action:

  - service: notify.telegram_piero
    data_template:
      title: "{{ states.persistent_notification.http_login.attributes.message }}"
      message: 'url: https://whatismyipaddress.com/ip/{{ states.persistent_notification.http_login.attributes.message.split ("from ") [1]}}'

  - service: persistent_notification.dismiss
    data:
      notification_id: 'http_login'

automations/notify_new_devices.yaml :

alias: "Notify new devices"

initial_state: true

trigger:
  - platform: event
    event_type: device_tracker_new_device

action:
  - service: notify.telegram_piero
    data_template:
      message: '{{trigger.event.data.entity_id}}'
      title: New device

Please help me to sort out this.
Thanks,
Piero

same problem

Hi @PieBru

I’m currently trying to run telegram bot using AppDaemon and I also have the same problem. It looks like your old bot instance is still live and HA is trying to create new. I guess it’s because you’re adding new automations and HA is trying to create a new telegram bot instance but doesn’t care about the old one.
Have you tried restarting your Home Assistant instance after adding new automation?

I have the same problem - running HA in Docker container - restarted several times already - no change …

As far I remember, my problem disappeared after upgrading my server and removing the two automations automations/notify_failed_logins.yaml and automations/notify_new_devices.yaml, thus leaving in place only the covid-19 notification.
I didn’t update this post because upgrading the server I lost the real cause of the solution.

I do have the same problem.
I don’t understand the solution of PieBru?

upgrading what server? and how to do?

@Canedje “upgraded my server” means I switched from a Raspberry PI to a more powerful Z8350 where I then restored the last HassIO backup.

To look at the removed automations, check my OP sources.

As I said:

Thanks for the answer.

I did find the problem and solution.
The error is because and HA and Nodered is starting a Telegram Bot.
I stopt (removed the telegram_bot in configuration.yaml) the bot in HA and only use the bot in Noder-RED, now it is working without creating the 409 errors

6 Likes

It looks that it also helped me!

1 Like

Thanks for the idea.

Your welcome

Hi. I have the same problem, and like @Canedje I have the Telegram Bot in HA and Node-Red. I removed all Telegram Integration on HA… but the error still happend.

Any recomendations?

Thanks in advance.

Hi @PieBru! o/
I found the solution.
revoke your bot token and create a new, that prevents all old instances from working naturally

Did you do remove in configuration.yaml?
like:

#----------------------------------------------------------------
# Telegram settings - disabled for double bot with Node-RED
#----------------------------------------------------------------
#telegram_bot:
#  - platform: polling
#    api_key: your key
#    allowed_chat_ids:
#     - your id

and only using one in NodeRED?

Hi @Canedje, thanks for your answer.
In my configuration.yaml invoque the telegram and notify file in this way:

#telegram_bot: !include telegram_bot.yaml
#notify: !include notify.yaml

and have removed those file for precaution… but the error still hapend to me. The wors thing is that the debug mesagge from node red repeat for the eternety the mesagge:

Thanks for your comments.

It looks like your using more then one bots in your NodeRED enviroment.
Are you using more then one telegram bot in NodeRED in different nodes?

only one bot here!

Your error message is saying your still using more then one bot

I have two bots, but in diferent NodeRED installation. One for QA and the other for production. In separate HA installations (Raspi4).
When I use some nodered flow from the web, in the property that you show me, yes… apears other bots, but only like residual way. A dont know really how to erase this. Its posiblle to?

Thanks!

If you hit the pencil in my first picture beside the bot name you will open next screen.
There you can remove a bot

It is only allowed to run one bot. Thats the trick

so: Klick the residual bot in the node. Hit the pencil as I mentioned above, and remove the extra ones

I can only explane the problem you are or still using a Telegram bot in HA or more then one in NodeRED

You right!!! I remove like 15 bots LOL
I restart Node RED and HA… but the messages still happen :frowning:

did you restart HA or nodeRED? (sorry didn’t read your message well, you did so)
Or else there must be still more then one bot running
Your error message is showing the nodes where it is going wrong

I do see two of them coming back