[GH-ISSUE #1001] transfer_playback throws 500 error #596

Closed
opened 2026-02-27 23:23:33 +03:00 by kerem · 5 comments
Owner

Originally created by @chatziko on GitHub (Jul 11, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1001

Describe the bug

For some days now, transfer_playback returns a 500 error every single time. Most likely a server issue, but I'm wondering, is it happening to anyone else?

Your code

client = spotipy.Spotify(auth_manager=spotipy.oauth2.SpotifyOAuth(
	scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri, cache_handler=cache_handler
), retries=0)
client.transfer_playback(device_id, False)

Output

Max Retries reached
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 836, in urlopen
    retries = retries.increment(method, url, response=response, _pool=self)
  File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/me/player (Caused by ResponseError('too many 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 266, in _internal_call
    response = self._session.request(
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 544, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 657, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 507, in send
    raise RetryError(e, request=request)
requests.exceptions.RetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/me/player (Caused by ResponseError('too many 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/a.py", line 31, in <module>
    client.transfer_playback(device_id, False)
  File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 1780, in transfer_playback
    return self._put("me/player", payload=data)
  File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 338, in _put
    return self._internal_call("PUT", url, payload, kwargs)
  File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 307, in _internal_call
    raise SpotifyException(
spotipy.exceptions.SpotifyException: http status: 429, code:-1 - /v1/me/player:
 Max Retries, reason: too many 500 error responses

Environment:

  • OS: linux
  • Python version 3.10.6
  • spotipy version 2.23
Originally created by @chatziko on GitHub (Jul 11, 2023). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1001 **Describe the bug** For some days now, `transfer_playback` returns a 500 error every single time. Most likely a server issue, but I'm wondering, is it happening to anyone else? **Your code** ``` client = spotipy.Spotify(auth_manager=spotipy.oauth2.SpotifyOAuth( scope=scope, client_id=client_id, client_secret=client_secret, redirect_uri=redirect_uri, cache_handler=cache_handler ), retries=0) client.transfer_playback(device_id, False) ``` **Output** ``` Max Retries reached Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send resp = conn.urlopen( File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 836, in urlopen retries = retries.increment(method, url, response=response, _pool=self) File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 574, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/me/player (Caused by ResponseError('too many 500 error responses')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 266, in _internal_call response = self._session.request( File "/usr/lib/python3/dist-packages/requests/sessions.py", line 544, in request resp = self.send(prep, **send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 657, in send r = adapter.send(request, **kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 507, in send raise RetryError(e, request=request) requests.exceptions.RetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/me/player (Caused by ResponseError('too many 500 error responses')) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/a.py", line 31, in <module> client.transfer_playback(device_id, False) File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 1780, in transfer_playback return self._put("me/player", payload=data) File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 338, in _put return self._internal_call("PUT", url, payload, kwargs) File "/usr/local/lib/python3.10/dist-packages/spotipy/client.py", line 307, in _internal_call raise SpotifyException( spotipy.exceptions.SpotifyException: http status: 429, code:-1 - /v1/me/player: Max Retries, reason: too many 500 error responses ``` **Environment:** - OS: linux - Python version 3.10.6 - spotipy version 2.23
kerem 2026-02-27 23:23:33 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@stephanebruckert commented on GitHub (Jul 9, 2024):

Are you still getting this?

<!-- gh-comment-id:2218367561 --> @stephanebruckert commented on GitHub (Jul 9, 2024): Are you still getting this?
Author
Owner

@chatziko commented on GitHub (Jul 10, 2024):

I haven't tried in a while, to be honest. Feel free to close this if nobody else is affected.

<!-- gh-comment-id:2219950260 --> @chatziko commented on GitHub (Jul 10, 2024): I haven't tried in a while, to be honest. Feel free to close this if nobody else is affected.
Author
Owner

@dieser-niko commented on GitHub (Jul 10, 2024):

This issue reminds me of #1093. Would be a coincidence, but do you have a lot of saved tracks?

<!-- gh-comment-id:2220189975 --> @dieser-niko commented on GitHub (Jul 10, 2024): This issue reminds me of #1093. Would be a coincidence, but do you have a lot of saved tracks?
Author
Owner

@chatziko commented on GitHub (Jul 10, 2024):

Just 9. Seems more like a temporary server issue to me, but I've changed my setup so it's hard to reproduce it now.

<!-- gh-comment-id:2220476337 --> @chatziko commented on GitHub (Jul 10, 2024): Just 9. Seems more like a temporary server issue to me, but I've changed my setup so it's hard to reproduce it now.
Author
Owner

@dieser-niko commented on GitHub (Jul 31, 2024):

I'm going to close the issue, but if you (or anyone else) gets this error again, please reopen the issue.

<!-- gh-comment-id:2260231882 --> @dieser-niko commented on GitHub (Jul 31, 2024): I'm going to close the issue, but if you (or anyone else) gets this error again, please reopen the issue.
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#596
No description provided.