# Can no longer send Photos to Telegram (using node-red-controb-telegrambot)

**URL:** <https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317>\
**Category:** General\
**Tags:** telegram, home-assistant\
**Created:** [5 January 2024 16:19 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317 "2024-01-05T16:19:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisV](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chrisV](https://discourse.nodered.org/u/chrisV)\
**Post date:** [5 January 2024 16:19 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/1 "2024-01-05T16:19:55Z")

</div>

Hi,  
I have been using the " **sender**" node from: " **node-red-controb-telegrambot**" in my home assistant.  
Many moons ago, I followed the documentation from: [https://flows.nodered.org/node/node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot) to set it up and it has served me very will for a long time

Every time movement was detected, home-assistant took a picture, saved it to a file, and then the "sender" node from: "node-red-controb-telegrambot" posted that picture to my telegram channel.  
Until last week.... I did some updates and must have broken it.

Here, below, is the output from a Debug Node before the message enters the "sender" node.

IMPORTANT:  
if I change the `payload.type` from `photo` to `message`, then I receive a (text) message in telegram, so the connectivity seems OK. But with `photo` or `document`, I get nothing. Also I don't get an error message in the Node-red UI. (I'd be interested in any pointers to potential debug logs)

Also the file `"/config/www/cam_captures/camera.westcam1_20240105_161813.jpg"` does exist. On the filesystem, it is actually under `/usr/share/hassio/homeassistant/www/cam_captures/camera.westcam1_20240105_161813.jpg` but it has always worked like this. I assume it is a chroot re-mapping for home-assistant.

Not sure if it is important:  
My issues (a domino effect) started by a volume running out space, but now there is more than enough free space on that harddrive

```auto

OUTPUT of a DEBUG NODE before the message enters the "sender"
1/5/2024, 4:18:13 PMnode: msg5
msg : Object
object
payload: object
  chatId: "[redacted]"
  messageId: 431
  type: "photo"
  content: "/config/www/cam_captures/camera.westcam1_20240105_161813.jpg"
  caption: "camera.westcam1_20240105_161813.jpg"
originalMessage: object
  message_id: 431
  from: object
    id: [redacted]
    is_bot: false
    first_name: "[redacted]"
    username: "[redacted]2"
    language_code: "en"
  chat: object
    id: [redacted]
    first_name: "[redacted]"
    username: "[redacted]2"
    type: "private"
  date: 1704467893
  text: "/westcam1"
  entities: array[1]
   0: object
    offset: 0
    length: 9
    type: "bot_command"
    _msgid: "36c7506d0636a26a"

```

Any pointers are greatly appreciated,

chrisV

---

<div class="post-metadata">

**Author:** ![chrisV](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chrisV](https://discourse.nodered.org/u/chrisV)\
**Post date:** [5 January 2024 17:46 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/2 "2024-01-05T17:46:40Z")

</div>

UPDATE:  
Node-red is logging in the plugin section of Home-Assistant  
`invalid file HTTP URL specified: URL host is empty`

```auto
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: invalid file HTTP URL specified: URL host is empty
    at /config/node_modules/node-telegram-bot-api/src/telegram.js:284:15
    at tryCatcher (/config/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/config/node_modules/bluebird/js/release/promise.js:547:31)
    at Promise._settlePromise (/config/node_modules/bluebird/js/release/promise.js:604:18)
    at Promise._settlePromise0 (/config/node_modules/bluebird/js/release/promise.js:649:10)
    at Promise._settlePromises (/config/node_modules/bluebird/js/release/promise.js:729:18)
    at _drainQueueStep (/config/node_modules/bluebird/js/release/async.js:93:12)
    at _drainQueue (/config/node_modules/bluebird/js/release/async.js:86:9)
    at Async._drainQueues (/config/node_modules/bluebird/js/release/async.js:102:5)
    at Immediate.Async.drainQueues [as _onImmediate] (/config/node_modules/bluebird/js/release/async.js:15:14)
    at processImmediate (node:internal/timers:476:21)

```

Not sure why it mentions `HTTP URL`  
Also, Node-red is running in a container and I don't know the mapping to the root of that volume.  
I tried a offsets,  
But it worked in the past

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [6 January 2024 09:17 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/3 "2024-01-06T09:17:10Z")

</div>

Just created a quick test flow and can report 'telegrambot' (v 15.1.7) still works for me.

**Note** : Like many people on this Forum, I **don't** use HA or run NR inside a Container.

 ![telegram_A](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/d/7d9806197574206d179d0edd6c73b973fb6978f2.png)

![telegram_B](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/7/17d9ca58e36108aed9b691afd62e285435afbe7f.png)

Code in function node is...

```auto
let cId = 'enter your Chat ID';

msg.payload = { chatId: cId, type:"photo", content:msg.payload, caption:"Snapshot from remote server"};
return msg;

```

---

<div class="post-metadata">

**Author:** ![chrisV](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chrisV](https://discourse.nodered.org/u/chrisV)\
**Post date:** [6 January 2024 15:47 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/4 "2024-01-06T15:47:58Z")

</div>

Thank you for testing @dynamicdave  
I finally restored an old Home Assistant backup and things are working again.  
I upgraded HA core and several other things and the " **sender**" node from: " **node-red-controb-telegrambot**" in my Node-Red in my HA is still working..  
BUT:  
**root cause**  
I kept my Node-Red Nodered on 14.2.2.  
**I assume that it was the upgrade of Node-Red from 14.2.2 to 16.0.2 that broke the sender node of `node-red-contrib-telegrambot v 8.4.0`** package.  
I'm running out of time now, and I will have to address the issue later  
I have a crontab that makes a Backup of my HA every Sunday evening and pushes it to my Dropbox. I want this backup to happen before I experiment any further

---

<div class="post-metadata">

**Author:** ![chrisV](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chrisV](https://discourse.nodered.org/u/chrisV)\
**Post date:** [6 January 2024 15:56 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/5 "2024-01-06T15:56:52Z")

</div>

PS: there seems to be a lot of different Telegram bot packages  
I am using **node-red-contrib-telegrambot 15.1.7** ( [https://flows.nodered.org/node/node-red-contrib-telegrambot](https://flows.nodered.org/node/node-red-contrib-telegrambot))... don't ask my why... it was a looong time ago  
I briefly tested with **@danielnguyen/node-red-contrib-telegrambot-home 0.5.3** ( [node-red-contrib-telegrambot-home (node) - Node-RED](https://flows.nodered.org/node/@danielnguyen/node-red-contrib-telegrambot-home) ) It has exactly the same issue  
I have not tested **node-red-node-telegrambot 0.1.4** ([node-red-node-telegrambot (node) - Node-RED](https://flows.nodered.org/node/node-red-node-telegrambot)) yet..  
This one will be the next one on my list

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [6 January 2024 16:01 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/6 "2024-01-06T16:01:12Z")

</div>

> [@chrisV](#):
>
> I kept my Node-Red Nodered on 14.2.2.

Just note this version means nothing to us.  
The current version of Node RED is 3.1.3 - HA seems to handle their own versioning with Node RED.

As said by @dynamicdave most here do not use HA or container platforms.  
So if this error is being caused by some layer in your setup, you will need to seek guidance from said community.

With that said `ETELEGRAM: 400 Bad Request` doesn't appear that it would be caused by the layers involved, maybe telegram has updated their API, and the node you are using has not been patched 🤷‍♂️

---

<div class="post-metadata">

**Author:** ![chrisV](https://avatars.discourse-cdn.com/v4/letter/c/f9ae1b/32.png) [@chrisV](https://discourse.nodered.org/u/chrisV)\
**Post date:** [6 January 2024 16:33 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/7 "2024-01-06T16:33:53Z")

</div>

**NR Version** :  
interesting... so, the version number may be the version of the HA integration middleware for NR.

I restarted NR and found the real NR version in the log

```auto
Welcome to Node-RED
===================
6 Jan 17:26:11 - [info] Node-RED version: v3.0.2
6 Jan 17:26:11 - [info] Node.js version: v18.16.0
6 Jan 17:26:11 - [info] Linux 6.1.21-v8+ arm LE
6 Jan 17:26:14 - [info] Loading palette nodes

```

**This Community**  
Good feedback about this community, thank you.  
If I need more help I will go to the HA forums

**One last thing about the error:**

```auto
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: invalid file HTTP URL specified: URL host is empty

```

In my setup of NR v3.0.2, this node accepts a filepath, but after the upgrade it seems to expect an HTTP URL... or at least the error message seems to suggest that  
Things may have changed either in NR or in the HA integration  
More things to discover later..  
/chris

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 March 2024 16:33 UTC](https://discourse.nodered.org/t/can-no-longer-send-photos-to-telegram-using-node-red-controb-telegrambot/84317/8 "2024-03-06T16:33:55Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
