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.68k stars 30.81k forks source link

SkyConnect / ZHA Failed to setup: socket.gaierror: [Errno -5] Name has no usable address #94418

Closed lordfiSh closed 9 months ago

lordfiSh commented 1 year ago

The problem

After Updating to core-2023.6.1, ZHA no longer works. Restart and Repluggin the Stick won't help

What version of Home Assistant Core has the issue?

core-2023.6.1

What was the last working version of Home Assistant Core?

core-2023.6.0

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Zigbee Home Automation

Link to integration documentation on our website

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

Diagnostics information

Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:205
Integration: Zigbee Home Automation ([documentation](https://www.home-assistant.io/integrations/zha), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+zha%22))
First occurred: 10 June 2023 at 20:32:26 (3 occurrences)
Last logged: 10 June 2023 at 20:32:36

    Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
    Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 2 of 3)
    Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 3 of 3)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 205, in async_initialize
    self.application_controller = await app_controller_cls.new(
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 219, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 193, in startup
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 131, in connect
    self._ezsp = await bellows.ezsp.EZSP.initialize(self.config)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 147, in initialize
    await ezsp.connect(use_thread=zigpy_config[conf.CONF_USE_THREAD])
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 164, in connect
    self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 414, in connect
    protocol, _ = await _connect(config, application)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 385, in _connect
    transport, protocol = await zigpy.serial.create_serial_connection(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/serial.py", line 31, in create_serial_connection
    transport, protocol = await loop.create_connection(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1045, in create_connection
    infos = await self._ensure_resolved(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1419, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address
Logger: zigpy.application
Source: /usr/local/lib/python3.11/site-packages/zigpy/application.py:196
First occurred: 10 June 2023 at 20:32:26 (3 occurrences)
Last logged: 10 June 2023 at 20:32:36
Couldn't start application

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 193, in startup
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 131, in connect
    self._ezsp = await bellows.ezsp.EZSP.initialize(self.config)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 147, in initialize
    await ezsp.connect(use_thread=zigpy_config[conf.CONF_USE_THREAD])
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 164, in connect
    self._gw = await bellows.uart.connect(self._config, self, use_thread=use_thread)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 414, in connect
    protocol, _ = await _connect(config, application)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 385, in _connect
    transport, protocol = await zigpy.serial.create_serial_connection(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/zigpy/serial.py", line 31, in create_serial_connection
    transport, protocol = await loop.create_connection(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1045, in create_connection
    infos = await self._ensure_resolved(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1419, in _ensure_resolved
    return await loop.getaddrinfo(host, port, family=family, type=type,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 867, in getaddrinfo
    return await self.run_in_executor(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/socket.py", line 962, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address

Additional information

The Silicon Labs Multiprotocol Container is runnning and shows no errors

home-assistant[bot] commented 1 year ago

Hey there @dmulcahey, @adminiuga, @puddly, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` 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 zha` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

Schlonzmann commented 1 year ago

Same problems here but my Silicon labs said that he is unable to flash the firmware

`[17:20:59] INFO: The otbr-web is disabled. s6-rc: info: service mdns: starting s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service mdns successfully started s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting cont-init: info: running /etc/cont-init.d/check-cpcd-shm.sh [17:20:59] INFO: Starting mDNS Responder... Default: mDNSResponder (Engineering Build) (Jun 7 2023 11:41:53) starting Default: mDNS_AddDNSServer: Lock not held! mDNS_busy (0) mDNS_reentrancy (0) cont-init: info: /etc/cont-init.d/check-cpcd-shm.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service banner: starting

Add-on: Silicon Labs Multiprotocol Zigbee and OpenThread multiprotocol add-on

Add-on version: 2.1.0 You are running the latest version of this add-on. System: Home Assistant OS 10.2 (amd64 / qemux86-64) Home Assistant Core: 2023.6.1 Home Assistant Supervisor: 2023.06.1

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service banner successfully started s6-rc: info: service universal-silabs-flasher: starting [17:20:59] INFO: Checking /dev/ttyUSB0 identifying SkyConnect v1.0 from Nabu Casa. [17:20:59] INFO: Starting universal-silabs-flasher with /dev/ttyUSB0 2023-06-11 17:21:00 homeassistant universal_silabs_flasher.flash[181] INFO Extracted GBL metadata: NabuCasaMetadata(metadata_version=1, sdk_version='4.2.3', ezsp_version=None, ot_rcp_version=None, fw_type=<FirmwareImageType.RCP_UART_802154: 'rcp-uart-802154'>, baudrate=460800) 2023-06-11 17:21:00 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.GECKO_BOOTLOADER at 115200 baud 2023-06-11 17:21:02 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.CPC at 460800 baud 2023-06-11 17:21:06 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.CPC at 115200 baud 2023-06-11 17:21:10 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.CPC at 230400 baud 2023-06-11 17:21:15 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.EZSP at 115200 baud 2023-06-11 17:21:20 homeassistant universal_silabs_flasher.flasher[181] INFO Probing ApplicationType.SPINEL at 460800 baud Error: Failed to probe running application type s6-rc: warning: unable to start service universal-silabs-flasher: command exited 1 /run/s6/basedir/scripts/rc.init: warning: s6-rc failed to properly bring all the services up! Check your logs (in /run/uncaught-logs/current if you have in-container logging) for more information. /run/s6/basedir/scripts/rc.init: fatal: stopping the container. s6-rc: info: service mdns: stopping s6-rc: info: service banner: stopping Default: mDNSResponder (Engineering Build) (Jun 7 2023 11:41:53) stopping s6-rc: info: service banner successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped [17:21:24] INFO: mDNS ended with exit code 4 (signal 0)... s6-rc: info: service mdns successfully stopped`

lordfiSh commented 1 year ago

@Schlonzmann I had the same Problem, replugging the Stick and Restarting the Container fixed at least that Problem for me

Schlonzmann commented 1 year ago

Automatic firmware update disabled

`17:42:32] INFO: The otbr-web is disabled. s6-rc: info: service mdns: starting s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service mdns successfully started s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting cont-init: info: running /etc/cont-init.d/check-cpcd-shm.sh [17:42:32] INFO: Starting mDNS Responder... Default: mDNSResponder (Engineering Build) (Jun 7 2023 11:41:53) starting Default: mDNS_AddDNSServer: Lock not held! mDNS_busy (0) mDNS_reentrancy (0) cont-init: info: /etc/cont-init.d/check-cpcd-shm.sh exited 0 s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service banner: starting

Add-on: Silicon Labs Multiprotocol Zigbee and OpenThread multiprotocol add-on

Add-on version: 2.1.0 You are running the latest version of this add-on. System: Home Assistant OS 10.2 (amd64 / qemux86-64) Home Assistant Core: 2023.6.1 Home Assistant Supervisor: 2023.06.1

Please, share the above information when looking for help or support in, e.g., GitHub, forums or the Discord chat.

s6-rc: info: service banner successfully started s6-rc: info: service universal-silabs-flasher: starting [17:42:33] INFO: Flashing firmware is disabled s6-rc: info: service universal-silabs-flasher successfully started s6-rc: info: service cpcd-config: starting [17:42:33] INFO: Generating cpcd configuration. s6-rc: info: service cpcd-config successfully started s6-rc: info: service cpcd: starting [17:42:33] INFO: Starting cpcd... WARNING in function 'main' in file /usr/src/cpc-daemon/main.c at line #188 : Running CPCd as 'root' is not recommended. Proceed at your own risk. [17:42:33:650279] Info : [CPCd v4.2.2.0] [Library API v3] [RCP Protocol v3] [17:42:33:650302] Info : Git commit: a4f53d8357b5432689773ec2eea117654f526705 / branch: [17:42:33:650302] Info : Sources hash: 24f9802026e003036eec3dda618f8cf060114efc9551b2fdd5eb331416b64f31 [17:42:33:650304] WARNING : In function 'main' in file /usr/src/cpc-daemon/main.c at line #188 : Running CPCd as 'root' is not recommended. Proceed at your own risk. [17:42:33:650313] Info : Reading cli arguments [17:42:33:650315] Info : /usr/local/bin/cpcd [17:42:33:652109] Info : Reading configuration [17:42:33:652113] Info : file_path = /usr/local/etc/cpcd.conf [17:42:33:652113] Info : instance_name = cpcd_0 [17:42:33:652114] Info : socket_folder = /dev/shm [17:42:33:652115] Info : operation_mode = MODE_NORMAL [17:42:33:652115] Info : use_encryption = false [17:42:33:652116] Info : binding_key_file = /etc/binding-key.key [17:42:33:652116] Info : binding_key_override = false [17:42:33:652117] Info : binding_method = [17:42:33:652118] Info : stdout_tracing = false [17:42:33:652118] Info : file_tracing = false [17:42:33:652119] Info : lttng_tracing = false [17:42:33:652119] Info : enable_frame_trace = false [17:42:33:652120] Info : traces_folder = /dev/shm/cpcd-traces [17:42:33:652120] Info : bus = UART [17:42:33:652121] Info : uart_baudrate = 57600 [17:42:33:652121] Info : uart_hardflow = true [17:42:33:652122] Info : uart_file = /dev/ttyUSB0 [17:42:33:652122] Info : spi_file = /dev/spidev0.0 [17:42:33:652123] Info : spi_bitrate = 1000000 [17:42:33:652123] Info : spi_mode = SPI_MODE_0 [17:42:33:652124] Info : spi_bit_per_word = 8 [17:42:33:652124] Info : spi_cs_chip = gpiochip0 [17:42:33:652125] Info : spi_cs_pin = 8 [17:42:33:652125] Info : spi_irq_chip = gpiochip0 [17:42:33:652126] Info : spi_irq_pin = 22 [17:42:33:652126] Info : fu_reset_chip = gpiochip0 [17:42:33:652127] Info : fu_spi_reset_pin = 23 [17:42:33:652127] Info : fu_wake_chip = gpiochip0 [17:42:33:652128] Info : fu_spi_wake_pin = 24 [17:42:33:652128] Info : fu_recovery_enabled = false [17:42:33:652129] Info : fu_connect_to_bootloader = false [17:42:33:652129] Info : fu_enter_bootloader = false [17:42:33:652130] Info : fu_file = [17:42:33:652130] Info : restart_cpcd = false [17:42:33:652131] Info : board_controller_ip_addr = [17:42:33:652131] Info : application_version_validation = false [17:42:33:652132] Info : print_secondary_versions_and_exit = false [17:42:33:652132] Info : use_noop_keep_alive = false [17:42:33:652133] Info : reset_sequence = true [17:42:33:652133] Info : uart_validation_test_option = [17:42:33:652134] Info : stats_interval = 0 [17:42:33:652134] Info : rlimit_nofile = 2000 [17:42:33:652135] Info : ENCRYPTION IS DISABLED [17:42:33:652135] Info : Starting daemon in normal mode [17:42:33:669861] Info : Connecting to Secondary... [17:42:35:670081] Info : Failed to connect, secondary seems unresponsive [17:42:35:670106] Info : Connecting to Secondary... [17:42:37:670358] Info : Failed to connect, secondary seems unresponsive [17:42:37:670379] Info : Connecting to Secondary... [17:42:39:670581] Info : Failed to connect, secondary seems unresponsive [17:42:39:670600] Info : Connecting to Secondary...`

replugging dosent worked for me,

tried to flash the stick over HP https://skyconnect.home-assistant.io/firmware-update/

i created a new vm and run without any add-ons ZHA it works, but if you aktivate the silicon add-on zha crashed again

tuxeri commented 1 year ago

For me most of the Zigbee network died after updating Silabs Multiprotocol firmware. Only couple devices work anymore.

alpat59 commented 1 year ago

Same problem here with Sky Connect (by Nabu casa) Zigbee Coordinator. No devices reachable. And no chance to add new devices. Thank you for your help

kk3844 commented 1 year ago

Adding to this. I'm running HA on physical hardware (repurposed HP thin client) and have found that the SkyConnect appears to lock up. The serial device that is connected to HA disappears or says it is 'in use'. The only solution is to physically remove it from the USB port and plug it back in, then restart HA. Just restarting HA or the host doesn't seem to do it. Bad firmware release for the SkyConnect maybe?

lordfiSh commented 1 year ago

This seems to fixed with the latest Update. Sky Connect is working for me now

Home Assistant 2023.7.0 Supervisor 2023.07.1 Operating System 10.3

/edit: Problem is back

deanfranken commented 1 year ago

I've always had issues. Every upgrade since I got mine in March, I had to unplug for 10 mins then use a new USB port before a reload would detect and thing would work. Since 2023.6.1 I haven't been able to get it to work again no matter what reboots or replugs I try. I've been hoping a firmware patch or update would fix it but still cannot get mine to work. I get the same "name no usable address" despite being on the same versions as lordfiSH.

kk3844 commented 1 year ago

Add-on version: 2.2.0 You are running the latest version of this add-on. System: Home Assistant OS 10.3 (amd64 / generic-x86-64) Home Assistant Core: 2023.7.0 Home Assistant Supervisor: 2023.07.1

Still experiencing the issue... serial port of the SkyConnect is dead unless it is power cycled. Still suspecting this is a firmware issue.

lafriks commented 1 year ago

I also experienced this error after upgrade to latest Home Assistant OS, only disconnecting skyconnect for some time and connecting back and then OS reboot did help to get it back

Home Assistant 2023.8.0
Supervisor 2023.07.1
Operating System 10.4
jtbandes commented 1 year ago

I experienced this error after restarting my HA server. I was eventually able to fix it by clicking "reload" on the ZHA integration:

image
issue-triage-workflows[bot] commented 9 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.