core: Unable to send heavy photos to telegram_bot (write timeout)

The problem

After upgrading to 2024.2.0 (python 3.12), the timeout parameter stopped working (ignored). The error occurs when sending “heavy” photos.

Changing the parameter in the range of 60-600 has no effect. When viewing trace details, the runtime is always within 10-11 seconds (runtime: 10.45 seconds).

What version of Home Assistant Core has the issue?

core-2024.2.1

What was the last working version of Home Assistant Core?

core-2024.1.6

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Telegram-bot

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-02-12 13:42:05.083 ERROR (SyncWorker_51) [homeassistant.components.telegram_bot] Error sending animation: urllib3 HTTPError ('Connection aborted.', TimeoutError('The write operation timed out')). Args: (), kwargs: {'chat_id': 1974256, 'animation': <_io.BufferedReader name='/photos/2024-02-11.gif'>, 'caption': '2024-02-11', 'disable_notification': False, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': 600, 'parse_mode': 'HTML'}

Additional information

No response

About this issue

  • Original URL
  • State: open
  • Created 5 months ago
  • Reactions: 1
  • Comments: 17 (4 by maintainers)

Most upvoted comments

It seems to me that #103647 occurred because the timeout parameter was not assigned at all, although the source and the error text are the same. In our case, the timeout parameter is simply ignored.

Let’s wait for #110297 to go into production.

UPD: I rebuilt the docker image with the changes #110297 and can confirm - the timeout problem no longer occurs.