core icon indicating copy to clipboard operation
core copied to clipboard

Fritz!box tools on fritzbox 5590 unable to add to home assistant

Open JaySea77 opened this issue 1 year ago • 22 comments

The problem

I want to add my fritzbox 5590 integration into home assistant. Fritz!box call monitor and Fritz!smarthome hhad no issue, but Fritz!box tools will not install.

What version of Home Assistant Core has the issue?

core-2024.1.5

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

fritz!box

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?

Logger: aiohttp.server
Source: /usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py:421
First occurred: 22:00:12 (5 occurrences)
Last logged: 22:27:01

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_app.py", line 543, in _handle
    resp = await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/web_middlewares.py", line 114, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 227, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 233, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 31, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 149, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 63, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 177, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 320, in async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 416, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fritz/config_flow.py", line 224, in async_step_user
    if not (error := await self.hass.async_add_executor_job(self.fritz_tools_init)):
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/fritz/config_flow.py", line 86, in fritz_tools_init
    and not connection.call_action("X_AVM-DE_UPnP1", "GetInfo")["NewEnable"]
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fritzconnection/core/fritzconnection.py", line 456, in call_action
    return self.soaper.execute(service, action_name, arguments)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 286, in execute
    return handle_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 268, in handle_response
    raise_fritzconnection_error(response)
  File "/usr/local/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 191, in raise_fritzconnection_error
    raise exception(message)
fritzconnection.core.exceptions.FritzInternalError: UPnPError: 
errorCode: 820
errorDescription: Internal Error

Additional information

I have tried rebooting the fritzbox, restarting Home Assistant, updating my fritzbox from 7.58 to 7.80. Turning the Permit access for apps and transmit status information over UPnP off and on. The problem is still there. I used to have a fritzbox 5490 which worked perfectly with home assistant.

JaySea77 avatar Jan 30 '24 21:01 JaySea77

Hey there @mammuth, @aarondavidschneider, @chemelli74, @mib1185, mind taking a look at this issue as it has been labeled with an integration (fritz) you are listed as a code owner for? Thanks!

Code owner commands

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


fritz documentation fritz source (message by IssueLinks)

home-assistant[bot] avatar Jan 30 '24 21:01 home-assistant[bot]

Hi @JaySea77

the error message let assume there is an issue with the Fritzbox itself. please enable debug logging, restart HA and provide the home-assistant.log. To do so add the following to your configuration.yaml:

logger:
  default: info
  logs:
    homeassistant.components.fritz: debug
    fritzconnection: debug

Note: it is better to drag the log into the comment (which will add it as an attachment) and not copy paste as it is hard to read logs in GitHub.

mib1185 avatar Jan 30 '24 21:01 mib1185

Here is the last part of the logfile homeassistant.log

JaySea77 avatar Jan 30 '24 21:01 JaySea77

@mib1185 Any idea?

JaySea77 avatar Jan 31 '24 18:01 JaySea77

please open the url http://fritz.box:49000/x_upnpSCPD.xml and provide the full result.

mib1185 avatar Feb 01 '24 16:02 mib1185

I am not at home, but this is what happens when I do it on the telephone with my vpn on:

1 0 GetInfo NewEnable out Enable NewUPnPMediaServer out UPnPMediaServer SetConfig NewEnable in Enable NewUPnPMediaServer in UPnPMediaServer Enable boolean 0 UPnPMediaServer boolean 0

JaySea77 avatar Feb 01 '24 16:02 JaySea77

this looks weird - it should be a valid XML output 🧐

mib1185 avatar Feb 01 '24 17:02 mib1185

Maybe because I open it on my phone?

JaySea77 avatar Feb 01 '24 17:02 JaySea77

Screenshot_20240201_181559_Chrome

even in my phone it looks as it should

mib1185 avatar Feb 01 '24 17:02 mib1185

This on my pc: This XML file does not appear to have any style information associated with it. The document tree is shown below. <scpd xmlns="urn:dslforum-org:service-1-0"> <specVersion> <major>1</major> <minor>0</minor> </specVersion> <actionList> <action> <name>GetInfo</name> <argumentList> <argument> <name>NewEnable</name> <direction>out</direction> <relatedStateVariable>Enable</relatedStateVariable> </argument> <argument> <name>NewUPnPMediaServer</name> <direction>out</direction> <relatedStateVariable>UPnPMediaServer</relatedStateVariable> </argument> </argumentList> </action> <action> <name>SetConfig</name> <argumentList> <argument> <name>NewEnable</name> <direction>in</direction> <relatedStateVariable>Enable</relatedStateVariable> </argument> <argument> <name>NewUPnPMediaServer</name> <direction>in</direction> <relatedStateVariable>UPnPMediaServer</relatedStateVariable> </argument> </argumentList> </action> </actionList> <serviceStateTable> <stateVariable sendEvents="no"> <name>Enable</name> <dataType>boolean</dataType> <defaultValue>0</defaultValue> </stateVariable> <stateVariable sendEvents="no"> <name>UPnPMediaServer</name> <dataType>boolean</dataType> <defaultValue>0</defaultValue> </stateVariable> </serviceStateTable> </scpd>

I scanned this text fast and don't think it is different than yours. Both Safari and Chrome show it like my previous post on my iPhone

JaySea77 avatar Feb 01 '24 18:02 JaySea77

image

JaySea77 avatar Feb 01 '24 18:02 JaySea77

ok ... the service definition is there and can be fetched, but when calling the GetInfo your box answers with errorCode: 820 errorDescription: Internal Error - this is definitely an issue with/in the box itself. maybe restart the box again or in worst case, re-install (reset and reconfigure ) it

mib1185 avatar Feb 01 '24 18:02 mib1185

In the Support page there is an option to send support information. This option doesn't work either and I have a ticket open with AVM about this. Could this be the same problem?

Should I enable upnp for the homeassistant device? I have Permit independent port sharing for this device enabled.

JaySea77 avatar Feb 01 '24 18:02 JaySea77

In the Support page there is an option to send support information. This option doesn't work either and I have a ticket open with AVM about this. Could this be the same problem?

Only AVM can answer this.

Should I enable upnp for the homeassistant device? I have Permit independent port sharing for this device enabled.

yes, upnp needs to be enabled - this is also mentioned as note in the integration docs

mib1185 avatar Feb 01 '24 18:02 mib1185

upnp is enabled which is in the docs, but I didn't find if home assistant ip should have it enabled specificaly but I have that anyways.

JaySea77 avatar Feb 01 '24 19:02 JaySea77

if home assistant ip should have it enabled specificaly

which setting exactly do you mean here?

mib1185 avatar Feb 01 '24 19:02 mib1185

image Though this would enable port forwarding outside the home network

JaySea77 avatar Feb 01 '24 20:02 JaySea77

ahh... this means that the device is allowed to create port forwardings by its own via upnp protocol - this is not required for HA.

mib1185 avatar Feb 01 '24 20:02 mib1185

okay, I can leave it on anyways.

JaySea77 avatar Feb 01 '24 21:02 JaySea77

just for science, please disable it and test again to integrate the box in HA

mib1185 avatar Feb 01 '24 21:02 mib1185

Tried with a normal user account and the default fritzbox account starting witch fritz and then a number. Neither worked.

JaySea77 avatar Feb 01 '24 21:02 JaySea77

Anything else I can try?

JaySea77 avatar Feb 05 '24 21:02 JaySea77

I reset my fritzbox and the only thing I changed was the internal ip range, the ip of the fritzbox itself and I have imported only my previous portforwarding. I still cannot get my fritzbox in my home assistant. Anything I can try @mib1185

JaySea77 avatar Feb 09 '24 19:02 JaySea77

HI @JaySea77 can you share fresh log please ?

chemelli74 avatar Feb 10 '24 10:02 chemelli74

Same Problem here... I will share logs after my own research...

secco04 avatar Feb 12 '24 22:02 secco04

I was able to add my fritzbox 5590 in ha after I enabled the "Allowing access for apps" in "Home network shares" - without I received the same error as decribed above

enoch75root avatar Feb 13 '24 20:02 enoch75root

This is not fixing it for me... One question... Do you use the default Fritz ip config 192.168.178.0/24?

secco04 avatar Feb 13 '24 21:02 secco04

No. It's 192.168.1.2/24

4ich @.***> schrieb am Di., 13. Feb. 2024, 22:21:

This is not fixing it for me... One question... Do you use the default Fritz ip config 192.168.178.0/24?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/109166#issuecomment-1942574851, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATZQXYQLRSJPO7LDTWDH7N3YTPKNNAVCNFSM6AAAAABCR7GOWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBSGU3TIOBVGE . You are receiving this because you commented.Message ID: @.***>

enoch75root avatar Feb 13 '24 21:02 enoch75root

HI @JaySea77 can you share fresh log please ?

I will as soon as I get better. Being a little ill at the moment.

JaySea77 avatar Feb 13 '24 22:02 JaySea77

Which user should I try to add btw. Is it the generated one starting with fritz or another one?

JaySea77 avatar Feb 13 '24 22:02 JaySea77