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.64k stars 30.79k forks source link

MQTT intégration doesn't not start after Hard reboot - failed to setup #129961

Closed dathosim closed 1 day ago

dathosim commented 6 days ago

The problem

After a full system reboot, it became impossible to reconnect all my Zigbee devices via MQTT I have no error on the Zigbee2MQTT addon - I can see the list of your Devices and I can change the status No error either on the installed Mosquito broker - it works - no error in the logs

But as soon as I restart HA or the system, the MQTT integration displays the error "failed to setup" And in the logs at startup or if I activate debugging I see this: see logs below

`Logger: homeassistant.config_entries Source: config_entries.py:594 First occurred: 10:31:34 (2 occurrences) Last logged: 16:21:01

Error setting up entry Mosquitto broker for mqtt Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/mqtt/init.py", line 272, in async_setup_entry mqtt_data, conf = await _setup_client(client_available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/mqtt/init.py", line 252, in _setup_client await client.async_start(mqtt_data) File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 428, in async_start await self.async_init_client() File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 462, in async_init_client await async_import_module( File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 60, in async_import_module import_future.result() File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 50, in async_import_module module = await hass.async_add_import_executor_job(_get_module, cache, name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, *self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 26, in _get_module cache[name] = importlib.import_module(name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func return func(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 995, in exec_module File "", line 488, in _call_with_frames_removed File "/usr/src/homeassistant/homeassistant/components/mqtt/async_client.py", line 9, in from paho.mqtt.client import Client as MQTTClient File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 72, in import dns.resolver File "/usr/local/lib/python3.12/site-packages/dns/resolver.py", line 30, in import dns._ddr File "/usr/local/lib/python3.12/site-packages/dns/_ddr.py", line 12, in import dns.nameserver File "/usr/local/lib/python3.12/site-packages/dns/nameserver.py", line 5, in import dns.asyncquery File "/usr/local/lib/python3.12/site-packages/dns/asyncquery.py", line 40, in from dns.query import ( File "/usr/local/lib/python3.12/site-packages/dns/query.py", line 46, in import dns.xfr File "/usr/local/lib/python3.12/site-packages/dns/xfr.py", line 29, in import dns.zone File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 991, in exec_module File "", line 1124, in get_code File "", line 753, in _compile_bytecode ValueError: bad marshal data (unknown type code) `

What version of Home Assistant Core has the issue?

core-2024.10.4

What was the last working version of Home Assistant Core?

core-2024.10.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

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

Link to integration documentation on our website

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

Diagnostics information

no diagnostic

Example YAML snippet

no yaml

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:594
First occurred: 10:31:34 (2 occurrences)
Last logged: 16:21:01

Error setting up entry Mosquitto broker for mqtt
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 594, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 272, in async_setup_entry
    mqtt_data, conf = await _setup_client(client_available)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py", line 252, in _setup_client
    await client.async_start(mqtt_data)
  File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 428, in async_start
    await self.async_init_client()
  File "/usr/src/homeassistant/homeassistant/components/mqtt/client.py", line 462, in async_init_client
    await async_import_module(
  File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 60, in async_import_module
    import_future.result()
  File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 50, in async_import_module
    module = await hass.async_add_import_executor_job(_get_module, cache, name)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/importlib.py", line 26, in _get_module
    cache[name] = importlib.import_module(name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/mqtt/async_client.py", line 9, in <module>
    from paho.mqtt.client import Client as MQTTClient
  File "/usr/local/lib/python3.12/site-packages/paho/mqtt/client.py", line 72, in <module>
    import dns.resolver
  File "/usr/local/lib/python3.12/site-packages/dns/resolver.py", line 30, in <module>
    import dns._ddr
  File "/usr/local/lib/python3.12/site-packages/dns/_ddr.py", line 12, in <module>
    import dns.nameserver
  File "/usr/local/lib/python3.12/site-packages/dns/nameserver.py", line 5, in <module>
    import dns.asyncquery
  File "/usr/local/lib/python3.12/site-packages/dns/asyncquery.py", line 40, in <module>
    from dns.query import (
  File "/usr/local/lib/python3.12/site-packages/dns/query.py", line 46, in <module>
    import dns.xfr
  File "/usr/local/lib/python3.12/site-packages/dns/xfr.py", line 29, in <module>
    import dns.zone
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 991, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1124, in get_code
  File "<frozen importlib._bootstrap_external>", line 753, in _compile_bytecode
ValueError: bad marshal data (unknown type code)

Additional information

no

home-assistant[bot] commented 6 days 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)

dathosim commented 1 day ago

no problem with update core-2024-11