Closed jonferreira closed 6 months ago
For what is worth I've just noticed 2024.3 will Bump pychromecast to 14.0.0 so maybe that will help, will have to wait for next stable release to test it
For what is worth I've just noticed 2024.3 will Bump pychromecast to 14.0.0 so maybe that will help, will have to wait for next stable release to test it
@jonferreira Where do you see that? Poking through the beta release notes and I don't see that (but I might be lookin' in the wrong spot!)
Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (cast
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
cast documentation cast source (message by IssueLinks)
For what is worth I've just noticed 2024.3 will Bump pychromecast to 14.0.0 so maybe that will help, will have to wait for next stable release to test it
@jonferreira Where do you see that? Poking through the beta release notes and I don't see that (but I might be lookin' in the wrong spot!)
there you go mate - https://rc.home-assistant.io/changelogs/core-2024.3
for what is worth I've now upgraded to 2024.3.1 and will report back if this happens again
The offending code was removed from pychromecast 14.0.0 which is part of Home Assistant Core 2024.3, so the exact same error can't happen again.
However, that error is extremely unlikely to have caused the Home Assistant Core process to crash; the log shows that the connection to the cast device was lost and then attempted to be reestablished.
Every single time that happened, HA crashed. For months.
That can't be a coincidence...
@emontnemery it happened again, sent a "TTS command" and docker container crashed :
2024-03-19 19:05:18.842 ERROR (Thread-13) [pychromecast.socket_client] [Living Room(192.168.1.141):8009] Unhandled exception in worker thread, attempting reconnect Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 533, in run if self._run_once(timeout=POLL_TIME_BLOCKING) == 1: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 591, in _run_once message = self._read_message() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 824, in _read_message payload_info = self._read_bytes_from_socket(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 806, in _read_bytes_from_socket chunk = self.socket.recv(min(msglen - bytes_recd, 2048)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1233, in recv return self.read(buflen) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1106, in read return self._sslobj.read(len) ^^^^^^^^^^^^^^^^^^^^^^ ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2559) 2024-03-19 19:05:18.884 WARNING (Thread-13) [pychromecast.socket_client] [Living Room(192.168.1.141):8009] Error communicating with socket, resetting connection 2024-03-19 19:05:18.891 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140496672273088] Failed to execute set volume. Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call result = await task ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 812, in async_set_volume_level await self.hass.async_add_executor_job(self.set_volume_level, volume) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 508, in set_volume_level self._get_chromecast().set_volume(volume) File "/usr/local/lib/python3.12/site-packages/pychromecast/controllers/receiver.py", line 256, in set_volume response_handler.wait_response() File "/usr/local/lib/python3.12/site-packages/pychromecast/response_handler.py", line 54, in wait_response raise RequestFailed(self._request) pychromecast.error.RequestFailed: Failed to execute set volume.
Let me know if you want me to send you home-assistant.log.fault
This happened again and as usual, docker container crashed immediately.
2024-04-07 14:53:12.004 ERROR (Thread-13) [pychromecast.socket_client] [Living Room(192.168.1.141):8009] Unhandled exception in worker thread, attempting reconnect Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 533, in run if self._run_once(timeout=POLL_TIME_BLOCKING) == 1: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 591, in _run_once message = self._read_message() ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 824, in _read_message payload_info = self._read_bytes_from_socket(4) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 806, in _read_bytes_from_socket chunk = self.socket.recv(min(msglen - bytes_recd, 2048)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1233, in recv return self.read(buflen) ^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/ssl.py", line 1106, in read return self._sslobj.read(len) ^^^^^^^^^^^^^^^^^^^^^^ ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2559) 2024-04-07 14:53:12.025 WARNING (Thread-13) [pychromecast.socket_client] [Living Room(192.168.1.141):8009] Error communicating with socket, resetting connection
I'd really appreciate if you could take a look at this @emontnemery
:wave: Hello everyone, happy Tuesday! I was looking to see if there were more reports of this one after my HA restarted itself yesterday. I got the same error as the above in the evening with the latest 2024.5.1.
2024-05-06 22:05:08.945 ERROR (Thread-7) [pychromecast.socket_client] [Cucina(xxx.xxx.xxx.xxx):8009] Unhandled exception in worker thread, attempting reconnect
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 533, in run
if self._run_once(timeout=POLL_TIME_BLOCKING) == 1:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 591, in _run_once
message = self._read_message()
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 824, in _read_message
payload_info = self._read_bytes_from_socket(4)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pychromecast/socket_client.py", line 806, in _read_bytes_from_socket
chunk = self.socket.recv(min(msglen - bytes_recd, 2048))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 1233, in recv
return self.read(buflen)
^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/ssl.py", line 1106, in read
return self._sslobj.read(len)
^^^^^^^^^^^^^^^^^^^^^^
ssl.SSLError: [SSL: SSLV3_ALERT_BAD_RECORD_MAC] sslv3 alert bad record mac (_ssl.c:2559)
This then caused a full restart of the docker container:
[20:05:09] INFO: Home Assistant Core finish process exit code 256
[20:05:09] INFO: Home Assistant Core finish process received signal 11
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun home-assistant (no readiness notification)
s6-rc: info: service legacy-services successfully started
P.S. Let me know if I it's better to create another issue report for this one!
Unfortunately, no. I'm still being plagued by this with no response.
The problem
Hi.
For quite some time now my HA randomly crashes taking the docker container with it.
It seems to be related to the pychromecast library used by HA to communicate with Google Chromecast.
Attached all the information I could gather. I can also share the homeassistant.log.fault file if needed (too large to copy paste here)
What version of Home Assistant Core has the issue?
core-2024.2.1
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
pychromecast
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
No response
Anything in the logs that might be useful for us?
Additional information
No response