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

0.9.66 Failed to Sync Device State #414

Open
robertvorthman opened this issue Nov 4, 2024 · 12 comments
Open

0.9.66 Failed to Sync Device State #414

robertvorthman opened this issue Nov 4, 2024 · 12 comments

Comments

@robertvorthman
Copy link

robertvorthman commented Nov 4, 2024

One of my cameras stopped working after upgrading to 0.9.66. It's possible the camera stopped working on an earlier version and I did not notice. I'm getting a 403 forbidden error. My other 3 cameras work fine.

Camera model: IPC-T54IR-ZE

Logs

2024-11-04 14:41:23.572 DEBUG (MainThread) [custom_components.dahua] ClientError fetching information from http://192.168.1.62:80/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify
2024-11-04 14:41:23.574 WARNING (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.1.62. See README to enable debug logs to get full exception
2024-11-04 14:41:23.574 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.1.62
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='http://192.168.1.62/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify'
2024-11-04 14:41:56.984 DEBUG (MainThread) [custom_components.dahua] ClientError fetching information from http://192.168.1.62:80/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify

2024-11-04 14:41:23.574 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.1.62
Traceback (most recent call last):
  File "/config/custom_components/dahua/__init__.py", line 334, in _async_update_data
    results = await asyncio.gather(*coros)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 655, in async_get_event_notifications
    return await self.get(url)
           ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 812, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 795, in get
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1121, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url='http://192.168.1.62/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify'
2024-11-04 14:41:23.576 DEBUG (MainThread) [custom_components.dahua] Finished fetching dahua data in 8.573 seconds (success: False)

Debug

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1061, in _wrap_create_connection
    sock = await aiohappyeyeballs.start_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/impl.py", line 104, in start_connection
    raise first_exception
  File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/impl.py", line 82, in start_connection
    sock = await _connect_sock(
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohappyeyeballs/impl.py", line 174, in _connect_sock
    await loop.sock_connect(sock, address)
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 641, in sock_connect
    return await fut
           ^^^^^^^^^
  File "/usr/local/lib/python3.12/asyncio/selector_events.py", line 681, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('192.168.1.62', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/dahua/__init__.py", line 197, in _async_update_data
    self._max_streams = await self.client.get_max_extra_streams() + 1
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 141, in get_max_extra_streams
    result = await self.get("/cgi-bin/magicBox.cgi?action=getProductDefinition&name=MaxExtraStream")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 812, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 794, in get
    response = await auth.request("GET", url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/digest.py", line 46, in request
    response = await self.session.request(method, url, headers=headers, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client.py", line 659, in _request
    conn = await self._connector.connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 557, in connect
    proto = await self._create_connection(req, traces, timeout)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1002, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1336, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1305, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/connector.py", line 1076, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.62:80 ssl:default [Connect call failed ('192.168.1.62', 80)]
Screenshot 2024-11-04 at 2 56 08 PM
@sebastiannowicki
Copy link

same issue for my 2 Dahua cams. Other Dahua cams works fine.

@lsantoro
Copy link

lsantoro commented Nov 5, 2024

Same issue with my 3 IP cameras DH-IPC-HFW3849T1-AS-PV-S3 with the latest firmware: 2.840.0000000.28.R, build: 2024-08-07.
Last working version: 0.9.63.

The S5 version DH-IPC-HFW3849T1-AS-PV works correctly with 0.9.64, 0.9.65 e 0.9.66.

@jgverweij
Copy link

Also 0.9.66 fails with camera IPC-T5442T-ZEB - Firmware: 2.820.15OG004.0.R,build:2021-07-29
So does 0.9.64
But 0.9.63 is fine

@jgverweij
Copy link

error.log

@brianegge
Copy link
Contributor

Same with my four dahua cameras. My three amcrest and eight lorex ones are fine.

@sasukebinbin
Copy link

Same with my four Imou cameras connected with dahua NVR.

@sasukebinbin
Copy link

Just made a test, the last working version is 0.9.60

@nasixi
Copy link

nasixi commented Nov 6, 2024

I also have this issue on one camera, a IPC-HDW5541H-AS-PV with firmware V2.840.0000000.28.R, Build Date: 2024-08-07

I keep seeing disconnections to this camera in Frigate, and looking at the camera's system logs, I'm seeing lots of Abort, errors.

I'm not sure if the camera is at fault or not, but there seems to be some connection issue with the integration.

I've reverted to 0.9.63 and can now connect to that camera, although the integration is showing as 9.60?

@LX1974
Copy link

LX1974 commented Nov 6, 2024

same here, lost connection to nvr cams

@cMoi421
Copy link

cMoi421 commented Nov 6, 2024

Même problème avec caméra IPC-HDBW3541E-AS Micrologiciel : 2.800.0000000.14.R,build:2020-06-12 dernière version fonctionnelle 0.9.63.

@longzheng
Copy link

Same error with DH-IPC-HDW3641TMP-AS-0280B-AUS

2024-11-07 16:14:26.436 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.1.26
Traceback (most recent call last):
  File "/config/custom_components/dahua/__init__.py", line 334, in _async_update_data
    results = await asyncio.gather(*coros)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 655, in async_get_event_notifications
    return await self.get(url)
           ^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/dahua/client.py", line 812, in get
    raise exception
  File "/config/custom_components/dahua/client.py", line 795, in get
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1157, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='http://192.168.1.26/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify'

@awreeoh
Copy link

awreeoh commented Nov 7, 2024

same

2024-11-07 13:19:02.954 DEBUG (MainThread) [custom_components.dahua] Failed to sync device state for 192.168.50.134
Traceback (most recent call last):
File "/config/custom_components/dahua/init.py", line 334, in _async_update_data
results = await asyncio.gather(*coros)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 655, in async_get_event_notifications
return await self.get(url)
^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/dahua/client.py", line 812, in get
raise exception
File "/config/custom_components/dahua/client.py", line 795, in get
response.raise_for_status()
File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1157, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='http://192.168.50.134/cgi-bin/configManager.cgi?action=getConfig&name=DisableEventNotify'

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