Open drjjr2 opened 3 years ago
Hi,
I will need full logs to tshoot this. (https://github.com/fwestenberg/reolink_dev/blob/master/TSHOOT.md)
Here's a snippet:
2021-11-23 16:04:43 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2021-11-23 16:04:43 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 112, in handle_event
await self._base.api.get_all_motion_states()
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 489, in get_all_motion_states
json_data = json.loads(response)
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 116, in handle_event
_LOGGER.error(traceback.format_exc(()))
File "/usr/local/lib/python3.9/traceback.py", line 167, in format_exc
return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
File "/usr/local/lib/python3.9/traceback.py", line 120, in format_exception
return list(TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 495, in __init__
context = TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 517, in __init__
self.stack = StackSummary.extract(
File "/usr/local/lib/python3.9/traceback.py", line 340, in extract
if limit >= 0:
TypeError: '>=' not supported between instances of 'tuple' and 'int'
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'cmd': 'Search', 'token': 'f07dec1886eea19'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 8, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Host 10.0.0.40: Error translating Search response to json
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'cmd': 'Search', 'token': 'e6d9c88ac0255a9'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 0, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Host 10.0.0.40: Error translating Search response to json
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'cmd': 'Search', 'token': '0f81f2d18c39718'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 2, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Host 10.0.0.40: Error translating Search response to json
2021-11-23 16:04:43 DEBUG (MainThread) [custom_components.reolink_dev.base] Webhook called
2021-11-23 16:04:43 DEBUG (MainThread) [custom_components.reolink_dev.base] Webhook called
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 8, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 0, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 2, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 8, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 0, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] Sending command: Search to: 10.0.0.40 with body: [{'cmd': 'Search', 'action': 0, 'param': {'Search': {'channel': 2, 'onlyStatus': 1, 'streamType': 'sub', 'StartTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 0, 'min': 0, 'sec': 0}, 'EndTime': {'year': 2021, 'mon': 11, 'day': 23, 'hour': 16, 'min': 4, 'sec': 43}}}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'token': 'f07dec1886eea19'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 8}}, {'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 8}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2021-11-23 16:04:43 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 112, in handle_event
await self._base.api.get_all_motion_states()
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 489, in get_all_motion_states
json_data = json.loads(response)
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 116, in handle_event
_LOGGER.error(traceback.format_exc(()))
File "/usr/local/lib/python3.9/traceback.py", line 167, in format_exc
return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
File "/usr/local/lib/python3.9/traceback.py", line 120, in format_exception
return list(TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 495, in __init__
context = TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 517, in __init__
self.stack = StackSummary.extract(
File "/usr/local/lib/python3.9/traceback.py", line 340, in extract
if limit >= 0:
TypeError: '>=' not supported between instances of 'tuple' and 'int'
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'token': 'e6d9c88ac0255a9'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 0}}, {'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 0}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
2021-11-23 16:04:43 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 112, in handle_event
await self._base.api.get_all_motion_states()
File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 489, in get_all_motion_states
json_data = json.loads(response)
File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/reolink_dev/binary_sensor.py", line 116, in handle_event
_LOGGER.error(traceback.format_exc(()))
File "/usr/local/lib/python3.9/traceback.py", line 167, in format_exc
return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain))
File "/usr/local/lib/python3.9/traceback.py", line 120, in format_exception
return list(TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 495, in __init__
context = TracebackException(
File "/usr/local/lib/python3.9/traceback.py", line 517, in __init__
self.stack = StackSummary.extract(
File "/usr/local/lib/python3.9/traceback.py", line 340, in extract
if limit >= 0:
TypeError: '>=' not supported between instances of 'tuple' and 'int'
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'token': '0f81f2d18c39718'}
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'GetMdState', 'action': 0, 'param': {'channel': 2}}, {'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 2}}]
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=502 content-type=(text/html)
2021-11-23 16:04:43 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: <html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx</center>
</body>
</html>
2021-11-23 16:04:43 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API
GetMdState or GetAiState is crashing your NVR or your camera but I cannot tell why. They are really standard commands, may be you should contact Reolink support and/or check if they don't have a more up to date software
Describe the bug Log showing errors and then the NVR reboots
To Reproduce Unclear, here is the log:
2021-11-20 20:09:32 ERROR (MainThread) [custom_components.reolink_dev.binary_sensor] Motion states could not be queried from API 2021-11-20 20:09:32 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/config/custom_components/reolink_dev/binary_sensor.py", line 112, in handle_event await self._base.api.get_all_motion_states() File "/usr/local/lib/python3.9/site-packages/reolink/camera_api.py", line 489, in get_all_motion_states json_data = json.loads(response) File "/usr/local/lib/python3.9/json/init.py", line 346, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/config/custom_components/reolink_dev/binary_sensor.py", line 116, in handle_event _LOGGER.error(traceback.format_exc(())) File "/usr/local/lib/python3.9/traceback.py", line 167, in format_exc return "".join(format_exception(*sys.exc_info(), limit=limit, chain=chain)) File "/usr/local/lib/python3.9/traceback.py", line 120, in format_exception return list(TracebackException( File "/usr/local/lib/python3.9/traceback.py", line 495, in init context = TracebackException( File "/usr/local/lib/python3.9/traceback.py", line 517, in init self.stack = StackSummary.extract( File "/usr/local/lib/python3.9/traceback.py", line 340, in extract if limit >= 0: TypeError: '>=' not supported between instances of 'tuple' and 'int'
Expected behavior Not to get errors.
Screenshots If applicable, add screenshots to help explain your problem.
Environment: Please provide useful information about your environment, like:
Additional context Add any other context about the problem here.