ErrorCode 402 with FritzBox Integration

Hello

It seems that, since I moved from a DSL Internet connection to a WAN Internet connection on my FritzBox 7590, I am getting the following error: errorCode:402

Here is the log about this problem:

2022-01-07 10:24:34 DEBUG (SyncWorker_2) [homeassistant.components.fritz.sensor] Updating FRITZ!Box sensors
2022-01-07 10:24:34 DEBUG (SyncWorker_2) [fritzconnection] 
http://192.168.2.1:49000/igdupnp/control/WANCommonIFC1
2022-01-07 10:24:34 DEBUG (SyncWorker_2) [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:GetAddonInfos xmlns:u="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1"></u:GetAddonInfos></s:Body></s:Envelope>'
2022-01-07 10:24:34 DEBUG (SyncWorker_13) [fritzconnection] response status: 500
2022-01-07 10:24:34 DEBUG (SyncWorker_13) [fritzconnection] <?xml version="1.0"?>
 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:dslforum-org:control-1-0">
<errorCode>402</errorCode>
<errorDescription>Invalid Args</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
2022-01-07 10:24:34 ERROR (SyncWorker_13) [homeassistant.components.fritz.switch] Connection Error: Please check the device is properly configured for remote login
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/fritz/switch.py", line 81, in service_call_action
    return fritzbox_tools.connection.call_action(  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/fritzconnection.py", line 284, in call_action
    return self.soaper.execute(service, action_name, arguments)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 259, in execute
    return handle_response(response)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 241, in handle_response
    raise_fritzconnection_error(response)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 164, in raise_fritzconnection_error
    raise exception(message)
fritzconnection.core.exceptions.FritzArgumentError: UPnPError: 
errorCode: 402
errorDescription: Invalid Args

Anyone has a clue if this is due to an unauthorized/invalid character/argument or a bug in the integration or on the FritzBox side ? Any solution/suggestion to fix this ?

Fortunately, this is not preventing the integration to load…

Thank you for your help…

1 Like

Same here, not sure if that already occurs for a longer time as I do not look into the log regularly, but it was not always like that.

Logger: homeassistant.components.fritz.switch
Source: components/fritz/switch.py:81
Integration: AVM FRITZ!Box Tools (documentation, issues)
First occurred: 19:12:15 (56 occurrences)
Last logged: 20:03:15

Connection Error: Please check the device is properly configured for remote login
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/fritz/switch.py", line 81, in service_call_action
    return fritzbox_tools.connection.call_action(  # type: ignore[no-any-return]
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/fritzconnection.py", line 284, in call_action
    return self.soaper.execute(service, action_name, arguments)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 259, in execute
    return handle_response(response)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 241, in handle_response
    raise_fritzconnection_error(response)
  File "/usr/local/lib/python3.9/site-packages/fritzconnection/core/soaper.py", line 164, in raise_fritzconnection_error
    raise exception(message)
fritzconnection.core.exceptions.FritzLookUpError: 'UPnPError: \nerrorCode: 714\nerrorDescription: NoSuchEntryInArray'

same here :slight_smile:

Same for me. Was someone able to fix this?

I would need to check my logs, but I have this for some days now, and there were no obvious changes (as always :wink: ).
My Fritz Switches keep flapping between unavailable and available.