core: Problem with Fritzbox-Tools

The problem

Disclaimer: I´m not experienced in creating “Bugs” here. If i could do something better, feel free to tell me.


Fritzbox Tools keep getting unavailble after a short time working (2-5 Minutes). If i remove the integration and add it back, it works for that short period of time.

Hardware: Fritzbox 5530 Firmware: FritzOS 7.29

image image

What version of Home Assistant Core has the issue?

2022.4.0b1

What was the last working version of Home Assistant Core?

2022.3.8

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Fritzbox Tools

Link to integration documentation on our website

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

Diagnostics information

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/fritz/__init__.py:64
First occurred: 08:56:35 (1 occurrences)
Last logged: 08:56:35

Error unloading entry FB-keller for fritz
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 474, in async_unload
    result = await component.async_unload_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/fritz/__init__.py", line 64, in async_unload_entry
    fritz_data = hass.data[DATA_FRITZ]
KeyError: 'fritz_data'

---

Logger: homeassistant.config_entries
Source: components/fritz/common.py:182
First occurred: 08:56:36 (1 occurrences)
Last logged: 08:56:36

Error setting up entry FB-keller for fritz
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 384, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/url.py", line 394, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://fe80::1eed:6fff:fe86:2a1d%4:49000/igddesc.xml

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/fritz/__init__.py", line 30, in async_setup_entry
    await avm_wrapper.async_setup(entry.options)
  File "/usr/src/homeassistant/homeassistant/components/fritz/common.py", line 178, in async_setup
    await self.hass.async_add_executor_job(self.setup)
  File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/fritz/common.py", line 182, in setup
    self.connection = FritzConnection(
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/fritzconnection.py", line 155, in __init__
    self.device_manager.add_description(source)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/devices.py", line 75, in add_description
    root = get_xml_root(source, timeout=self.timeout, session=self.session)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/utils.py", line 74, in get_xml_root
    source = get_content_from(source, timeout=timeout, session=session)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/utils.py", line 52, in get_content_from
    return do_request()
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/utils.py", line 46, in do_request
    with session.get(url, timeout=timeout) as response:
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 515, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 443, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 318, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 386, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://fe80::1eed:6fff:fe86:2a1d%4:49000/igddesc.xml

Additional information

The Settings for UPNP and TR-064 in the Fritzbox are set up correct:

image

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 20 (9 by maintainers)

Most upvoted comments

meanwhile i was able to reproduce the issue. I’m already on to create a fix …

@thecode Thank you for the tip. So I’m on my way to my first HA-Issue 😄

@x0rzist the answer for closed issues is always to open a new issue (btw we are not charged per issues 😄)

Here the same!

I noticed that by entering in the configuration both ip address and domain “fritz.box” after some time the configuration inside the storage file is changed with that wrong ipv6 address. It seems to be the right address with that %[digit] at the end. Also for me with version 2022.3.8 everything was working correctly.

I have the same problem with Fritzbox-Tools. It worked fine with 2022.3.x but stopped working with the new beta. The logged error starts on line 161: home-assistant.log