Announcements

Help Wizard

Step 1

NEXT STEP

Bad Gateway error but not constantly

Bad Gateway error but not constantly

Hi there,

 

We are using the Spotify API for publishing & updating playlists and we noticed sometimes we get the "Bad Gateway" error. 
What is weird is it doesn't happen constantly. Even for the same request sent multiple times, sometimes works just fine but other times throws this error.

Can you please help with this?

Reply
2 Replies

Andrew - I was having a very similar issue. For me, the problem was that when I was traversing through a list of items, near the end of it, the Next link that Spotify returned was actually invalid because it was trying to reference items that were beyond the end of the list (e.g. offset 80 and limit 50 when the total list length was 100). When I called that link, I would get a 502 error. I was able to fix it by manually generating the Next link to have the right values for offset and limit relative to the total. Hope this helps for you!

Suggested posts