Telegram java.net.SocketTimeoutException: Connect timed out

Hi Guys,
since few days i got these messages:

2024-04-24 10:13:26.276 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 10:13:26.432 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 10:13:36.276 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE

2024-04-24 10:13:36.576 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE

2024-04-24 10:15:56.472 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 10:15:56.679 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 10:16:06.472 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE

2024-04-24 10:16:06.679 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE
2024-04-24 10:17:30.471 [WARN ] [gram.internal.action.TelegramActions] - Exception occured whilst sending message:java.net.SocketTimeoutException: Connect timed out

I thought it was related to the update of the Java version, but a backup of the VM also shows the same error. Thus, no alerts via Telegram are possible and the rule where a Telegram action is included is not executed.

 Release = Debian GNU/Linux 11 (bullseye)
##    Kernel = Linux 5.10.0-28-amd64
##  Platform = QEMU Standard PC (i440FX + PIIX, 1996)
openhabian@openhabian:~$ java -version
openjdk version "17.0.11" 2024-04-16
OpenJDK Runtime Environment (build 17.0.11+9-Debian-1deb11u1)
OpenJDK 64-Bit Server VM (build 17.0.11+9-Debian-1deb11u1, mixed mode, sharing)
openHAB 4.1.2

Any idea would be helpful
Thanks
Simon

Often there will be more details in openhab.log. If not, change the logging level for the Telegram add-on to debug level logging and see if it says something more.

But typically “Connect timed out” means the server never responded to the connection attempt from your client. Either Telegram is down, moved, or you have the wrong address, or something like that. If the connection is established but refused the error is different.

Log Level is set to Trace but i cant see more :slight_smile:

2024-04-24 15:38:23.300 [DEBUG] [gram.internal.action.TelegramActions] - Base64 image provided; converting to binary.

2024-04-24 15:38:52.447 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 15:39:02.447 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:b56f3b7499' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE

2024-04-24 15:39:17.314 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out

2024-04-24 15:39:27.314 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'telegram:telegramBot:1337tb' changed from OFFLINE (COMMUNICATION_ERROR): java.net.SocketTimeoutException: Connect timed out to ONLINE

Well, at this point all I can say is what ever server your Telegram Thing is configured to connect to is failing to connect to that server. Maybe it’s blocked by a firewall. Maybe Telegram is down. Maybe you have the wrong URL in the Thing config.

The logs say that OH is trying to open a socket to the Telegram server but the Telegram server never responds and eventually the connection times out.

1 Like

hm ok i will check, it was running few days ago.
the only thing was update on the linux host.
maybe telegram changed something.

thanks i will keep you updated.

I found it, Pihole was blocking the api.telegram requests! Thanks for the hints :slight_smile: