core: FRITZ!Box WLAN 3370 has don't `get host info`

The problem

Logger: homeassistant.components.fritz.common
Source: components/fritz/common.py:401
Integration: AVM FRITZ!Box Tools (documentation, issues)
First occurred: 20:49:24 (1 occurrences)
Last logged: 20:49:24

Unexpected error fetching fritz-192.168.0.17-coordinator data: Error refreshing hosts info
Traceback (most recent call last):
  File "/workspaces/core/homeassistant/components/fritz/common.py", line 396, in _async_update_hosts_info
    return await self.hass.async_add_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/lib/fritzhosts.py", line 204, in get_hosts_attributes
    result = self._action("X_AVM-DE_GetHostListPath")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/lib/fritzhosts.py", line 36, in _action
    return self.fc.call_action(SERVICE, actionname, arguments=arguments, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/core/fritzconnection.py", line 424, in call_action
    return self.soaper.execute(service, action_name, arguments)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/core/soaper.py", line 286, in execute
    return handle_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/core/soaper.py", line 268, in handle_response
    raise_fritzconnection_error(response)
  File "/workspaces/core/homeassistant/components/fritz/fritzconnection/src/fritzconnection/core/soaper.py", line 191, in raise_fritzconnection_error
    raise exception(message)
homeassistant.components.fritz.fritzconnection.src.fritzconnection.core.exceptions.FritzActionError: UPnPError: 
errorCode: 401
errorDescription: Invalid Action

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

Traceback (most recent call last):
  File "/workspaces/core/homeassistant/helpers/update_coordinator.py", line 293, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/common.py", line 317, in _async_update_data
    await self.async_scan_devices()
  File "/workspaces/core/homeassistant/components/fritz/common.py", line 478, in async_scan_devices
    for host in await self._async_update_hosts_info():
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/core/homeassistant/components/fritz/common.py", line 401, in _async_update_hosts_info
    raise HomeAssistantError("Error refreshing hosts info") from ex
homeassistant.exceptions.HomeAssistantError: Error refreshing hosts info

What version of Home Assistant Core has the issue?

core-2023.9.0.dev0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

fritz

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

https://github.com/home-assistant/core/blob/121fc7778d2573e833d36ac2a331f5f12a24223c/homeassistant/components/fritz/common.py#L390-L392

the problem is the exception that is thrown here. If I comment out this part, then the integration runs “without” errors.

I don’t (yet) understand why UPnPError occurs as an error, it may be because the Fritzbox is only used as a layer 2 router?!

If further information is needed, please let me know.

image

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (15 by maintainers)

Most upvoted comments

Hi @Ludy87 would be great if you could test the linked PR. thx 👍

Thanks for your trouble, according to my assessment and observation, the error has been fixed.

Is there also the possibility that not only the guest WiFi is created as a QR code, but also the “normal” WiFi?

it is on my list, but did not find the time, yet. maybe in the next weeks/months 🤞

I guess FritzOS 6.55 is to old and does not support the X_AVM-DE_GetHostListPath action via tr64, but the fritz integrations has been reworked to rely on this GetHostListPath to obtain the connected client devices (will be delivered with 2023.8). This means, we need to bring back the former/old mechanic as fallback when the FritzBox does not support the X_AVM-DE_GetHostListPath action. Hopefully I’ll get it managed this week to re-implement the old mechanic as fallback