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

Nuki no longer working (NoURLAvailableError) #90962

Closed
trunneml opened this issue Apr 6, 2023 · 21 comments · Fixed by #91013
Closed

Nuki no longer working (NoURLAvailableError) #90962

trunneml opened this issue Apr 6, 2023 · 21 comments · Fixed by #91013
Assignees

Comments

@trunneml
Copy link

trunneml commented Apr 6, 2023

The problem

Since the update to 2023.04 I receive the following error:

Logger: homeassistant.config_entries
Source: helpers/network.py:200
First occurred: 19:40:45 (2 occurrences)
Last logged: 19:43:19

Error setting up entry 2E3BCEAB for nuki
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 155, in async_setup_entry
    hass_url = get_url(
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 200, in get_url
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

The integration is not setup and therefore I can't control any entry from it.

After enabling debug logging. I'm getting the following error:

Logger: homeassistant.config_entries
Source: components/webhook/__init__.py:46
First occurred: 19:49:06 (1 occurrences)
Last logged: 19:49:06

Error setting up entry 2E3BCEAB for nuki
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 150, in async_setup_entry
    webhook.async_register(
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 46, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!

I already restarted HA and reinstalled / reconfigured the integration.

What version of Home Assistant Core has the issue?

2023.4.0

What was the last working version of Home Assistant Core?

2023.3.x

What type of installation are you running?

Home Assistant OS

Integration causing the issue

nuki

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/webhook/__init__.py:46
First occurred: 19:49:06 (1 occurrences)
Last logged: 19:49:06

Error setting up entry 2E3BCEAB for nuki
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 150, in async_setup_entry
    webhook.async_register(
  File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 46, in async_register
    raise ValueError("Handler is already defined!")
ValueError: Handler is already defined!



Logger: homeassistant.config_entries
Source: helpers/network.py:200
First occurred: 19:40:45 (2 occurrences)
Last logged: 19:43:19

Error setting up entry 2E3BCEAB for nuki
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/nuki/__init__.py", line 155, in async_setup_entry
    hass_url = get_url(
  File "/usr/src/homeassistant/homeassistant/helpers/network.py", line 200, in get_url
    raise NoURLAvailableError
homeassistant.helpers.network.NoURLAvailableError

Additional information

No response

@home-assistant
Copy link

home-assistant bot commented Apr 6, 2023

Hey there @pschmitt, @pvizeli, @pree, mind taking a look at this issue as it has been labeled with an integration (nuki) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of nuki 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 nuki Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nuki documentation
nuki source
(message by IssueLinks)

@osono-design
Copy link
Contributor

I am experiencing the same error since the update to 2023.4.0

@pree
Copy link
Member

pree commented Apr 7, 2023

This error is handled in 2023.4.1

@hoffmannd
Copy link

This error is handled in 2023.4.1

@pree I am experiencing the same issue in 2023.4.1. I upgraded directly from 2023.3.x to 2023.4.1 today.

@Jimnaldo
Copy link

Jimnaldo commented Apr 7, 2023

Experiencing the same problem in 2023.4.1. , Error is Retrying setup: Error registering URL for webhook 35ab402b22d34ec3b5dc64c73740db10: HomeAssistant URL is not available.

@conta1988
Copy link

same error.... in 2023.4.0 i lost the connection whit the api. today i retry with the 2023.4.1 and now the new error

@trunneml
Copy link
Author

trunneml commented Apr 7, 2023

I updated to 2023.04.1. I'm getting an new error now:


Retrying setup: Error registering URL for webhook 479af937cd09b87a47cd7644794a5c1d: HomeAssistant URL is not available

@pree
Copy link
Member

pree commented Apr 7, 2023

This is because your HomeAssistant Instance isn't giving a Webhook URL. Are the Entities Unavailable now?

@Jimnaldo
Copy link

Jimnaldo commented Apr 7, 2023

i used this integration instead: https://github.com/kvj/hass_nuki_ng everything okay now

@trunneml
Copy link
Author

trunneml commented Apr 7, 2023

No the entries are not available.

@pree
Copy link
Member

pree commented Apr 7, 2023

I created a new PR to be able to fall back to polling in case webhook registration fails.

@trunneml
Copy link
Author

trunneml commented Apr 7, 2023

This is because your HomeAssistant Instance isn't giving a Webhook URL. Are the Entities Unavailable now?

Thanks for the hint with the webhook URL. I figured out the source of the problem.

I'm using SSL for HomeAssistant and didn't configured an internal URL.

After setting the internal URL from AUTO to the same as the external, the integration works again.
But I'm getting an warning in the settings screen that nuki webhooks do not work with HTTPS. Anyway the entries are back and I can control the locks.

The Nuki bridge can not push events to an HTTPS address (SSL), please configure a (local) HTTP address under "Home Assistant URL" in the [network settings](https://my.home-assistant.io/redirect/network/). The current (local) address is: https://home.michael.trunner.de:8123, a valid address could, for example, be http://192.168.1.10:8123 where 192.168.1.10 is the IP of the Home Assistant device

@pree
Copy link
Member

pree commented Apr 7, 2023

Yes, the Nuki Bridge doesn't support HTTPs, so you would need a http internal URL. You can use a reverseproxy to redirect normal traffic to https and not redirect for the webhook. Or just use polling :)

@trunneml
Copy link
Author

trunneml commented Apr 7, 2023

You can use a reverseproxy to redirect normal traffic to https and not redirect for the webhook

How can I configure the webhook URL by my self?

@heapxor
Copy link

heapxor commented Apr 8, 2023

Hi,
I have exactly same issue running on Home Assistant 2023.4.1

Can anyone advice here what needs to be done - to fix it?

Thanks!

image

@pree
Copy link
Member

pree commented Apr 8, 2023

Hi, you need to set an HTTP internal url to be able to use the callback function. Otherwise setting a https internal url can be a workaround to make polling work again. There is an open PR to fix this.

@heapxor
Copy link

heapxor commented Apr 8, 2023

@pree hello, but how or where i can do that? what PR do you mean?
I am afraid i dont get it ... HTTP internal url... or HTTPS internal url?

thanks

@heapxor
Copy link

heapxor commented Apr 10, 2023

anyone any idea?/fix? thanks!

@pree
Copy link
Member

pree commented Apr 10, 2023

In your HomeAssistant Settings under System > Network you can configure an internal URL.

@heapxor
Copy link

heapxor commented Apr 10, 2023

@pree i see, but no idea what to fill inside
image
my https://public url?

@atlaspl
Copy link

atlaspl commented Apr 11, 2023

I haven't an http url that is working for my home assistant, so in the "local network url" I added just the same external url with the https url. Now it's working.

@github-actions github-actions bot locked and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants