core icon indicating copy to clipboard operation
core copied to clipboard

Error when trying to cast dashboard

Open jaredcat opened this issue 1 year ago • 7 comments

The problem

Logger: homeassistant.components.websocket_api.http.connection
Source: components/lovelace/cast.py:185
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 9:26:25 PM (1 occurrences)
Last logged: 9:26:25 PM

[140663741455168] Error handling message: Unknown error (unknown_error) Jared from 10.0.0.1 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1310, in websocket_browse_media
    payload = await player.async_browse_media(media_content_type, media_content_id)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/cast/media_player.py", line 603, in async_browse_media
    browse_media = await platform.async_browse_media(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/lovelace/cast.py", line 83, in async_browse_media
    info = await _get_dashboard_info(hass, url_path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/lovelace/cast.py", line 185, in _get_dashboard_info
    for idx, view in enumerate(config["views"]):
                               ~~~~~~^^^^^^^^^
KeyError: 'views'

What version of Home Assistant Core has the issue?

core-2024.1.0

What was the last working version of Home Assistant Core?

core-2023.12.4

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Cast

Link to integration documentation on our website

https://www.home-assistant.io/integrations/cast/

Diagnostics information

home-assistant_cast_2024-01-05T05-44-30.551Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

Pretty sure it was working yesterday before I updated today. The issue I'm facing is when i go to Google Cast > Devices > [Device] > [Controls] > Browse Media > Dashboards then an error modal pops up saying Media browsing error Unknown Error

jaredcat avatar Jan 05 '24 05:01 jaredcat

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!

Code owner commands

Code owners of cast can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign cast Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


cast documentation cast source (message by IssueLinks)

home-assistant[bot] avatar Jan 05 '24 05:01 home-assistant[bot]

Still broken on 2024.1.2

jaredcat avatar Jan 06 '24 00:01 jaredcat

Same issue for me here. It worked in the beginning, but now it doesn't. I can't really tell why. I have the same error in my logs.

RedCrafter07 avatar Jan 18 '24 16:01 RedCrafter07

I have the same probem as others Cast&recast do not work anymore Neither googlecast

aladin2000 avatar Jan 28 '24 09:01 aladin2000

I have the same probem as others Cast&recast do not work anymore Neither googlecast

For me, cast itself (e.g. TTS) does actually work, but not casting a dashboard to a Chromecast device (in my case Google Nest Hub Gen 2)

RedCrafter07 avatar Jan 28 '24 11:01 RedCrafter07

I have the same issue

DellBoy4 avatar Feb 06 '24 17:02 DellBoy4

I meant to come back here and update that yea you can still cast by calling a service /dashboard-path-here/0 (or it seems to be usually 0 for me) but seems something changed which breaks this code as well as https://cast.home-assistant.io/ which errors with can't being able to find default_view

jaredcat avatar Feb 06 '24 22:02 jaredcat

HI, do you have found a solution? Thanks

TheBarber82 avatar Mar 31 '24 23:03 TheBarber82

@TheBarber82 my comment above yours should do it: create a script or just call as service image

jaredcat avatar Apr 01 '24 00:04 jaredcat

@TheBarber82 my comment above yours should do it: create a script or just call as service image

Thanks for the screenshot is more clear for me (i am new at HA). I Hope this will be fixed officially one day :)

TheBarber82 avatar Apr 01 '24 06:04 TheBarber82

It seems there is a missing check on the code, I will try to do a PR.

TheBarber82 avatar Apr 02 '24 09:04 TheBarber82

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

Believe this was fixed with https://github.com/home-assistant/core/pull/114924

jaredcat avatar Jul 07 '24 19:07 jaredcat