home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
70.11k stars 29.16k forks source link

dlna_dmr issues in HA core logs #67521

Closed philcanman closed 2 years ago

philcanman commented 2 years ago

The problem

Getting the following error in the HA log file:

Error doing job: Task exception was never retrieved 9:56:54 PM – (ERROR) components/dlna_dmr/config_flow.py

What version of Home Assistant Core has the issue?

core-2022.2.9

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Unknown

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant
Source: components/dlna_dmr/config_flow.py:138
First occurred: 9:56:54 PM (1 occurrences)
Last logged: 9:56:54 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 74, in _async_process_pending_flows
    await gather_with_concurrency(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 185, in gather_with_concurrency
    return await gather(
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 183, in sem_task
    return await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 203, in async_init
    flow, result = await task
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 230, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data, init_done)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/config_flow.py", line 137, in async_step_ssdp
    discovery_service_ids = {
  File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/config_flow.py", line 138, in <setcomp>
    service.get("serviceId")
AttributeError: 'str' object has no attribute 'get'

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

dlna_dmr documentation dlna_dmr source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @stevenlooman, @chishm, mind taking a look at this issue as it has been labeled with an integration (dlna_dmr) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

chishm commented 2 years ago

This looks like a device has a bad/strange UPnP root descriptor. Could you please enable the following logging and try again:

logger:
  default: warning
  logs:
    homeassistant.components.dlna_dmr: debug
    homeassistant.components.dlna_dmr.config_flow: debug

I'm interested in seeing a message starting with [homeassistant.components.dlna_dmr.config_flow] async_step_ssdp: discovery_info

X3Cutor commented 2 years ago

I wasn't the original poster of the issue but I seem to have the issue too. Here are what I presume are the relevant logs:

2022-04-11 19:19:20 DEBUG (MainThread) [homeassistant.components.dlna_dmr.config_flow] async_step_ssdp: discovery_info SsdpServiceInfo(upnp={'deviceType': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'friendlyName': 'WHS11', 'modelNumber': '12', 'modelName': 'Windows Media Player', 'modelDescription': 'Windows Media Player Renderer', 'manufacturer': 'Microsoft Corporation', 'manufacturerURL': 'http://www.microsoft.com', 'modelURL': 'http://go.microsoft.com/fwlink/?LinkId=105927', 'serialNumber': '{7AADD6D2-D098-42F4-BF29-791BDDE56FEC}', 'UDN': 'uuid:c7314d4b-9725-486a-a404-dd5dde54ae21', 'magicPacketSendSupported': '1', 'iconList': {'icon': [{'mimetype': 'image/png', 'width': '48', 'height': '48', 'depth': '24', 'url': '/upnphost/udhisapi.dll?content=uuid:841221fb-ef6e-47d7-be32-968dfde5ad17'}, {'mimetype': 'image/png', 'width': '120', 'height': '120', 'depth': '24', 'url': '/upnphost/udhisapi.dll?content=uuid:3cc1ef67-5764-455c-a8c2-3499859786dc'}, {'mimetype': 'image/jpeg', 'width': '48', 'height': '48', 'depth': '24', 'url': '/upnphost/udhisapi.dll?content=uuid:c6dbc1dc-dd56-463f-b41b-795aebea1e2a'}, {'mimetype': 'image/jpeg', 'width': '120', 'height': '120', 'depth': '24', 'url': '/upnphost/udhisapi.dll?content=uuid:382e502d-0974-442e-a217-7b86d9b3d9c5'}]}, 'serviceList': {'service': {'serviceType': 'urn:schemas-upnp-org:service:RenderingControl:1', 'serviceId': 'urn:upnp-org:serviceId:RenderingControl', 'controlURL': '/upnphost/udhisapi.dll?control=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21+urn:upnp-org:serviceId:RenderingControl', 'eventSubURL': '/upnphost/udhisapi.dll?event=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21+urn:upnp-org:serviceId:RenderingControl', 'SCPDURL': '/upnphost/udhisapi.dll?content=uuid:a0b4df41-317a-435a-a4e6-4b2405638b24'}}}, ssdp_usn='uuid:c7314d4b-9725-486a-a404-dd5dde54ae21::urn:schemas-upnp-org:device:MediaRenderer:1', ssdp_st='urn:schemas-upnp-org:device:MediaRenderer:1', ssdp_location='http://10.1.1.174:2869/upnphost/udhisapi.dll?content=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21', ssdp_nt=None, ssdp_udn='uuid:c7314d4b-9725-486a-a404-dd5dde54ae21', ssdp_ext='', ssdp_server='Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0', ssdp_headers={'ST': 'urn:schemas-upnp-org:device:MediaRenderer:1', 'USN': 'uuid:c7314d4b-9725-486a-a404-dd5dde54ae21::urn:schemas-upnp-org:device:MediaRenderer:1', 'OPT': '"http://schemas.upnp.org/upnp/1/0/"; ns=01', '01-NLS': '888dc9ccd658fe65b67952fb7b03609a', 'Cache-Control': 'max-age=1800', 'Server': 'Microsoft-Windows-NT/5.1 UPnP/1.0 UPnP-Device-Host/1.0', 'Ext': '', '_location_original': 'http://10.1.1.174:2869/upnphost/udhisapi.dll?content=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21', 'location': 'http://10.1.1.174:2869/upnphost/udhisapi.dll?content=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21', '_timestamp': datetime.datetime(2022, 4, 11, 19, 18, 44, 200057), '_host': '10.1.1.174', '_port': 1900, '_local_addr': ('10.1.1.197', 37026), '_remote_addr': ('10.1.1.174', 1900), '_udn': 'uuid:c7314d4b-9725-486a-a404-dd5dde54ae21'}, x_homeassistant_matching_domains={'dlna_dmr'}) 2022-04-11 19:19:20 DEBUG (MainThread) [homeassistant.components.dlna_dmr.config_flow] _async_set_info_from_discovery: location: http://10.1.1.174:2869/upnphost/udhisapi.dll?content=uuid:c7314d4b-9725-486a-a404-dd5dde54ae21, UDN: uuid:c7314d4b-9725-486a-a404-dd5dde54ae21 2022-04-11 19:19:20 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/discovery_flow.py", line 74, in _async_process_pending_flows await gather_with_concurrency( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 192, in gather_with_concurrency return await gather( File "/usr/src/homeassistant/homeassistant/util/async_.py", line 190, in sem_task return await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 205, in async_init flow, result = await task File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 232, in _async_init result = await self._async_handle_step(flow, flow.init_step, data, init_done) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 335, in _async_handle_step result: FlowResult = await getattr(flow, method)(user_input) File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/config_flow.py", line 137, in async_step_ssdp discovery_service_ids = { File "/usr/src/homeassistant/homeassistant/components/dlna_dmr/config_flow.py", line 138, in <setcomp> service.get("serviceId") AttributeError: 'str' object has no attribute 'get'

Let me know if I can do anything more to help.

philcanman commented 2 years ago

Sorry was away for a bit. Thank you Martin.

chishm commented 2 years ago

Thank you for the debug log. I can see what the issue is, and now have some idea of how to fix it.