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

Multiple errors in the log afte HA upgrade to 2021.12.1 #303

Closed
new-kirte opened this issue Dec 14, 2021 · 5 comments
Closed

Multiple errors in the log afte HA upgrade to 2021.12.1 #303

new-kirte opened this issue Dec 14, 2021 · 5 comments
Labels
bug Something isn't working device: camera fixed bug fixed

Comments

@new-kirte
Copy link

new-kirte commented Dec 14, 2021

After upgrade to HA 2021.12.1 cameras stopped working and log has multiple errors
Logger: homeassistant
Source: custom_components/xiaomi_miot/camera.py:390
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: December 13, 2021, 11:05:20 PM (60 occurrences)
Last logged: 7:58:05 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/xiaomi_miot/camera.py", line 417, in _handle_stream_refresh
await self.stream_source(scheduled=True)
File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source
return await self.hass.async_add_executor_job(partial(fun, **kwargs))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/xiaomi_miot/camera.py", line 390, in get_stream_address
self.is_streaming = self._last_url and True
AttributeError: can't set attribute

Logger: aiohttp.server
Source: custom_components/xiaomi_miot/camera.py:390
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: December 13, 2021, 11:03:15 PM (26 occurrences)
Last logged: 7:30:55 AM

Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
resp = await request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 220, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 181, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 629, in get
return await self.handle(request, camera)
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 647, in handle
image = await _async_get_image(
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 166, in _async_get_image
image_bytes = await camera.async_camera_image(
File "/config/custom_components/xiaomi_miot/camera.py", line 101, in async_camera_image
url = await self.image_source()
File "/config/custom_components/xiaomi_miot/camera.py", line 334, in image_source
return await self.stream_source()
File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source
return await self.hass.async_add_executor_job(partial(fun, **kwargs))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/xiaomi_miot/camera.py", line 390, in get_stream_address
self.is_streaming = self._last_url and True
AttributeError: can't set attribute

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/xiaomi_miot/camera.py:390
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 7:30:33 AM (1 occurrences)
Last logged: 7:30:33 AM

[140309221730192] Error handling message: Unknown error
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
await func(hass, connection, msg)
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 727, in ws_camera_stream
url = await _async_stream_endpoint_url(hass, camera, fmt=msg["format"])
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 909, in _async_stream_endpoint_url
stream = await camera.create_stream()
File "/usr/src/homeassistant/homeassistant/components/camera/init.py", line 455, in create_stream
source = await self.stream_source()
File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source
return await self.hass.async_add_executor_job(partial(fun, **kwargs))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/xiaomi_miot/camera.py", line 390, in get_stream_address
self.is_streaming = self._last_url and True
AttributeError: can't set attribute

Camera in question:

access_token: 7467bd557125e66b3f8d9d40cc52de0db3d7a5389abd28414***************
brand: chuangmi
frontend_stream_type: hls
model: chuangmi.camera.ipc019
lan_ip: 192.168.*.*
mac_address: **:**:**:**:**:**
entity_class: MiotCameraEntity
home_room: **********'s home Play Area
miot_type: urn:miot-spec-v2:device:camera:0000A01C:chuangmi-ipc019:1
camera_control.on: true
camera_control.image_rollover: 180
camera_control.night_shot: 0
camera_control.time_watermark: true
camera_control.wdr_mode: true
glimmer_full_color-2-6: true
camera_control.recording_mode: 3
camera_control.motion_tracking: false
stream_status-3-1: 1
state_updater: cloud
motion_video_time: '2021-12-14 07:43:26'
motion_video_type: ObjectMotion:PeopleMotion
sub_entities:
  - camera_control.on
  - motion_event
motion_video_latest:
  startDuration: 0
  cut: false
  offset: 0
  isCloud: false
  isRead: false
  videoStoreId: >-
    GKAC4teuJHG30ICzVOdbH2IlOrRoQHhSm1sZ3XE8I89hJeuXvwQFXyeDhNjc57M0mu6QVoN6_kiwH3aMqhn3LzjNd7tyCmoESH4q2Gcd4VtG4J3LFOgbaR0Dy-4SuNQ2Z8i4ylUVUqnQZNbx5Uc7zd6n2a7Vx3EKkkQcEMWY7jagjrpCSSGEpzIne7d9qeYhA-Y27G1wOV7ZVgCuhvbemFMuAkjr6CQ4VJh1RyU52rysnkQjjE4DsK9CrJKEGExfredAwQULQeOcJeDKZRu23dBFn3SA0CHaMJg43dXlX5giF_ulvSTgsl-zkLdWtuJ7RiuxDdmbX8sMubh0cHbWg_pXwyxcPbE8BSNDk0f7l8KPMKDBAFkwrvpum8VTsM6CchkEGBKe5qcfpSRDlZbCQK-1NKbsugEYENQgzYetZ1S13RER3m0KoNQYFPNmXx-uC7FyXr4Br4mfYhKwu5vKAA
  eventType: ObjectMotion:PeopleMotion
  expireTime: 1640058210698
  isAlarm: true
  imgStoreId: >-
    GKACaZEAD4pQ8VL2AEv8afxge-VY7sM8y9bJlUIenP7BqRBDapYcxIU6jHwFoScBXdX61urRwF7Gi87g_4K_VLhz4CS1Lc4HlLqC_YDECgliusEkuaQMNJ4vSVfv0ZQq2QDHjdMo2LNIe8WXhhJoWZwgkSpoRc4zmelfqPzaY6-rHyl7svz2o6W9QV5ot6GAw6Bf8VQNqvB1539QL83aj3EDWpDH9KyE_eGLSnNHCuczFL2dqcWfhbBIl5P-Uf6igoK3ZMC2qyY7yiQcKNFK-KfEseTRgkhZKIJWOqrJAMR2AUv-HwdagnPxIT1nKdsB7p296_3Anbw69H2pzI3Ka16ZCGY5wEiLVxEg3cs4sDWs3hvzfm9sfTMsQnlCxmcaNV_4GBKD_UNYcmdAPI4AR2RColJd_AEYEOL4XR12f9YO7GlFsbrXFq8YFGLwKlZlxvNgA7zckDW_fFYKw0_vAA
  fileId: '67575900115834240'
  extraInfo: ''
miot_action_result:
  did: '322523286'
  miid: 0
  siid: 4
  aiid: 1
  code: 0
  out:
    - >-
      https://sg19.livestreaming.io.mi.com/hlstranscoder/G*******************A_H265transH264/playlist.m3u8
  exe_time: 0
  withLatency: 0
entity_picture: >-
  /api/camera_proxy/camera.chuangmi_ipc019_4c79_camera_control?token=7467bd557125e66b3f8d9d40cc52de0db3d7a5389abd2841****************
friendly_name: Play Area Camera Camera Control
supported_features: 3
motion_stream_slice: -1
sub_motion_stream: true
keep_streaming: true
video_attribute: 1

Motion event entity of the same camera works fine:

access_token: f11cadb654962afde315bf13c6c311096911f119e8c790***************
brand: chuangmi
frontend_stream_type: hls
entity_class: MotionCameraEntity
parent_entity_id: camera.chuangmi_ipc019_4c79_camera_control
stream_address: >-
  https://sg.business.smartcamera.api.io.mi.com/common/app/m3u8?data=***&rc4_hash__=***&signature=***&ssecurity=***&_nonce=***&yetAnotherServiceToken=*****
image_address: >-
  https://sg.processor.smartcamera.api.io.mi.com/miot/camera/app/v1/img?data=**&rc4_hash__=**&ssecurity=**&_nonce=**&yetAnotherServiceToken=**
entity_picture: >-
  /api/camera_proxy/camera.chuangmi_ipc019_4c79_motion_event?token=f11cadb654962afde315bf13c6c311096911f119e8c79058****************
friendly_name: Play Area Camera Camera Control motion_event
supported_features: 2
@al-one al-one added bug Something isn't working device: camera labels Dec 14, 2021
@al-one al-one added the fixed bug fixed label Dec 14, 2021
@al-one
Copy link
Owner

al-one commented Dec 14, 2021

AttributeError: can't set attribute

Fixed in 3a02e7c, please upgrade to master branch.

@new-kirte
Copy link
Author

@al-one,
Errors still remain:
Logger: homeassistant.components.stream
Source: components/stream/init.py:305
Integration: Stream (documentation, issues)
First occurred: 9:58:22 AM (78 occurrences)
Last logged: 6:20:17 PM

Error from stream worker: Stream ended; no additional packets
Error from stream worker: Error opening stream https://sg17.livestreaming.io.mi.com/hlstranscoder/GCA5NjFmY2ExY2MxMDE0ZGFiYjU3Yzc2Zjg2MjgxNjY0ORgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8

Logger: homeassistant
Source: custom_components/xiaomi_miot/camera.py:400
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 11:13:53 AM (1 occurrences)
Last logged: 11:13:53 AM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.9/http/client.py", line 1371, in getresponse
response.begin()
File "/usr/local/lib/python3.9/http/client.py", line 319, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.9/http/client.py", line 288, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.9/site-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/local/lib/python3.9/site-packages/urllib3/packages/six.py", line 769, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 445, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/usr/local/lib/python3.9/site-packages/urllib3/connectionpool.py", line 440, in _make_request
httplib_response = conn.getresponse()
File "/usr/local/lib/python3.9/http/client.py", line 1371, in getresponse
response.begin()
File "/usr/local/lib/python3.9/http/client.py", line 319, in begin
version, status, reason = self._read_status()
File "/usr/local/lib/python3.9/http/client.py", line 288, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/config/custom_components/xiaomi_miot/camera.py", line 417, in _handle_stream_refresh
await self.stream_source(scheduled=True)
File "/config/custom_components/xiaomi_miot/camera.py", line 326, in stream_source
return await self.hass.async_add_executor_job(partial(fun, **kwargs))
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/xiaomi_miot/camera.py", line 385, in get_stream_address
self.async_check_stream_address(self._last_url)
File "/config/custom_components/xiaomi_miot/camera.py", line 400, in async_check_stream_address
res = requests.head(url)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 102, in head
return request('head', url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

@new-kirte
Copy link
Author

Other errors:
Logger: libav.hls
Source: components/stream/worker.py:349
First occurred: 9:58:22 AM (2 occurrences)
Last logged: 9:58:22 AM

Failed to reload playlist 0

Logger: libav.https
Source: components/stream/worker.py:447
First occurred: 9:58:34 AM (77 occurrences)
Last logged: 6:20:17 PM

HTTP error 403 Forbidden

@al-one
Copy link
Owner

al-one commented Dec 16, 2021

HTTP error 403 Forbidden

The stream address has no access rights, and there's nothing I can do.

@new-kirte
Copy link
Author

HTTP error 403 Forbidden

The stream address has no access rights, and there's nothing I can do.

But it works, it just throws errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device: camera fixed bug fixed
Projects
None yet
Development

No branches or pull requests

2 participants