Announcements

500 Internal Server Error

500 Internal Server Error

Plus18

When I send post-request /playlists/{playlist_id}/tracks via Google Apps Script Platform, occurs 500 or 502 errors with description: something went wrong or bad gateway.

 

My application works correct in 2 years and dont changes in this part. But last month or more these errors occurs very often.

 

Do you know about this? When it will be fix?

 

 

Reply
8 Replies

MartaPaniti

I am getting the same error. And other time with same API request it's works fine.

 

 

clswall

I'm having this exact problem. Code was executing perfectly, and then recently when adding tracks at a particular position Spotify is throwing 500 and 502 errors about half of the time. So frustrating. Any workarounds or solutions anybody has found?

djboulia

Same scenario... I had a working application for 2 years, suddenly started getting 502 (and occasionally 500) errors in the app when trying to reorder tracks.  Node application using spotify-web-api module.

djboulia

For what it's worth, I added some of the ugliest retry code to keep this from failing.  It works, but it's ugly.  Some call fail 2-3 times before a successful result.  I have relatively large playlists and I'd estimate 10-20% of the API calls fail with either 502 or 500.  Less often I can also get an error just listing the tracks on the playlist.  This seems like a big deal... does anyone from @Spotify actually look at this forum?  

clswall

I tried this as well, but it just kept failing on the same call, no matter how many times I retried or changed positions. (I'm trying to add a track to a playlist.) And no, I don't think anyone from Spotify looks at this forum. I'm frustrated because this code worked perfectly for months. How did you execute your retry code?

djboulia

I am re-ordering tracks in a playlist rather than adding tracks.  But I have also seen failures just trying to get the track list.  The failures are always intermittent for me... the calls work sometimes, but not all of the time.  The retry code is pretty basic... if a call fails, I start retrying a maximum of 10 times, backing off a slightly bigger interval each time.  I have no idea if waiting makes a difference.  One of my early theories was that I was hitting some sort of rate limit, so I thought waiting a bit more before each retry would help.  In practice, I've seen a call fail about 4 times max, so the 10 retries seems to be more than enough.

djboulia

One more post on this.  I don't know why, but it seems to make a difference where the app making the Spotify API calls is deployed.  When I tested this on my home network (ATT Fiber on US East coast, for what that's worth) I see all of the symptoms above (502 and 500 errors).  When I deployed to an Amazon EC2 instance, I also saw these same errors.  However, last night I deployed to Azure App Engine and I see NO errors.  Not a single failed called even after re-ordering almost a thousand tracks.

clswall

I managed to make this work with a looping retry in the catch block, running while there is still an error. Sometimes things work on the first try, sometimes after 10 or more tries. Nothing is consistent, but things are functioning properly now. But, what gives Spotify?? These 500/502 etc errors are relatively new, and cropping up very inconsistently. 

Suggested posts

Env: prod