# Telegram not working

**URL:** <https://discourse.nodered.org/t/telegram-not-working/5810>\
**Category:** General\
**Created:** [14 December 2018 14:55 UTC](https://discourse.nodered.org/t/telegram-not-working/5810 "2018-12-14T14:55:13Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffoton](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@ffoton](https://discourse.nodered.org/u/ffoton)\
**Post date:** [14 December 2018 14:55 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/1 "2018-12-14T14:55:13Z")

</div>

Hi,

I am currently using node-red-contrib-telegrambot ([https://www.npmjs.com/package/node-red-contrib-telegrambot](https://www.npmjs.com/package/node-red-contrib-telegrambot)) but the issue remains on other similar Telegram nodes as well.

I am able to send a message using a http get-node, so I know I have the correct token. When I try sending a message with the Telegram Sender-node, nothing happens (it does not even output an error to a debug node).

But I get two errors everytime it polls:

`Unknown error. Trying again.`  
and  
`"EFATAL: Error: connect ENOENT /(MY_TOKEN)/getUpdates"`

When I type `node -v` in terminal it says v8.11.1 and when I type `nodejs -v` it says v8.14.0.

Node-red is version v0.19.5.

I am running Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86\_64).

The Telegram Send node gets the following msg object (injected with a timestamp as payload):

`msg.payload = { chatId: (MY_CHAT_ID), type: 'message', content: msg.payload }`

I also tried exporting the flow to my Node Red installation on my Macbook Pro, and it works fine there.

Any clues why this won't work on Ubuntu?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 December 2018 15:25 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/2 "2018-12-14T15:25:43Z")

</div>

> [@ffoton](#):
>
> content: msg.payload

That should be a string I believe.

Also there is something wrong with your nodejs installation. node and nodejs should be the same thing. How did you install nodejs?  
What does `apt policy nodejs` show?  
[Edit] Also `which node` and `which nodejs`

---

<div class="post-metadata">

**Author:** ![ffoton](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@ffoton](https://discourse.nodered.org/u/ffoton)\
**Post date:** [14 December 2018 16:40 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/3 "2018-12-14T16:40:16Z")

</div>

Thanks for your reply! 🙂

I tried using a string as well, and the same flow works on my Mac. I think you are right that I have something wrong with nodejs.

I forgot to mention, that I manually installed nvm and then nodejs 8.11.1. This was because I read that the Telegram nodes only was tested to v8.11.1.

Here are the results from the commands, it seems like I have installed it on different users…?

**which node**  
`/home/(USERNAME)/.nvm/versions/node/v8.11.1/bin/node`

**which nodejs**  
`/usr/bin/nodejs`

**apt policy nodejs**

> ```
> nodejs:
> Installed: 8.14.0-1nodesource1
> Candidate: 8.14.0-1nodesource1
> Version table:
> *** 8.14.0-1nodesource1 500
> 500 https://deb.nodesource.com/node_8.x bionic/main amd64 Packages
> 100 /var/lib/dpkg/status
> 8.10.0~dfsg-2ubuntu0.4 500
> 500 http://se.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages
> 8.10.0~dfsg-2ubuntu0.2 500
> 500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
> 8.10.0~dfsg-2 500
> 500 http://se.archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
> 
> ```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [14 December 2018 16:55 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/4 "2018-12-14T16:55:25Z")

</div>

I would get rid of the manually installed one, I am sure it will be ok with later versions.  
On Ubuntu you can use the Pi install script to install/update node-red and that will give you a consistent set of tools to work with, and you can use it again if you want to upgrade. If you were going to do that though, get rid of the local one first.  
[https://nodered.org/docs/hardware/raspberrypi](https://nodered.org/docs/hardware/raspberrypi)

---

<div class="post-metadata">

**Author:** ![ffoton](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@ffoton](https://discourse.nodered.org/u/ffoton)\
**Post date:** [14 December 2018 17:08 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/5 "2018-12-14T17:08:54Z")

</div>

OK thanks 🙂 But the reason I installed the older version in the first place was because of that very problem. So my question/errors still remain… ☹

What else might cause that?

EDIT:

On my Mac I have v8.11.0, maybe it's that simple. How do I downgrade successfully to that version on Ubuntu? I have gotten rid of the local one. (In the link you provided, I did not find any way to downgrade, but maybe I missed it?).

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 December 2018 21:48 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/6 "2018-12-14T21:48:35Z")

</div>

You don't need to downgrade, that isn't the issue. I'm using v8.13.0 on one Pi, 8.14.0 on another and v8.12.0 on my Windows 10 PC. All 3 devices run Node-RED and all 3 have different Telegram bots running on them successfully.

Do make sure that you only have each bot running on 1 device however. You cannot run the same bot connection on two different devices or indeed two different instances of Node-RED.

---

<div class="post-metadata">

**Author:** ![ffoton](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@ffoton](https://discourse.nodered.org/u/ffoton)\
**Post date:** [14 December 2018 21:59 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/7 "2018-12-14T21:59:22Z")

</div>

Thanks for the info, then I won't waste any time on that. I am not running the bot on any other devices (aside from trying on my Mac earlier) however.

Is there some dependencies that I might have on my Mac that's not installed by default on Ubuntu? Since it's working there.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [14 December 2018 22:03 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/8 "2018-12-14T22:03:44Z")

</div>

> [@ffoton](#):
>
> dependencies

I'm not aware of any dependencies that it needs but you could check the docs for the node. I certainly don't ever remember any dependencies. But then I've been using Telegram bots for quite a long time now. Though thinking about it, I only recently set up a telegram bot on my Windows dev PC which is fairly new - don't think I'd done it on this PC previously and I put a new install of Node-RED on it when I got it. I'm sure there were no dependencies. However, I always install build essentials and I'd always recommend getting your platform build tools installed before doing much with Node.JS.

---

<div class="post-metadata">

**Author:** ![ffoton](https://avatars.discourse-cdn.com/v4/letter/f/a4c791/32.png) [@ffoton](https://discourse.nodered.org/u/ffoton)\
**Post date:** [15 December 2018 19:30 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/9 "2018-12-15T19:30:51Z")

</div>

OK. 🙂 I did not install anything else on my Mac either, but I figured that there maybe is some piece that does not come with Ubuntu that I'm missing? I have unfortunately already installed build essential and everything is up-to-date. 😕 Not quite sure what the platform build tools for my platform is though? Kind of new to this, if you have any links that would be appreciated.

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [16 December 2018 00:02 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/10 "2018-12-16T00:02:29Z")

</div>

> [@ffoton](#):
>
> f you have any links that would be appreciated.

Right, time to go back to basics.

Stop Node-RED if it is running, rename your userDir folder, npm uninstall -g node-red (and anything else you have installed globally). Then remove both copies of node and nvm. A reboot at this stage would probably be sensible.

Next, install node v8 latest using the instructions on the node website. Make sure it is working correctly.

Now install node-red according to the instructions. Make sure that is working correctly. Then install the telegram node, configure and try it out.

---

<div class="post-metadata">

**Author:** ![Harpau](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/harpau/32/8425_2.png) [@Harpau](https://discourse.nodered.org/u/Harpau)\
**Post date:** [20 July 2022 11:50 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/11 "2022-07-20T11:50:29Z")

</div>

I have the same problem and spent a lot time to find a solution. But with no success:  
On my first installation, running Node Red v1.2.9 the node-red-contrib-telegrambot is working fine as expected.  
On my new System (Intel NUC + Debian) I installed Node Red using the script for Raspberry Pi. Node Red is running as a service and the only thing running on that system.  
If I try sending a message there is happening absolute nothing, even no message on both outputs of the sender node.  
I would be really happy if someone has an idea!

Harald

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 July 2022 12:19 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/12 "2022-07-20T12:19:12Z")

</div>

Harald, please start a new thread (this one is over 4 years old and MUCH has changed in that time)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 July 2022 12:19 UTC](https://discourse.nodered.org/t/telegram-not-working/5810/13 "2022-07-20T12:19:20Z")

</div>


