Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart logs 'Name has no usable address' on Shelly device #118878

Closed
Mariusthvdb opened this issue Jun 5, 2024 · 2 comments · Fixed by #119174
Closed

Restart logs 'Name has no usable address' on Shelly device #118878

Mariusthvdb opened this issue Jun 5, 2024 · 2 comments · Fixed by #119174

Comments

@Mariusthvdb
Copy link
Contributor

The problem

as title, though the device itself seems to be ok, see screenshot below

What version of Home Assistant Core has the issue?

2024.6.0b8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Shelly BLE

Link to integration documentation on our website

https://rc.home-assistant.io/integrations/shelly/

Diagnostics information

config_entry-shelly-28ee0e7cb35e8a8bdffe0ce100d3fa3f.json

Example YAML snippet

nothing in yaml

Anything in the logs that might be useful for us?

2024-06-05 12:55:48.125 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 345, in call_rpc
    return await self._wsrpc.call(method, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 414, in call
    resp = await self._rpc_call(method, params, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 447, in _rpc_call
    resp = await future
           ^^^^^^^^^^^^
aioshelly.exceptions.DeviceConnectionError: <aioshelly.rpc_device.wsrpc.RPCCall object at 0x7f3abcfeca60>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 161, in _handle_ha_stop
    await self.shutdown()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 699, in shutdown
    await async_stop_scanner(self.device)
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 34, in async_stop_scanner
    script_name_to_id = await _async_get_scripts_by_name(device)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 28, in _async_get_scripts_by_name
    scripts = await device.script_list()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 256, in script_list
    data = await self.call_rpc("Script.List")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 351, in call_rpc
    raise DeviceConnectionError from err
aioshelly.exceptions.DeviceConnectionError
2024-06-05 12:55:48.128 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 345, in call_rpc
    return await self._wsrpc.call(method, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 414, in call
    resp = await self._rpc_call(method, params, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 447, in _rpc_call
    resp = await future
           ^^^^^^^^^^^^
aioshelly.exceptions.DeviceConnectionError: <aioshelly.rpc_device.wsrpc.RPCCall object at 0x7f3abcfeca00>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 161, in _handle_ha_stop
    await self.shutdown()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 699, in shutdown
    await async_stop_scanner(self.device)
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 34, in async_stop_scanner
    script_name_to_id = await _async_get_scripts_by_name(device)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 28, in _async_get_scripts_by_name
    scripts = await device.script_list()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 256, in script_list
    data = await self.call_rpc("Script.List")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 351, in call_rpc
    raise DeviceConnectionError from err
aioshelly.exceptions.DeviceConnectionError
2024-06-05 12:55:48.130 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 345, in call_rpc
    return await self._wsrpc.call(method, params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 414, in call
    resp = await self._rpc_call(method, params, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/wsrpc.py", line 447, in _rpc_call
    resp = await future
           ^^^^^^^^^^^^
aioshelly.exceptions.DeviceConnectionError: <aioshelly.rpc_device.wsrpc.RPCCall object at 0x7f3abcfecac0>

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 161, in _handle_ha_stop
    await self.shutdown()
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 699, in shutdown
    await async_stop_scanner(self.device)
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 34, in async_stop_scanner
    script_name_to_id = await _async_get_scripts_by_name(device)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/ble/__init__.py", line 28, in _async_get_scripts_by_name
    scripts = await device.script_list()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 256, in script_list
    data = await self.call_rpc("Script.List")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 351, in call_rpc
    raise DeviceConnectionError from err
aioshelly.exceptions.DeviceConnectionError
2024-06-05 12:55:54.298 ERROR (MainThread) [homeassistant.components.shelly] Unexpected error fetching Stopcontact Slaapkamer data
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 312, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 590, in _async_update_data
    if not await self._async_device_connect_task():
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/shelly/coordinator.py", line 167, in _async_device_connect_task
    await self.device.initialize()
  File "/usr/local/lib/python3.12/site-packages/aioshelly/rpc_device/device.py", line 161, in initialize
    self._shelly = await get_info(
                   ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aioshelly/common.py", line 74, in get_info
    async with aiohttp_session.get(
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 1197, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 428, in _request
    raise RuntimeError("Session is closed")
RuntimeError: Session is closed
2024-06-05 12:55:55.191 CRITICAL (SyncWorker_42) [concurrent.futures] Exception in worker
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/socket.py", line 963, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -5] Name has no usable address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 92, in _worker
    work_item.run()
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 60, in run
    self.future.set_exception(exc)
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 552, in set_exception
    def set_exception(self, exception):
    
SystemExit

Additional information

Scherm­afbeelding 2024-06-05 om 13 37 21
@home-assistant
Copy link

home-assistant bot commented Jun 5, 2024

Hey there @balloob, @bieniu, @thecode, @chemelli74, @bdraco, mind taking a look at this issue as it has been labeled with an integration (shelly) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of shelly 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 shelly 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)


shelly documentation
shelly source
(message by IssueLinks)

@Mariusthvdb Mariusthvdb changed the title Restart logs Name has no usable address on Shelly device Restart logs 'Name has no usable address' on Shelly device Jun 5, 2024
@thecode
Copy link
Member

thecode commented Jun 5, 2024

Thanks @Mariusthvdb, your observation is correct, it is related to failure in the BLE init code, I understand why it happen.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants