[GH-ISSUE #353] SpotifyException: http status: 500 #206

Closed
opened 2026-02-27 23:21:22 +03:00 by kerem · 2 comments
Owner

Originally created by @cbaudouinjr on GitHub (Feb 12, 2019).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/353

Hey there,

My program cycles through and adds a random song to my playlist every couple minutes or so. After a few songs I seem to be getting a 500 from Spotify. Below is my error:

Traceback (most recent call last):
File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 119, in _internal_call
r.raise_for_status()
File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.spotify.com/v1/users/chrisbaudouinjr/playlists/48U3GHZBTjhPeoDSRQojjF/tracks

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner
self.run()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "/Users/{user}/Documents/GitHub/spotiserver/app.py", line 290, in playlist_manager
sp.user_playlist_add_tracks(username, playlist, [track_to_add['id']])
File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 457, in user_playlist_add_tracks
payload=ftracks, position=position)
File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 178, in _post
return self._internal_call('POST', url, payload, kwargs)
File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 124, in _internal_call
headers=r.headers)
spotipy.client.SpotifyException: http status: 500, code:-1 - https://api.spotify.com/v1/users/{user}/playlists/48U3GHZBTjhPeoDSRQojjF/tracks:
Server error.

Originally created by @cbaudouinjr on GitHub (Feb 12, 2019). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/353 Hey there, My program cycles through and adds a random song to my playlist every couple minutes or so. After a few songs I seem to be getting a 500 from Spotify. Below is my error: > Traceback (most recent call last): > File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 119, in _internal_call > r.raise_for_status() > File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/requests/models.py", line 940, in raise_for_status > raise HTTPError(http_error_msg, response=self) > requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: https://api.spotify.com/v1/users/chrisbaudouinjr/playlists/48U3GHZBTjhPeoDSRQojjF/tracks During handling of the above exception, another exception occurred: > Traceback (most recent call last): > File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 917, in _bootstrap_inner > self.run() > File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 865, in run > self._target(*self._args, **self._kwargs) > File "/Users/{user}/Documents/GitHub/spotiserver/app.py", line 290, in playlist_manager > sp.user_playlist_add_tracks(username, playlist, [track_to_add['id']]) > File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 457, in user_playlist_add_tracks > payload=ftracks, position=position) > File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 178, in _post > return self._internal_call('POST', url, payload, kwargs) > File "/Users/{user}/Documents/GitHub/spotiserver/venv/lib/python3.7/site-packages/spotipy/client.py", line 124, in _internal_call > headers=r.headers) > spotipy.client.SpotifyException: http status: 500, code:-1 - https://api.spotify.com/v1/users/{user}/playlists/48U3GHZBTjhPeoDSRQojjF/tracks: > Server error.
kerem closed this issue 2026-02-27 23:21:23 +03:00
Author
Owner

@stephanebruckert commented on GitHub (Jan 1, 2020):

Hi @cbaudouinjr, do you still have this issue?

Can you confirm that you are passing a valid track_id track_to_add['id'] just before you get a 500?

Please also try to provide more code so we can check if the logic is correct.

<!-- gh-comment-id:570086666 --> @stephanebruckert commented on GitHub (Jan 1, 2020): Hi @cbaudouinjr, do you still have this issue? Can you confirm that you are passing a valid track_id `track_to_add['id']` just before you get a 500? Please also try to provide more code so we can check if the logic is correct.
Author
Owner

@stephanebruckert commented on GitHub (Jan 11, 2020):

Closing due to issue being inactive and 500 status code being internal errors that depend on the web API directly https://github.com/spotify/web-api/

<!-- gh-comment-id:573345156 --> @stephanebruckert commented on GitHub (Jan 11, 2020): Closing due to issue being inactive and 500 status code being internal errors that depend on the web API directly https://github.com/spotify/web-api/
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#206
No description provided.