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

async_forward_entry_setup stop working in HA 2025.1 #193

Closed
z-master42 opened this issue Jul 9, 2024 · 24 comments
Closed

async_forward_entry_setup stop working in HA 2025.1 #193

z-master42 opened this issue Jul 9, 2024 · 24 comments

Comments

@z-master42
Copy link

Home Assistant Log Warning:

Detected code that calls async_forward_entry_setup for integration nuki_ng with title: xxxxxx and entry_id: yyyyyyy, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.

@dhoeben
Copy link

dhoeben commented Jul 25, 2024

Same in the logs. Posted below. entity_id is omitted by me.

2024-07-25 08:35:37.186 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-07-25 08:35:37.219 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-07-25 08:35:37.221 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-07-25 08:35:37.230 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-07-25 08:35:37.231 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)
2024-07-25 08:35:37.232 WARNING (MainThread) [homeassistant.helpers.frame] Detected code that calls async_forward_entry_setup for integration nuki_ng with title: Voordeur and entry_id: -omit-, during setup without awaiting async_forward_entry_setup, which can cause the setup lock to be released before the setup is done. This will stop working in Home Assistant 2025.1. Please report this issue.
Stack (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2122, in async_forward_entry_setup
    _report_non_awaited_platform_forwards(entry, "async_forward_entry_setup")
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1175, in _report_non_awaited_platform_forwards
    report(
  File "/usr/src/homeassistant/homeassistant/helpers/frame.py", line 151, in report
    _LOGGER.warning(msg, stack_info=True)

@makerwolf
Copy link

Any chance to get this fixed @kvj?

@mefistofelis
Copy link

THat would be great if it could be fixed

@RomMuc
Copy link

RomMuc commented Sep 14, 2024

Hi,

I have been looking at how this was solved in other integrations and this might do the job. I haven’t tested it though, but happy to install a beta any time.

In __init__.py, replace lines 30 to 32:

for p in PLATFORMS:
  hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, p))
return True

by

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True

@craibo
Copy link

craibo commented Sep 21, 2024

@RomMuc
You are correct. here is the PR tested and confirmed it resolves the warning in my test instance
#196
FYI @kvj

@neildsb
Copy link

neildsb commented Oct 4, 2024

Hi,

I have been looking at how this was solved in other integrations and this might do the job. I haven’t tested it though, but happy to install a beta any time.

In __init__.py, replace lines 30 to 32:

for p in PLATFORMS:
  hass.async_create_task(hass.config_entries.async_forward_entry_setup(entry, p))
return True

by

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True

yes, it works for me also

image

I made a file copy 1st so i could rollback if needed, note the indents for others

@dm82m
Copy link

dm82m commented Dec 23, 2024

@kvj do you continue Development here or should we fork and take over?

@kvj
Copy link
Owner

kvj commented Dec 25, 2024

Hey there,

I've drafted a new release here: https://github.com/kvj/hass_nuki_ng/releases/tag/0.5.3

Please check that it's working as expected (I have no suitable hardware in hand at this moment).
If everything is okay, I will promote release to the stable one

@dm82m
Copy link

dm82m commented Dec 26, 2024

I am on 0.5.3 -> no logs errors encountered and also devices are shown correctly. I am using the Bridge and Opener.

@RomMuc
Copy link

RomMuc commented Dec 26, 2024

All good here too, using a Nuki Bridge and a Keypad. Thanks for the effort!

@mefistofelis
Copy link

HI, updated on 0.53 the previous error is gone i now get only this one: `This error originated from a custom integration.

Logger: custom_components.nuki_ng.nuki
Source: custom_components/nuki_ng/nuki.py:427
integration: Nuki Lock (documentation, issues)
First occurred: 12:46:00 (19 occurrences)
Last logged: 15:47:23

Failed to update callback http://192.168.1.179:8123/api/webhook/nuki_ng_bridge_hook_01J4BHXPZ08WQ44V3TSHSBWTC0
Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 468, in _make_request
six.raise_from(e, None)
~~~~~~~~~~~~~~^^^^^^^^^
File "", line 3, in raise_from
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 463, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.13/http/client.py", line 1428, in getresponse
response.begin()
~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/http/client.py", line 331, in begin
version, status, reason = self._read_status()
~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.13/http/client.py", line 292, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
return self._sock.recv_into(b)
~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 667, in send
resp = conn.urlopen(
method=request.method,
...<9 lines>...
chunked=chunked,
)
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 802, in urlopen
retries = retries.increment(
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
)
File "/usr/local/lib/python3.13/site-packages/urllib3/util/retry.py", line 552, in increment
raise six.reraise(type(error), error, _stacktrace)
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/urllib3/packages/six.py", line 770, in reraise
raise value
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 716, in urlopen
httplib_response = self._make_request(
conn,
...<5 lines>...
chunked=chunked,
)
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 470, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/urllib3/connectionpool.py", line 358, in _raise_timeout
raise ReadTimeoutError(
self, url, "Read timed out. (read timeout=%s)" % timeout_value
)
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.1.25', port=8080): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/nuki_ng/nuki.py", line 427, in _update
callbacks_list = await self.api.bridge_check_callback(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
self.bridge_hook
^^^^^^^^^^^^^^^^
)
^
File "/config/custom_components/nuki_ng/nuki.py", line 156, in bridge_check_callback
callbacks = await self.async_json(
^^^^^^^^^^^^^^^^^^^^^^
lambda r: r.get(self.bridge_url("/callback/list"), timeout=BRIDGE_TIMEOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "/config/custom_components/nuki_ng/nuki.py", line 39, in async_json
response = await self.hass.async_add_executor_job(lambda: cb(requests))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/nuki_ng/nuki.py", line 39, in
response = await self.hass.async_add_executor_job(lambda: cb(requests))
~~^^^^^^^^^^
File "/config/custom_components/nuki_ng/nuki.py", line 157, in
lambda r: r.get(self.bridge_url("/callback/list"), timeout=BRIDGE_TIMEOUT)
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 73, in get
return request("get", url, params=params, **kwargs)
File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.13/site-packages/requests/adapters.py", line 713, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPConnectionPool(host='192.168.1.25', port=8080): Read timed out. (read timeout=10)`

@z-master42
Copy link
Author

It says something about timeout. Can the lock or bridge be reached at all?

@mefistofelis
Copy link

mefistofelis commented Dec 26, 2024

The bridge is dropping randomly sometimes offline... I dont know whether this is an integration issue or a network/wifi issue...Right now it is reachable

@craibo
Copy link

craibo commented Dec 27, 2024

Hi @kvj

I can also confirm that updating to 0.5.3, clears the log errors and appears to be working correctly.

Thank you

@dm82m
Copy link

dm82m commented Dec 27, 2024

@kvj I am encountering some connection errors with the new beta, they were not existent in previous versions:

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.nuki_ng.nuki
Quelle: custom_components/nuki_ng/nuki.py:436
Integration: Nuki Lock (Dokumentation, Probleme)
Erstmals aufgetreten: 26. Dezember 2024 um 17:13:32 (6 Vorkommnisse)
Zuletzt protokolliert: 26. Dezember 2024 um 18:15:24

Failed to get latest data: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 444, in _error_catcher
    yield
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 828, in read_chunked
    self._update_chunk_length()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 758, in _update_chunk_length
    line = self._fp.fp.readline()
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 820, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 624, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 816, in read_chunked
    with self._error_catcher():
         ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 449, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nuki_ng/nuki.py", line 436, in _update
    device_list = await self.api.bridge_list()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 73, in bridge_list
    data = await self.async_json(lambda r: r.get(self.bridge_url("/list"), timeout=BRIDGE_TIMEOUT))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 39, in async_json
    response = await self.hass.async_add_executor_job(lambda: cb(requests))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/nuki_ng/nuki.py", line 39, in <lambda>
    response = await self.hass.async_add_executor_job(lambda: cb(requests))
                                                              ~~^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 73, in <lambda>
    data = await self.async_json(lambda r: r.get(self.bridge_url("/list"), timeout=BRIDGE_TIMEOUT))
                                           ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 746, in send
    r.content
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 902, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 826, in generate
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.

@mefistofelis
Copy link

@kvj I am encountering some connection errors with the new beta, they were not existent in previous versions:

Dieser Fehler stammt von einer benutzerdefinierten Integration

Logger: custom_components.nuki_ng.nuki
Quelle: custom_components/nuki_ng/nuki.py:436
Integration: Nuki Lock (Dokumentation, Probleme)
Erstmals aufgetreten: 26. Dezember 2024 um 17:13:32 (6 Vorkommnisse)
Zuletzt protokolliert: 26. Dezember 2024 um 18:15:24

Failed to get latest data: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.
Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 444, in _error_catcher
    yield
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 828, in read_chunked
    self._update_chunk_length()
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 758, in _update_chunk_length
    line = self._fp.fp.readline()
  File "/usr/local/lib/python3.13/socket.py", line 719, in readinto
    return self._sock.recv_into(b)
           ~~~~~~~~~~~~~~~~~~~~^^^
TimeoutError: timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 820, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 624, in stream
    for line in self.read_chunked(amt, decode_content=decode_content):
                ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 816, in read_chunked
    with self._error_catcher():
         ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/urllib3/response.py", line 449, in _error_catcher
    raise ReadTimeoutError(self._pool, None, "Read timed out.")
urllib3.exceptions.ReadTimeoutError: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/nuki_ng/nuki.py", line 436, in _update
    device_list = await self.api.bridge_list()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 73, in bridge_list
    data = await self.async_json(lambda r: r.get(self.bridge_url("/list"), timeout=BRIDGE_TIMEOUT))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 39, in async_json
    response = await self.hass.async_add_executor_job(lambda: cb(requests))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/nuki_ng/nuki.py", line 39, in <lambda>
    response = await self.hass.async_add_executor_job(lambda: cb(requests))
                                                              ~~^^^^^^^^^^
  File "/config/custom_components/nuki_ng/nuki.py", line 73, in <lambda>
    data = await self.async_json(lambda r: r.get(self.bridge_url("/list"), timeout=BRIDGE_TIMEOUT))
                                           ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 746, in send
    r.content
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 902, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/models.py", line 826, in generate
    raise ConnectionError(e)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.178.8', port=8080): Read timed out.

I get the exact same errors, brigde with lock gen 4 , lock gen 2 and fingerprint reader

@dm82m
Copy link

dm82m commented Jan 4, 2025

@kvj any update here?

@z-master42
Copy link
Author

It doesn't look as if development is still taking place here. So you have to fix it yourself or switch to the core integration.

@dm82m
Copy link

dm82m commented Jan 4, 2025

Core integration has no automatic bridge webhook handling.

@kvj
Copy link
Owner

kvj commented Jan 4, 2025

@dm82m any update on what? You experience http connections timeouts to your bridge, which is kind of expected, as Nuki bridge is quite poor devices in terms of hardware inside.

I don't see any reason how this could be relevant to the changes introduced in 0.5.3.

@dm82m
Copy link

dm82m commented Jan 4, 2025

I have not seen this issue before the changes but if you say it is not related I take that. Then you could release it?

@z-master42
Copy link
Author

0.5.3 is the latest version.

@kvj
Copy link
Owner

kvj commented Jan 4, 2025

https://github.com/kvj/hass_nuki_ng/releases/tag/0.5.3 has been released last week

@dm82m
Copy link

dm82m commented Jan 4, 2025

Okay then we can close this issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants