home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.43k stars 30.67k forks source link

MQTT not working starting in 2024.5.4 #117714

Closed ve6rah closed 4 months ago

ve6rah commented 5 months ago

The problem

Starting upon upgrade from 2024.5.3 to 2024.5.4 MQTT stops working, clients connect, but no data is transmitted. Supervisor log shows MQTT errors.

What version of Home Assistant Core has the issue?

core-2024.5.4

What was the last working version of Home Assistant Core?

core-2024.5.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

MQTT

Link to integration documentation on our website

https://www.home-assistant.io/integrations/mqtt/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

no ack from mqtt server in 10 seconds

Additional information

The MQTT error in the log just repeats over and over again. No errors visible in the MQTT add-on.

Multiple reboots, and restarts of HA, and of the MQTT add-on fail to resolve the issue. Downgrading to 2024.5.3 immediately solves the problem.

home-assistant[bot] commented 5 months ago

Hey there @emontnemery, @jbouwh, @bdraco, mind taking a look at this issue as it has been labeled with an integration (mqtt) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `mqtt` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign mqtt` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


mqtt documentation mqtt source (message by IssueLinks)

anthony-maio commented 5 months ago

Looks like whatever ws library provides websocketwrapper in dev is not what we have in the main branch, this is in core btw (docker)

I'm sure it's obvious, but this is due to the cherry picked change in mqtt-client this release.

Logger: homeassistant Source: components/mqtt/client.py:550 First occurred: 04:10:54 (39 occurrences) Last logged: 04:49:45

Error doing job: Exception in callback MQTT._async_on_socket_open(, None, ) Error doing job: Exception in callback MQTT._async_on_socket_open(, None, ) Error doing job: Exception in callback MQTT._async_on_socket_open(, None, ) Error doing job: Exception in callback MQTT._async_on_socket_open(, None, ) Error doing job: Exception in callback MQTT._async_on_socket_open(, None, ) Traceback (most recent call last): File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 582, in _async_on_socket_open self._increase_socket_buffer_size(sock) File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 550, in _increase_socket_buffer_size sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, new_buffer_size) ^^^^^^^^^^^^^^^ AttributeError: 'WebsocketWrapper' object has no attribute 'setsockopt'

bdraco commented 5 months ago

https://github.com/home-assistant/core/pull/117672

bdraco commented 5 months ago

https://github.com/home-assistant/core/issues/115958#issuecomment-2118534580

SB0519 commented 5 months ago

This is on a esxi server not docker.

bdraco commented 4 months ago

Looks like this one was fixed in https://github.com/home-assistant/core/pull/117672

Danifly80 commented 4 months ago

I have still the same problem with home assistant core 2024.6.4 on docker

bdraco commented 4 months ago

@Danifly80

Please start a fresh issue with full logs. https://www.home-assistant.io/docs/configuration/troubleshooting/#debug-logs-and-diagnostics