Closed bouwew closed 3 years ago
Hey there @stevenlooman, @ehendrix23, mind taking a look at this issue as it has been labeled with an integration (upnp
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
upnp documentation upnp source (message by IssueLinks)
Some problem as #56938?
I've noticed other posts, more logging was enabled, the first DEBUG-line shows the discovery-info:
2021-10-03 10:49:48 DEBUG (MainThread) [homeassistant.components.upnp] _async_create_entry_from_discovery: discovery: {'CACHE-CONTROL': 'max-age=120', 'ssdp_st': 'urn:schemas-upnp-org:device:InternetGatewayDevice:1', 'ssdp_usn': 'uuid:e4c797e0-82ce-4f84-b56d-085d9d77c8cd::urn:schemas-upnp-org:device:InternetGatewayDevice:1', 'ssdp_ext': '', 'ssdp_server': 'TP-LINK/TP-LINK UPnP/1.1 MiniUPnPd/1.8', 'OPT': '"http://schemas.upnp.org/upnp/1/0/"; ns=01', '01-NLS': '1', 'BOOTID.UPNP.ORG': '1', 'CONFIGID.UPNP.ORG': '1337', '_location_original': 'http://[::1]:1900/rootDesc.xml', 'ssdp_location': 'http://[::1]:1900/rootDesc.xml', '_timestamp': datetime.datetime(2021, 10, 3, 10, 49, 7, 275160), '_host': '192.168.123.321', '_port': 1900, 'ssdp_udn': 'uuid:e4c797e0-82ce-4f84-b56d-085d9d77c8cd', 'deviceType': 'urn:schemas-upnp-org:device:InternetGatewayDevice:1', 'friendlyName': 'Archer AX11000', 'manufacturer': 'TP-Link', 'manufacturerURL': 'http://www.tp-link.com/', 'modelDescription': 'Archer AX11000', 'modelName': 'Archer AX11000', 'modelNumber': '1.0', 'modelURL': 'http://www.tp-link.com/', 'serialNumber': '00000000', 'UDN': 'uuid:e4c797e0-82ce-4f84-b56d-085d9d77c8cd', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:Layer3Forwarding:1', 'serviceId': 'urn:upnp-org:serviceId:Layer3Forwarding1', 'controlURL': '/ctl/L3F', 'eventSubURL': '/evt/L3F', 'SCPDURL': '/L3F.xml'}}, 'deviceList': {'device': {'deviceType': 'urn:schemas-upnp-org:device:WANDevice:1', 'friendlyName': 'WANDevice', 'manufacturer': 'MiniUPnP', 'manufacturerURL': 'http://miniupnp.free.fr/', 'modelDescription': 'WAN Device', 'modelName': 'WAN Device', 'modelNumber': '20210511', 'modelURL': 'http://miniupnp.free.fr/', 'serialNumber': '00000000', 'UDN': 'uuid:e4c797e0-82ce-4f84-b56d-085d9d77c8cd', 'UPC': '000000000000', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1', 'serviceId': 'urn:upnp-org:serviceId:WANCommonIFC1', 'controlURL': '/ctl/CmnIfCfg', 'eventSubURL': '/evt/CmnIfCfg', 'SCPDURL': '/WANCfg.xml'}}, 'deviceList': {'device': {'deviceType': 'urn:schemas-upnp-org:device:WANConnectionDevice:1', 'friendlyName': 'WANConnectionDevice', 'manufacturer': 'MiniUPnP', 'manufacturerURL': 'http://miniupnp.free.fr/', 'modelDescription': 'MiniUPnP daemon', 'modelName': 'MiniUPnPd', 'modelNumber': '20210511', 'modelURL': 'http://miniupnp.free.fr/', 'serialNumber': '00000000', 'UDN': 'uuid:e4c797e0-82ce-4f84-b56d-085d9d77c8cd', 'UPC': '000000000000', 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:WANIPConnection:1', 'serviceId': 'urn:upnp-org:serviceId:WANIPConn1', 'controlURL': '/ctl/IPConn', 'eventSubURL': '/evt/IPConn', 'SCPDURL': '/WANIPCn.xml'}}}}}}, 'presentationURL': 'http://192.168.123.321/'}
2021-10-03 10:49:48 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 98, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 136, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 157, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 198, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 256, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/usr/src/homeassistant/homeassistant/components/upnp/config_flow.py", line 254, in async_step_ssdp_confirm
return await self._async_create_entry_from_discovery(discovery)
File "/usr/src/homeassistant/homeassistant/components/upnp/config_flow.py", line 276, in _async_create_entry_from_discovery
CONFIG_ENTRY_UDN: discovery["_udn"],
KeyError: '_udn'
Let me know if I need to provide more DEBUG-info.
Thank you for the bug report @bouwew.
Interesting, the key _udn
should have been set, but somehow wasn't. I'm going to fix a few tickets today, I'll include this one.
@StevenLooman Great! Let me know if I can do some testing.
@bouwew, a fix for this will be included in the upcoming release.
@StevenLooman I've implemented your fix manually, its working now but I don't see any of the DERIVED_SENSORS?
The problem
Adding my TP-LINK AX11000 via discovery fails.
What is version of Home Assistant Core has the issue?
core-2021.10.0b2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Supervised
Integration causing the issue
UPNP
Link to integration documentation on our website
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
Before this error happens, after a restart this error happens: