-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
Timeout when waiting for status response from Spotify app #249
Comments
I've had the same issue will working on a PR. The issue seems to have been limited to monday-tuesday. I've been doing extensive testing for #251 and haven't replicated the issue yet since yesterday. |
Its possible Spotify changes their auth mechanism or it might be different for different devices. If you can try following these docs https://github.com/home-assistant-libs/pychromecast#exploring-existing-namespaces |
I am also facing this issue. Any workarounds? |
Hey there, just started having this issue in the last 24 hours after using Spotcast flawlessly for a month or so. Anything else I can try or information I can provice that could be useful? I can't come up with a theory on what caused the issue to surface, as I did not directly make any changes to Spotcast, the Spotify integration, my Spotify accounts or anything to do with my Google devices, Google Home app settings, etc. I used Spotcast successfully last night to start a lullaby playlist in my son's room. An hour later I rebooted Home Assistant a few times in an attempt to get some disconnected ZigBee devices back onto the network, and then ran into this issue when I tried to restart the automation running the lullaby playlist. Without success, I've removed and reinstalled Spotcast, the Spotify integration, as well as recreating the Spotify app with new oauth credentials, regenerating fresh sp_dc & sp_key cookies, and relinking Home Assistant with Google Home. When I call spotcast.start from Home Assistant, my Google cast devices make a single chime and then nothing happens. This happens consistently on a Google Home (old speaker-only unit) and a Google Nest with display since last night. I am using the latest versions: Here is the logging I have showing the same pychromecast timeout error as above. I have multiple accounts enabled in the config for Spotast, and the issue occurs in the same way whether I directly specify either account or leave it on default.
Cheers! |
Hey there, |
Same for me since yesterday. Seems like it is a Spotify issue if multiple person's encounter this? |
Echoing the issue since yesterday. Tried reinstalling Spotcast, changing credentials, restarting HA, reloading the Spotify integration. Nothing is currently working to cast audio to the speakers. |
Well, at least I am not just an idiot. I reinstalled spotcast, reset keys, made a new api for testing, and even went so far as to adjust firewall rules but no dice. I get a timeout error every time. I suspect the auth codeflow might have been altered again. |
The following worked for me. What a great integration and community! #365 |
I'm experiencing this behaviour again. A lot like the comments above. It might have to do with Spotify changing their auth/handshake flow? |
I am experiencing this today - anyone have thoughts on cause/fix? |
How lucky I am. I just got tuned the setup for the first time and getting the same error, from what I'm reading, it seems to be something due to a change from spotify's end |
here is the error log:
Really bad, is there any solution please? |
@Electronlibre2012, as stated in previous comments, you can call directly the spotify device id, but this is limited for Chromecast devices. No need to post more logs that gives the same information, I'm currently on vacation so I don't quite have the time to explore an alternative to fetch the device Id so if people can help that would be useful |
I can poke at it a bit but as per usual, devs made changes during the time of year when I have the highest work load. I will try to take a look at this this weekend. |
having the same issue btw, trying to follow the instructions in the readme file to get the device ID leads to a different page than the one intended - might be a part of the change spotify implemented - Spotify developer console |
If there isn't an actively playing device or an open session to Spotify, then
|
The response from the Spotify app on the cast device does not contain the My guess it is an upstream change in how the Spotify app behaves on the cast device, as it used to provide the As it is beyond my understanding, I am not sure, why the |
From what I was able to research from that link some users back then were successful by setting the spotify device ID in the data field of the spotcast call. Unfortunately I was not able to get that to work with my setup. |
I have played with this a little bit between Crota's End raid attempts. Hard cod8ng the DeviceID has not worked from what I can tell. I am going to try to grab the traffic that is sent when Spotify themselves opens a session on the cast device. Maybe we can use the same call somehow is pychromecast of r spotcast |
Nope. I'm blind. |
I am not sure what to make of this. It seems that the Google Home Mini is sending out periodic MDNS packets which contain the device ID for google cast. The issue is, the PTR records in these packets are .local so I dont believe they can be what the spotify system is using to init a session on the device. Sanitized packet for anyone else to look at attached. Maybe I dont fully understand how MDNS works yet. |
Hint with |
same for me |
I am still gathering more data but the biggest issue: I think the the traffic that reaches out to spotify's servers is encrypted with a key I dont have access to. I have tried snooping multiple spotify clients while switching the output to the google home speaker and all of them start with encrypted application data. I will need to reread the docs for spot dev to see if they mentioned a change. |
@TheMrDec, this issue has been resolved and everything is working again with the latest release of Spotcast, if you haven't updated yet! |
Well, grand. That is great news for everyone else. Mine on the other hand is still not functional. I will investigate and probably open a new issue since it is unrelated. Might have to do with my firewall being a royal pain though so who knows. |
Look at this issue, and the solution in the end. #398 Otherwise, have you updated the custom component to version 3.7.1? https://github.com/fondberg/spotcast/releases/tag/v3.7.1 And have you restarted since your Home Assistant? |
Yeah, I saw that. Evidently I missed something in the documentation.
Yes.
Yes. Like I said, this warrants further investigation from a different perspective. I was taking an overly technical approach to diag under the pretext that it wasnt working for anyone. Now that I am aware my issue is unique, I need to start over from the simpler steps. |
I've had the same issue for a couple of weeks now, but updating Spotcast from v3.7.0 to v3.7.1 hopefully solved the issue (at least it worked again just now)! :) |
I had the same issue today with version v3.7.1. One day it works, the next day it doesn't. It's quite frustrating. |
I updated to v3.7.1, but the problem remains. |
I have noticed that roughly every third day, my task errors out looking for the cast device at the wrong IP address. I have set my dnsmasq server to hold a reservation for my google home mini in hopes that this fixes the error. |
Frustratingly, I am seeing this error over and over again. The funny thing is - playing starts just completely fine for about 1 sec, and then it stops (probably due to this check/error): 2023-10-04 10:58:29.236 ERROR (MainThread) [homeassistant.components.script.start_music_t] Slaaptijd: Error executing script. Unexpected error for call_service at pos 2: Timeout when waiting for status response from Spotify app
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2056, in _execute_service
return await self._hass.async_add_executor_job(target, service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/spotcast/__init__.py", line 221, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/spotcast/spotcast_controller.py", line 301, in get_spotify_device_id
spotify_cast_device.start_spotify_controller(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 104, in start_spotify_controller
sp.launch_app()
File "/config/custom_components/spotcast/spotify_controller.py", line 110, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app
2023-10-04 10:58:29.251 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140663668132032] Timeout when waiting for status response from Spotify app
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 226, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2049, in _execute_service
return await target(service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 605, in _service_handler
response = await self._async_start_run(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 563, in _async_start_run
script_result = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/script/__init__.py", line 594, in _async_run
return await self.script.async_run(script_vars, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1578, in async_run
return await asyncio.shield(run.async_run())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 420, in async_run
await self._async_step(log_exceptions=False)
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 470, in _async_step
self._handle_exception(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 493, in _handle_exception
raise exception
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2012, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2056, in _execute_service
return await self._hass.async_add_executor_job(target, service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/spotcast/__init__.py", line 221, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/spotcast/spotcast_controller.py", line 301, in get_spotify_device_id
spotify_cast_device.start_spotify_controller(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 104, in start_spotify_controller
sp.launch_app()
File "/config/custom_components/spotcast/spotify_controller.py", line 110, in launch_app
raise LaunchError(
pychromecast.error.LaunchError: Timeout when waiting for status response from Spotify app |
Today it failed again
I got feedback that this 502 error is not related and potentially an API call failure (my error in some spotcast settings) |
I have the same error. I'm using a Wiim Pro, integrated as a chromecast device. The error arises only if I use the home assistant entity id, or the friendly name defined in hass. If I use the spotify device id (or the spotify friendly name), it works. So it seems that spotify doesn't want to stream the music directly to the device, and this is maybe because spotcast doesn't find the spotify device id and then it raises a timeout error (because spotify doesn't respond for whatever reason) I may also add, that before the device was not added to the spotify list (so I had to stream first from the spotify app to the device) playing spotify was not possible at all. But this is maybe the expected behavior and I just didn't know this requirement. |
I'm having the same issue. It's been working years and stopped working recently (not sure of the exact date). Tried re-installing integration but still no luck. UPDATE: Upgrade spotcast integration (HACS) and it started working again! |
Is there any update on where we stand with this issue? |
I started seeing the error again. I advanced my task trigger by 5 minutes and suddenly everything works perfectly fine. Moved it back to 0630 and it starts erroring out again. I do have one other task being called at 0630 but it's a zigbee call that shouldn't be taking anywhere near enough time to cause API calls to time out like this. |
You can increase the debug level of the component to see more messages in the log. But otherwise, it is a generic error. It means that it has not received an answer (expected answer) from the device on time. |
I'm using spotcast on my Sony Bravia Google TV and I've several time timeout issue. I changed increased the timeout value in spotify_controller.py row 78 from It seems to be working fine now. Maybe the code could be changed to make the timeout a user configurable parameter. |
After two weeks of testing it happened again. But it looks it helps. |
I added a PR for this to have it be configurable in the UI: #424 |
Device detect was improve significantly in the |
Is there any fix or workaround for this? I have the same problem |
@OtroYorch no work around, the old spotcast relies on the official spotify integration for device detection, which isn't super reliable. You can try to move to the beta if you want to test the new version |
Describe the bug
A clear and concise description of what the bug is.
Describe the bug
When calling the spotcast.start service and playing in my Google Nest Mini, I hear a chime but nothing happens.
Got this log:
This error originated from a custom integration.
Logger: homeassistant.core
Source: custom_components/spotcast/spotify_controller.py:102
Integration: Spotcast (documentation, issues)
Error executing service: <ServiceCall spotcast.start (c:xxx): uri=spotify:playlist:xxx, random_song=True, shuffle=True, entity_id=media_player.xxx, repeat=off, force_playback=False, offset=0, start_volume=101, ignore_fully_played=False>
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/core.py", line 1507, in catch_exceptions
await coro_or_task
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await self._hass.async_add_executor_job(handler.job.target, service_call)
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/spotcast/init.py", line 147, in start_casting
spotify_device_id = spotcast_controller.get_spotify_device_id(
File "/config/custom_components/spotcast/spotcast_controller.py", line 202, in get_spotify_device_id
spotify_cast_device.startSpotifyController(access_token, expires)
File "/config/custom_components/spotcast/spotcast_controller.py", line 84, in startSpotifyController
sp.launch_app()
File "/config/custom_components/spotcast/spotify_controller.py", line 102, in launch_app
raise LaunchError(
pychromecast.error.LaunchError:
This made my Google Nest Mini to change its status to Unknown until the same automation called the same service with a different playlist and it started playing.
This looks intermittent and I couldn't find a trigger to replicate the behaviour.
Environment (please complete the following information):
Configuration
Add your configuration
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: