core icon indicating copy to clipboard operation
core copied to clipboard

Invalid config: ssdp and default_config

Open lgcness opened this issue 3 years ago • 1 comments

The problem

Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: ssdp')

What version of Home Assistant Core has the issue?

2022.11.0b0

What was the last working version of Home Assistant Core?

2022.10.5

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Camera: Record

Link to integration documentation on our website

https://www.home-assistant.io/integrations/camera/

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

lgcness avatar Oct 27 '22 17:10 lgcness

Hey there @home-assistant/core, mind taking a look at this issue as it has been labeled with an integration (camera) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of camera can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant unassign camera Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


camera documentation camera source (message by IssueLinks)

home-assistant[bot] avatar Oct 27 '22 17:10 home-assistant[bot]

I am also seeing these errors in ssdp, albeit triggered by a different integration. This started in 2022.11.0b0 and still happening in 2022.11.0b1

2022-10-28 10:50:33.151 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: ssdp
2022-10-28 10:50:33.153 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: ssdp')
2022-10-28 10:50:49.181 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of dlna_dms. Setup failed for dependencies: ssdp
2022-10-28 10:50:49.189 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 71, in _async_start
await gather_with_concurrency(
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 199, in gather_with_concurrency
return await gather(
File "/usr/src/homeassistant/homeassistant/util/async_.py", line 197, in sem_task
return await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 225, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 243, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 804, in async_create_flow
await async_process_deps_reqs(self.hass, self._hass_config, integration)
File "/usr/src/homeassistant/homeassistant/setup.py", line 358, in async_process_deps_reqs
raise DependencyError(failed_deps)
homeassistant.exceptions.DependencyError: (DependencyError(...), 'Could not setup dependencies: ssdp')
2022-10-28 10:50:49.204 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of upnp. Setup failed for dependencies: ssdp

EDIT: Some more logs. I do not have an external URL set as there is not external access to this box.

Logger: homeassistant.setup
Source: helpers/network.py:207
First occurred: 10:50:05 AM (1 occurrences)
Last logged: 10:50:05 AM

Error during setup of component ssdp
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component
    result = await task
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 223, in async_setup
    await server.async_start()
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 687, in async_start
    await self._async_start_upnp_servers()
  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 700, in _async_start_upnp_servers
    presentation_url = get_url(self.hass)
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 168, in get_url
    request_host = _get_request_host()
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 207, in _get_request_host
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

darkxst avatar Oct 27 '22 23:10 darkxst

Same issue for me.

boojew avatar Oct 28 '22 02:10 boojew

Manually setting my local network URL (as opposed to using the automatic setting) seems to have resolved this error message

darkxst avatar Oct 28 '22 03:10 darkxst

Manually setting my local network URL (as opposed to using the automatic setting) seems to have resolved this error message

Interesting, it worked for me as well. I looks like I commented this out at some point in my config.

boojew avatar Oct 28 '22 12:10 boojew

cc @StevenLooman

bdraco avatar Oct 28 '22 17:10 bdraco

The problem lies with getting the url hass can be reached at:

  File "/usr/src/homeassistant/homeassistant/components/ssdp/__init__.py", line 700, in _async_start_upnp_servers
    presentation_url = get_url(self.hass)

There are two options as I see it:

  1. Get the URL via a different method (is there a way, and if so, how?)
  2. If the URL cannot be determined, do not set up the UPnP server

@balloob @bdraco, what do you think?

StevenLooman avatar Oct 28 '22 19:10 StevenLooman

I'd probably warn and skip setting up the upnp server since we don't want it to break ssdp

bdraco avatar Oct 28 '22 21:10 bdraco

Yeah we shouldn’t break SSDP.

Allow IP defaults to False if HTTP is not set up (not possible I think) or if SSL has been configured in HA. https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/network.py#L135

If you have SSL configured in HA you really should configure an external URL. However, I guess in this case we should just pass allow_ip=True as invalid certs can be bypassed in a browser.

balloob avatar Oct 28 '22 22:10 balloob

Fix https://github.com/home-assistant/core/pull/81171

balloob avatar Oct 29 '22 02:10 balloob

If SSL has been setup without the URL configured, could this be something that is warned of via Repairs There is obviously already a warning on the network settings page, but I hadnt noticed that before!

darkxst avatar Oct 29 '22 09:10 darkxst

Just adding this, I had to configure my internal and external manually to fix this too. Was a few months back and all was well.. updated today and had to find this tracker to solve it.

sherkborg avatar Nov 03 '22 02:11 sherkborg

@sherkborg it was supposed to be fixed. If you still encounter this, please open a new issue, include the stack trace and tag me.

balloob avatar Nov 03 '22 07:11 balloob