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

Fritz integration - not working when not using DSL #114323

Closed
DanielWeeber opened this issue Mar 27, 2024 · 12 comments
Closed

Fritz integration - not working when not using DSL #114323

DanielWeeber opened this issue Mar 27, 2024 · 12 comments
Assignees
Labels
integration: fritz problem in device Issue lies within the device, such firmware, software, or user customization/config

Comments

@DanielWeeber
Copy link
Contributor

The problem

I recently changed from a DSL provider to DHCP as my WAN connection.
Since then the integration does not connect to the fritzbox anymore
If I enable debug logging this is the last thing I see in the logs

2024-03-27 17:54:31.941 DEBUG (SyncWorker_0) [fritzconnection] b'<?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:GetInfo xmlns:u="urn:dslforum-org:service:WANIPConnection:1"></u:GetInfo></s:Body></s:Envelope>' 2024-03-27 17:54:31.984 DEBUG (SyncWorker_0) [fritzconnection] response status: 500 2024-03-27 17:54:31.984 DEBUG (SyncWorker_0) [fritzconnection] <?xml version="1.0"?> s:Client UPnPError 401 Invalid Action

What version of Home Assistant Core has the issue?

core-2024.3.3

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

AVM Fritz!Box Tools

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

No response

@home-assistant
Copy link

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)

@mib1185
Copy link
Contributor

mib1185 commented Apr 1, 2024

Hi @DanielWeeber

please provide the full logfile (it seems you already have debugging for the fritz integration enabled👍)

@DanielWeeber
Copy link
Contributor Author

@mib1185
Copy link
Contributor

mib1185 commented Apr 2, 2024

it seems this is an issue in the fritzconnection - to confirm this, please run the following script and provide the output.

first install the fritzconnection lib

pip install "fritzconnection[qr]==1.13.2" "xmltodict==0.13.0"

run following simple python script (fill in your IPADDRESS , USERNAME and PASSWORD)

from fritzconnection import FritzConnection
from fritzconnection.lib.fritzstatus import FritzStatus

fc = FritzConnection(address=IPADDRESS, user=USERNAME, password=PASSWORD)
fs = FritzStatus(fc)

print(f"get_default_connection_service: {fs.get_default_connection_service()}")
print(f"has_wan_enabled: {fs.has_wan_enabled}")

@DanielWeeber
Copy link
Contributor Author

DanielWeeber commented Apr 9, 2024

get_default_connection_service: DefaultConnectionService(prefix='1', connection_service='WANIPConnection', postfix='1')
Traceback (most recent call last):
  File "/root/fritz/test.py", line 8, in <module>
    print(f"has_wan_enabled: {fs.has_wan_enabled}")
                              ^^^^^^^^^^^^^^^^^^
  File "/root/fritz/lib/python3.11/site-packages/fritzconnection/lib/fritzstatus.py", line 386, in has_wan_enabled
    return self.fc.call_action(self.connection_service, "GetInfo")["NewEnable"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/fritz/lib/python3.11/site-packages/fritzconnection/core/fritzconnection.py", line 456, in call_action
    return self.soaper.execute(service, action_name, arguments)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/fritz/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 286, in execute
    return handle_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/fritz/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 268, in handle_response
    raise_fritzconnection_error(response)
  File "/root/fritz/lib/python3.11/site-packages/fritzconnection/core/soaper.py", line 191, in raise_fritzconnection_error
    raise exception(message)
fritzconnection.core.exceptions.FritzActionError: UPnPError:
errorCode: 401
errorDescription: Invalid Action

@mib1185 mib1185 added problem in device Issue lies within the device, such firmware, software, or user customization/config and removed needs-more-information labels Apr 10, 2024
@mib1185
Copy link
Contributor

mib1185 commented Apr 10, 2024

as mentioned in kbr/fritzconnection#218 (comment) (and following) it seems to be an issue in the Fritz!Box itself

@VEEC023
Copy link

VEEC023 commented May 27, 2024

Problem is fixed in the latest Labor Software: FRITZ!OS: [7.90-113042 BETA]

@liuk4friends
Copy link

Problem is fixed also in the latest Fritz!OS 7.59 for Fritz!Box 7590

@mib1185
Copy link
Contributor

mib1185 commented Jun 16, 2024

@VEEC023 which Fritzbox model do you have?

@VEEC023
Copy link

VEEC023 commented Jun 17, 2024

@mib1185 Fritz!Box 7590.
I have noticed that the software of the Frizbox behaves a little differently when you do a factory reset compared to the normal updates. I have been updating my Fritzbox at regular intervals since version 6.X up to the latest version 7.57 and up to then everything worked fine for me. The error appeared for me only after a factory reset (same software version as before).

@DanielWeeber
Copy link
Contributor Author

Can confirm aswell, its working again.

@chemelli74
Copy link
Contributor

Thx for confirming!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 25, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integration: fritz problem in device Issue lies within the device, such firmware, software, or user customization/config
Projects
None yet
Development

No branches or pull requests

5 participants