-
-
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
I get these errors every day and often during the day #388
Comments
@mfabiani53, the weird thing is 502 is a server side error. That should mean that Spotify experiencing issues, but that wouldn't make sense if you are the only one with the problem. Are you using any unconventional networking gear like personal DNS (pihole, adguard) are using any network wide VPN? |
Not at all... no unconventional networking, neither VPN.
I changed in sensor.py file the limit of the playlists to 40 and the language to 'it'. Could this be in some way the cause of the error? |
Technically you are not at fault based on the error code (anything >=500 is server side error), but Spotify could be giving bad error codes or you could be triggering an edge case they didn't expect.
That would have been a very good information to have from the start. Can you provide me your modified version of the sensor.py file. Also I would need your configuration for spotcast. If you hardcoded your sp_dc and sp_key, first anonymise then and please use !secret. |
This is modified version of sensor.py:
And this my config about spotcast:
Please note that i changed the locale only now as before it was set to 'en' while the limit was also changed many days ago... I still do not restart HA to see if the changing of the locale will affect this error. |
I tested on my end and the new limit doesn't affect the calls. As predicted, the limit Spotify has is 50 and when you go over the error is 403 I dug a liitle deeper and saw this in your log:
I was too focused on the 504 and missed the 429 error. Now that is a very different story. 429 is a Can you look at your integration dashboard on the developpper portal and provide a screen capture of your total request charts, here's an example: I want to see if you have an abnormally high endpoint being used. Normally /v1/me/player should be the main endpoint used. Also make sure that your monthly active user makes sense. You said you are not using multiple account, so there should only be one. |
All API have rate limits they don't want a script kitty who thiks he's a hacker send a bunch a distributed queries and clog the API endpoint fro 4chans points. You can read more on the rate limit here, but with the number of queries you have I doubt that you have a generally busy api query rate. You seems to have more of a burst problem, basically you have rolling 30 sec. of number of queries and if your rolling sum of queries go over the limit you get a 429 error. Before we get stuck in a circle for no reason. Could you revert the changes you made in the |
Ok, i'll let you know... |
I switched back to the default values, but this morning i got the same errors as before:
|
FYI after some hours of default sensor.py worked, the errors are not anymore in the log. So, i think, the errors lie in the modified sensor.py. |
Ok good to k kw. I wanted to give you an update but had a crazy week at work. I did some documentation reading and the playlists API is on a different rate limit than the rest of the api. The problem is they don't say what it is. I have a feeling it is based on the number of playlist fetched and not calls. Would explain the problem with your 429 error. This is still a guess at the moment. |
Ok i'll stay tuned.... |
I also experience them a lot since a few weeks. When they come up spotcast is not working for a few hours. |
The problem seems to be specific to some regions. I did some research online and some developpers are stuck with always receiving 502 errors while others don't. Can you verify from your side if this endpoint works in the developper console? |
|
Every day i get these errors in the log:
Make sure to validate all the elements before submitting the ticket (Exception to the steps marked as optional)
sp_dc
andsp_key
values and restarted Home Assistant (see README)Environment
The text was updated successfully, but these errors were encountered: