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

Unhandled exception when casting local media #21109

Open
3 of 4 tasks
phoenix-9 opened this issue Jun 18, 2024 · 0 comments
Open
3 of 4 tasks

Unhandled exception when casting local media #21109

phoenix-9 opened this issue Jun 18, 2024 · 0 comments

Comments

@phoenix-9
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

I use hass.io. I have movies in "My media". I also have security cameras (Unifi). I have a few Google Chromecast TV dongles.

If I cast the security cameras to the Google Chromecast devices, it works perfectly.

If I try to cast a local video file, it fails with an unhandled exception (see below). At the same time, I get the following error in the log:
Failed to cast media https://hassio.mclemente.net:8123/media/local/Video/9.mkv?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJiMmI1Mzg5MzhlYjc0OWJjYWYxMjZjMmVmMzIzODc3MSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvVmlkZW8vOS5ta3YiLCJwYXJhbXMiOltdLCJpYXQiOjE3MTg3MTE3MDcsImV4cCI6MTcxODc5ODEwN30.pzEXh9evFPN304H31pU4GmWr2JOegUDozPpFvg_GRS4 from internal_url (https://hassio.mclemente.net:8123). Please make sure the URL is: Reachable from the cast device and either a publicly resolvable hostname or an IP address

It is quite possible that there is an issue with DNS and IP addresses. Homeassistant has a 192.168.x.x ip address. Chromecast insists on trying to resolve using Google's DNS servers (8.8.8.8) and that returns the external ip address. Homeassistant should be reachable on either the internal or external address should be reachable by the Chromecast device. The external address gets forwarded to the internal address by the router.

Describe the behavior you expected

I expect the Chromecast device to start playing the video file. Instead the Chromecast plays a black screen with a spinning circle.

Steps to reproduce the issue

...

What version of Home Assistant Core has the issue?

2024.6.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

linux/debian/chromium

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

Logger: aiohttp.server
Source: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:421
First occurred: 06:55:12 (1 occurrences)
Last logged: 06:55:12

Unhandled exception
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 531, in start
resp, reset = await task
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
reset = await self.finish_response(request, resp, start_time)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 630, in finish_response
await prepare_meth(request)
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_fileresponse.py", line 303, in prepare
return await self._sendfile(request, fobj, offset, count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/aiohttp/web_fileresponse.py", line 96, in _sendfile
await loop.sendfile(transport, fobj, offset, count)
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1231, in sendfile
return await self._sendfile_fallback(transport, file,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1252, in _sendfile_fallback
read = await self.run_in_executor(None, file.readinto, view)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 5] I/O error

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

1 participant