librespot icon indicating copy to clipboard operation
librespot copied to clipboard

Getting status code 500s since Ads API sunset

Open YutongGu opened this issue 1 year ago • 79 comments

Description

Starting yesterday (Aug 5th) librespot stopped allowing tracks to be played. Devices still could connect to the librespot instance but playing any tracks would cause the player to rotate through songs, never actually playing anything. Logs show the following error message:

[2025-08-06T16:43:01Z INFO librespot_core::spclient] Resolved "gew1-spclient.spotify.com:443" as spclient access point [2025-08-06T16:43:02Z INFO librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point [2025-08-06T16:43:03Z INFO librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point [2025-08-06T16:43:03Z ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) }

This also seems to correspond with the sunsetting of the Spotify's V2 Ads API: https://developer.spotify.com/documentation/ads-api.

Version

Dev branch: be37402

How to reproduce

Steps to reproduce the behavior in librespot e.g.

  1. Launch librespot in release mode with no additional parameters except "--name"
  2. Connect with Spotify Connect on iPhone Spotify app (Have not tested on android)
  3. In the client, select a playlist and play from the playlist
  4. Then, scroll to bottom and select a song from the "Recommended Songs" section
  5. Selected song does not play

Log

[2025-08-06T17:16:21Z INFO  librespot] librespot 0.6.0-dev be37402 (Built on 2025-08-06, Build ID: tJ5Uubmn, Profile: release)
[2025-08-06T17:16:21Z TRACE librespot] Command line argument(s):
[2025-08-06T17:16:21Z TRACE librespot] 		v
[2025-08-06T17:16:21Z TRACE librespot] 		name "test"
[2025-08-06T17:16:21Z DEBUG librespot_core::session] new Session
[2025-08-06T17:16:21Z DEBUG librespot_discovery::server] Zeroconf server listening on 0.0.0.0:36803
[2025-08-06T17:16:21Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2025-08-06T17:16:21Z DEBUG librespot_playback::player] new Player [0]
[2025-08-06T17:16:21Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2025-08-06T17:16:21Z INFO  librespot_playback::audio_backend::rodio] Using Rodio sink with format S16 and cpal host: ALSA
[2025-08-06T17:16:21Z INFO  librespot_playback::audio_backend::rodio] Using audio device: default
[2025-08-06T17:16:21Z DEBUG librespot_playback::audio_backend::rodio] Rodio sink was created
[2025-08-06T17:16:27Z DEBUG librespot_discovery::server] POST "/" {}
[2025-08-06T17:16:27Z DEBUG librespot_core::session] Shutdown: Invalidating session
[2025-08-06T17:16:27Z DEBUG librespot::component] new MercuryManager
[2025-08-06T17:16:27Z DEBUG librespot::component] new ChannelManager
[2025-08-06T17:16:27Z DEBUG librespot_core::session] new Session
[2025-08-06T17:16:27Z DEBUG librespot_connect::spirc] new Spirc[0]
[2025-08-06T17:16:27Z DEBUG librespot_playback::player] command=SetSession
[2025-08-06T17:16:27Z DEBUG librespot_core::session] drop Session
[2025-08-06T17:16:27Z DEBUG librespot::component] drop ChannelManager
[2025-08-06T17:16:27Z DEBUG librespot::component] drop MercuryManager
[2025-08-06T17:16:27Z DEBUG librespot::component] new DealerManager
[2025-08-06T17:16:27Z DEBUG librespot::component] new SpClient
[2025-08-06T17:16:27Z DEBUG librespot_core::spclient] Client token unavailable or expired, requesting new token.
[2025-08-06T17:16:27Z DEBUG librespot_core::http_client] Requesting https://clienttoken.spotify.com/v1/clienttoken
[2025-08-06T17:16:27Z DEBUG librespot_core::spclient] Received a granted token
[2025-08-06T17:16:27Z TRACE librespot_core::spclient] Got client token: GrantedTokenResponse { token: "AADhjKnrrmw0g92Ln4jWcpUBz+kl1q0cZPOTVGGIMf0GN8PTYART58Ob4kE51TlcV67vvkApoNXONr6dvJfpzd6qLzQOv6BH3d44CsRHF90MyTWWO87VeHSzUw/x/zmyxYrzRah6SH6ZAQ4a165nD+Omf8YZnYP1XbDak2rGmR2S67Q8ABxPuJeQaROkNZt91Cuuz8wxHUVhAkMvR9JNzs0R8fp3dLY9eMlsch5bn1jMFqfsDP19rfgJZ4IceYmRrgExASx9xY24ttz5cqDy90hv9zDuN4seTPEOOoiduXy0F56FF7BW/rEd2YBpB1nLk1RHeOxWjcM=", expires_after_seconds: 1216800, refresh_after_seconds: 1209600, domains: [TokenDomain { domain: "spotify.com", special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }, TokenDomain { domain: "spotify.net", special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }], special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
[2025-08-06T17:16:27Z DEBUG librespot::component] new ApResolver
[2025-08-06T17:16:27Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2025-08-06T17:16:27Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
[2025-08-06T17:16:28Z DEBUG librespot_core::connection] Connection to "ap-guc3.spotify.com:4070" failed: Connection refused (os error 111)
[2025-08-06T17:16:28Z DEBUG librespot_core::connection] Retry access point...
[2025-08-06T17:16:28Z DEBUG librespot_core::connection] Connection to AP established.
[2025-08-06T17:16:28Z DEBUG librespot_core::connection] Authenticating with AP using AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS
[2025-08-06T17:16:28Z INFO  librespot_core::session] Authenticated as '1219828745' !
[2025-08-06T17:16:28Z DEBUG librespot::component] new Login5Manager
[2025-08-06T17:16:28Z DEBUG librespot_core::http_client] Requesting https://login5.spotify.com/v3/login
[2025-08-06T17:16:28Z TRACE librespot_core::session] Received Ping
[2025-08-06T17:16:28Z TRACE librespot_core::session] keep-alive state: PendingPong, timeout in 60.0
[2025-08-06T17:16:28Z DEBUG librespot_core::session] Session strong=5 weak=6
[2025-08-06T17:16:28Z INFO  librespot_core::session] Country: "US"
[2025-08-06T17:16:28Z TRACE librespot_core::session] Received product info: {...}
[2025-08-06T17:16:28Z DEBUG librespot::component] new MercuryManager
[2025-08-06T17:16:28Z TRACE librespot_core::mercury] mercury response <hm://pusher/v1/connections/YTk0YThmZTVjY2IxOWJhNjFjNGMwODczZDM5MWU5ODc5ODJmYmJkMytBUCt0Y3A6Ly8wYWIxNDhlOS5pcC5ndWMzLnNwb3RpZnkubmV0OjUwMjcrN0U2QjE2MTkzNThCODU2NzNCM0Y0MzIwNjc4QjhBQzFCMURGRkU4MUM2N0UxRDU5OEFDMEY5QzE2OEZGMzQxRA%3D%3D> is handled by dealer
[2025-08-06T17:16:28Z TRACE librespot_core::login5] Got auth token: Token { access_token: "BQB2o7tVgByewM5xiLfZODhlDdOodOX12vMgp1PZlDZldrilB2QqOHqoUKjmfm9ykj8i9vPZaYuvi73EWwerAA2pQ7588JAiuit5fiNHX-myb5IqaQiQBid4ZKyAvGW05ikb7Bs4dwg--1B4iLpPqbeWU8Ots-6nMntnfPi-gmxqwzYQ2OIcs2CCICTy6p8HTIWIDdzKNZlKi7IDokhcHN6iMtDQMSFMyzWvZW62M4gq5UxX_gG_cck3I-b5Fht9vFEZFgtXbJKd0S-OKp0kosIw1rgAcCiRHOkvAiz7RnAT_R562Lhw7mbSg7uLu0MuWBekzHrLK5It3mApNa5nud6YVlFUTNJeegpybUOF9-KY64GPEBbct4qepb2ZITLiY5J0OYIy3RaQxw", expires_in: 3600s, token_type: "Bearer", scopes: [], timestamp: Instant { tv_sec: 749357, tv_nsec: 102916569 } }
[2025-08-06T17:16:28Z DEBUG librespot_connect::spirc] SpircTask::set_volume(0)
[2025-08-06T17:16:28Z DEBUG librespot_playback::player] command=AddEventSender
[2025-08-06T17:16:28Z DEBUG librespot_core::dealer::manager] Launching dealer
[2025-08-06T17:16:28Z TRACE librespot_connect::spirc] Received connection ID update: "MzI2ZTNmZWEtMDE0OS00ZDY5LTg5MTMtYTMyYjJmYWQ2ZTY0K2RlYWxlcit0Y3A6Ly8wYWIxNDhkMy5pcC5ndWMzLnNwb3RpZnkubmV0OjU3MDArREJGMzFCNjBGMTFEOEYxNjYyRjEyMEU4MDY0RkJBMDkwRUZENjJBQzY4NDQ4MkIyRTJEOTYyMDA5ODNEMEJGNw=="
[2025-08-06T17:16:28Z INFO  librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:28Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=402916273
[2025-08-06T17:16:28Z TRACE librespot_core::dealer] Sent ping
[2025-08-06T17:16:29Z TRACE librespot_core::dealer] Received pong
[2025-08-06T17:16:29Z DEBUG librespot_connect::spirc] successfully put connect state for a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 with connection-id MzI2ZTNmZWEtMDE0OS00ZDY5LTg5MTMtYTMyYjJmYWQ2ZTY0K2RlYWxlcit0Y3A6Ly8wYWIxNDhkMy5pcC5ndWMzLnNwb3RpZnkubmV0OjU3MDArREJGMzFCNjBGMTFEOEYxNjYyRjEyMEU4MDY0RkJBMDkwRUZENjJBQzY4NDQ4MkIyRTJEOTYyMDA5ODNEMEJGNw==
[2025-08-06T17:16:29Z INFO  librespot_connect::spirc] active device is <> with session <2OYm1jZc6ckmcLXZGjWmQG>
[2025-08-06T17:16:29Z TRACE librespot_core::dealer] dealer request hm://connect-state/v1/player/command
[2025-08-06T17:16:29Z TRACE librespot_core::dealer::protocol] message was sent with gzip encoding 
[2025-08-06T17:16:29Z TRACE librespot_core::dealer::protocol] websocket request: Object {...}
[2025-08-06T17:16:29Z DEBUG librespot_connect::spirc] handling: 'endpoint: transfer' from 76d8b73a7d83cbe17bbf6da2f5c4d5fa9334660e
[2025-08-06T17:16:29Z WARN  librespot_connect::state::context] couldn't load context info because: context is not available. type: Default
[2025-08-06T17:16:29Z DEBUG librespot_connect::spirc] found initial track <spotify:track:7dWCYXkZMWnCKIcxmEC8Rc>
[2025-08-06T17:16:29Z TRACE librespot_connect::context_resolver] added spotify:user:1219828745:collection to resolver queue
[2025-08-06T17:16:29Z DEBUG librespot_connect::context_resolver] update for resolve_uri: <Some("spotify:user:1219828745:collection")>, context_uri: <spotify:user:1219828745:collection>, update: <Default> is already added
[2025-08-06T17:16:29Z TRACE librespot_connect::state::transfer] shuffle_seed: <Some("stable:619768a1")> (spotify), <None> (own)
[2025-08-06T17:16:29Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:29Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:29Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:7dWCYXkZMWnCKIcxmEC8Rc"), false, 0)
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=3087464660
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=2912894540
[2025-08-06T17:16:29Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=1171717386
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/context-resolve/v1/spotify:user:1219828745:collection
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/context-resolve/v1/spotify:user:1219828745:collection
[2025-08-06T17:16:29Z TRACE librespot_connect::spirc] ==> LoadingPause
[2025-08-06T17:16:29Z DEBUG librespot_core::dealer::manager] replying to ws request: Success
[2025-08-06T17:16:29Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=4278651821
[2025-08-06T17:16:29Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=1744511082
[2025-08-06T17:16:29Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:29Z INFO  librespot_core::spclient] Resolved "gae2-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:29Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=2894824682
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/context-resolve/v1/spotify:user:1219828745:collection
[2025-08-06T17:16:30Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=1603512908
[2025-08-06T17:16:30Z DEBUG librespot_connect::spirc] handling next context Some("spotify:user:1219828745:collection")
[2025-08-06T17:16:30Z DEBUG librespot_connect::state::context] updated context Default to <Some("spotify:user:1219828745:collection")> (502 tracks)
[2025-08-06T17:16:30Z DEBUG librespot_connect::context_resolver] last item of type <Default>, finishing state setup
[2025-08-06T17:16:30Z DEBUG librespot_connect::state::transfer] active track is <spotify:track:7dWCYXkZMWnCKIcxmEC8Rc> with index Ok(146) in Default context, has 502 tracks
[2025-08-06T17:16:30Z DEBUG librespot_connect::state::transfer] setting up next and prev: index is at Some(146) while shuffle true
[2025-08-06T17:16:30Z DEBUG librespot_connect::state::tracks] set track to: spotify:track:7dWCYXkZMWnCKIcxmEC8Rc at 146 of 502 tracks
[2025-08-06T17:16:30Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:30Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=4095084933
[2025-08-06T17:16:30Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=2899168007
[2025-08-06T17:16:30Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:30Z INFO  librespot_core::spclient] Resolved "gue1-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gue1-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=4039170469
[2025-08-06T17:16:30Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:30Z DEBUG librespot_core::http_client] Requesting https://gue1-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=2312688876
[2025-08-06T17:16:31Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:31Z DEBUG librespot_core::http_client] Requesting https://gue1-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=3781198736
[2025-08-06T17:16:31Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:31Z INFO  librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:31Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/ed63725a623c43f9b321d8821c274fd2?product=0&country=US&salt=1575241319
[2025-08-06T17:16:31Z ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) }
[2025-08-06T17:16:31Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:7dWCYXkZMWnCKIcxmEC8Rc")>: ()
[2025-08-06T17:16:31Z DEBUG librespot_connect::state::tracks] marking spotify:track:7dWCYXkZMWnCKIcxmEC8Rc as unavailable
[2025-08-06T17:16:31Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:31Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:31Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:31Z DEBUG librespot_playback::player] command=Preload(SpotifyId("spotify:track:4hR3E8w9JI1eTvH0vuVvun"))
[2025-08-06T17:16:31Z DEBUG librespot_playback::player] Preloading track
[2025-08-06T17:16:31Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:4hR3E8w9JI1eTvH0vuVvun"), false, 0)
[2025-08-06T17:16:31Z TRACE librespot_connect::spirc] ==> LoadingPause
[2025-08-06T17:16:31Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=758789378
[2025-08-06T17:16:31Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:31Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=742004312
[2025-08-06T17:16:31Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:31Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=3558800872
[2025-08-06T17:16:32Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=686760185
[2025-08-06T17:16:32Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2025-08-06T17:16:32Z INFO  librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=1279317125
[2025-08-06T17:16:32Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=964409184
[2025-08-06T17:16:32Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=2135893380
[2025-08-06T17:16:32Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:32Z INFO  librespot_core::spclient] Resolved "gae2-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:32Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=7894501
[2025-08-06T17:16:33Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:33Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=4080441059
[2025-08-06T17:16:33Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:33Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=1972310619
[2025-08-06T17:16:33Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:33Z INFO  librespot_core::spclient] Resolved "gew1-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:33Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/metadata/4/track/8ce3dc930191437d9875537e5f4a578f?product=0&country=US&salt=2732354491
[2025-08-06T17:16:33Z ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) }
[2025-08-06T17:16:33Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:4hR3E8w9JI1eTvH0vuVvun")>: ()
[2025-08-06T17:16:33Z DEBUG librespot_connect::state::tracks] marking spotify:track:4hR3E8w9JI1eTvH0vuVvun as unavailable
[2025-08-06T17:16:33Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:33Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:33Z DEBUG librespot_playback::player] command=Preload(SpotifyId("spotify:track:3P6zjYxB5sqnNGyd3QRBDz"))
[2025-08-06T17:16:33Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:33Z DEBUG librespot_playback::player] Preloading track
[2025-08-06T17:16:33Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:3P6zjYxB5sqnNGyd3QRBDz"), false, 0)
[2025-08-06T17:16:33Z TRACE librespot_connect::spirc] ==> LoadingPause
[2025-08-06T17:16:33Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/metadata/4/track/7da7756d55894e87b4531782a4da67a1?product=0&country=US&salt=607883474
[2025-08-06T17:16:34Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:34Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=2809328732
[2025-08-06T17:16:34Z TRACE librespot_metadata] Received metadata: Track {...}
[2025-08-06T17:16:34Z INFO  librespot_playback::player] Loading <Never Say Die> with Spotify URI <spotify:track:3R2jaCtqawdBv6mZ2Ym7Ty>
[2025-08-06T17:16:34Z WARN  librespot_playback::player] <Never Say Die> is not available in any supported format
[2025-08-06T17:16:34Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:3P6zjYxB5sqnNGyd3QRBDz")>: ()
[2025-08-06T17:16:34Z DEBUG librespot_connect::state::tracks] marking spotify:track:3P6zjYxB5sqnNGyd3QRBDz as unavailable
[2025-08-06T17:16:34Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:34Z DEBUG librespot_connect::state::tracks] finished filling up next_tracks (80)
[2025-08-06T17:16:34Z DEBUG librespot_playback::player] command=Preload(SpotifyId("spotify:track:6tifCCTIVBLC2TmTquYG7G"))
[2025-08-06T17:16:34Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:34Z DEBUG librespot_playback::player] Preloading track
[2025-08-06T17:16:34Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:6tifCCTIVBLC2TmTquYG7G"), false, 0)
[2025-08-06T17:16:34Z TRACE librespot_connect::spirc] ==> LoadingPause
[2025-08-06T17:16:34Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=2294052662
[2025-08-06T17:16:34Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:34Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=717621256
[2025-08-06T17:16:34Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:34Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=1326129676
[2025-08-06T17:16:34Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:34Z DEBUG librespot_core::http_client] Requesting https://gew1-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=1182401983
[2025-08-06T17:16:35Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:35Z INFO  librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:35Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=22001533
[2025-08-06T17:16:35Z TRACE librespot_core::dealer::protocol] message was sent with gzip encoding 
[2025-08-06T17:16:35Z DEBUG librespot_connect::spirc] cluster update: Ok(UNKNOWN_CLUSTER_UPDATE_REASON) from 76d8b73a7d83cbe17bbf6da2f5c4d5fa9334660e, active device: a94a8fe5ccb19ba61c4c0873d391e987982fbbd3
[2025-08-06T17:16:35Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:35Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=1777322199
[2025-08-06T17:16:35Z DEBUG librespot_connect::state] updated connect play status playing: true, paused: true, buffering: true
[2025-08-06T17:16:35Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3?product=0&country=US&salt=1666413210
[2025-08-06T17:16:35Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:35Z DEBUG librespot_core::http_client] Requesting https://gew4-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=149578250
[2025-08-06T17:16:36Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2025-08-06T17:16:36Z INFO  librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=2761546402
[2025-08-06T17:16:36Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=3692260121
[2025-08-06T17:16:36Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://guc3-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=3791732134
[2025-08-06T17:16:36Z DEBUG librespot_core::spclient] Error was: Err(Error { kind: Unavailable, error: StatusCode(500) })
[2025-08-06T17:16:36Z INFO  librespot_core::spclient] Resolved "gae2-spclient.spotify.com:443" as spclient access point
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/metadata/4/track/d4aa698ffa0e4dafb35e4c2ee7359704?product=0&country=US&salt=3047355305
[2025-08-06T17:16:36Z TRACE librespot_core::dealer::protocol] message was sent with gzip encoding 
[2025-08-06T17:16:36Z ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) }
[2025-08-06T17:16:36Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:6tifCCTIVBLC2TmTquYG7G")>: ()
[2025-08-06T17:16:36Z DEBUG librespot_connect::spirc] cluster update: Ok(DEVICE_STATE_CHANGED) from 76d8b73a7d83cbe17bbf6da2f5c4d5fa9334660e, active device: 
[2025-08-06T17:16:36Z INFO  librespot_connect::spirc] device became inactive
[2025-08-06T17:16:36Z WARN  librespot_connect::state::context] couldn't load context info because: context is not available. type: Default
[2025-08-06T17:16:36Z DEBUG librespot_core::http_client] Requesting https://gae2-spclient.spotify.com:443/connect-state/v1/devices/a94a8fe5ccb19ba61c4c0873d391e987982fbbd3/inactive?notify=false&product=0&country=US&salt=2296889863
[2025-08-06T17:16:37Z DEBUG librespot_connect::state] reset_playback with active ctx <Default> fill_up ctx <Default>
[2025-08-06T17:16:37Z WARN  librespot_connect::spirc] failed filling up next_track during stopping: Invalid state { context is not available. type: Default }
[2025-08-06T17:16:37Z DEBUG librespot_playback::player] command=Stop
[2025-08-06T17:16:37Z DEBUG librespot_connect::state::tracks] marking spotify:track:6tifCCTIVBLC2TmTquYG7G as unavailable
[2025-08-06T17:16:37Z ERROR librespot_connect::spirc] could not dispatch player event: Invalid state { context is not available. type: Default }
[2025-08-06T17:16:37Z TRACE librespot_connect::spirc] ==> Stopped

Host (what you are running librespot on):

  • OS: Linux
  • Platform: Lenovo T14

Additional context

YutongGu avatar Aug 06 '25 17:08 YutongGu

Same, librespot returns ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) } on any song I try to play. It still worked about 6 hours ago.

roqueeee avatar Aug 06 '25 17:08 roqueeee

Have also had issues with raspotify, and thought it might have been OAuth issues based on the recent UK Age vertification waffle. but this confirms its not. 🫡

smoonlee avatar Aug 06 '25 17:08 smoonlee

Fairly sure we don't use the ads API directly but in the long-running history of Spotify deprecating things, they always (always) break something else along the way.

kingosticks avatar Aug 06 '25 17:08 kingosticks

Same here, 500 error and unable to load any songs. I thought at first that I had hit some kind of rate limit because it happened to coincide with me hitting the skip button a bunch of times. Was working fine a few hours ago.

lukeleheny avatar Aug 06 '25 18:08 lukeleheny

seems i have the same issue.

Mitschmaster avatar Aug 06 '25 18:08 Mitschmaster

librespot.core.ApiClient.StatusCodeException: 500 since yesterday

Aeiron2 avatar Aug 06 '25 18:08 Aeiron2

Also seeing this in the version bundled with Music Assistant (librespot 0.6.0-dev 7127672 (Built on 2025-02-24, Build ID: KpKsLXNx, Profile: release)), with two different errors:

More commonly

[2025-08-06T18:35:48Z INFO  librespot_core::spclient] Resolved "gew1-spclient.spotify.com:443" as spclient access point
[2025-08-06T18:35:49Z ERROR librespot_playback::player] Track should be available, but no alternatives found.
[2025-08-06T18:35:49Z WARN  librespot_playback::player] <spotify:track:AAAAAAAAaaaAAaaAAAAAAA> is not available
[2025-08-06T18:35:49Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:AAAAAAAAaaaAAaaAAAAAAA")>: ()

or more rarely

[2025-08-06T18:35:08Z INFO  librespot_core::spclient] Resolved "gew1-spclient.spotify.com:443" as spclient access point
[2025-08-06T18:35:09Z INFO  librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point
[2025-08-06T18:35:09Z INFO  librespot_core::spclient] Resolved "gue1-spclient.spotify.com:443" as spclient access point
[2025-08-06T18:35:10Z INFO  librespot_core::spclient] Resolved "gew4-spclient.spotify.com:443" as spclient access point
[2025-08-06T18:35:10Z ERROR librespot_playback::player] Unable to load audio item: Error { kind: Unavailable, error: StatusCode(500) }
[2025-08-06T18:35:10Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:AAAaaAAAaaaAAAaaaAAAaa")>: ()

dachucky avatar Aug 06 '25 18:08 dachucky

I wonder if this issue from the go-librespot library is the same as what we're experiencing here. If so, it looks like they've already addressed it in a PR.

EDIT: I just tried out their latest release from 2 hours ago and it seems to work well.

YutongGu avatar Aug 06 '25 19:08 YutongGu

I called it!! Spotify engineering never disappoints.

Yep, good spot, we need to port that fix.

kingosticks avatar Aug 06 '25 19:08 kingosticks

I did a quick patch to apply the fix from https://github.com/devgianlu/go-librespot/issues/189#issuecomment-3160813582. The diff is against the tag v0.6.0:

$ git log --format=%h -1
383a6f6

$ git diff
diff --git a/core/src/spclient.rs b/core/src/spclient.rs
index a23b52f..f12c735 100644
--- a/core/src/spclient.rs
+++ b/core/src/spclient.rs
@@ -396,7 +396,12 @@ impl SpClient {

             // Reconnection logic: retrieve the endpoint every iteration, so we can try
             // another access point when we are experiencing network issues (see below).
-            let mut url = self.base_url().await?;
+            let mut url = if endpoint.starts_with("/metadata") {
+                String::from("https://spclient.wg.spotify.com")
+            } else {
+                self.base_url().await?
+            };
+
             url.push_str(endpoint);

             let separator = match url.find('?') {

Songs can be played again, though there is a ContextError (which I'm not sure it started today):

[2025-08-06T19:45:25Z ERROR librespot_connect::spirc] ContextError:
Error { kind: InvalidArgument, error: StatusCode(400) }

ayosec avatar Aug 06 '25 19:08 ayosec

This worked for me too! I'm also getting the context errors though. Is that cause for any concern?

[2025-08-06T20:52:41Z INFO librespot_core::spclient] Resolved "guc3-spclient.spotify.com:443" as spclient access point [2025-08-06T20:52:41Z INFO librespot_connect::spirc] active device is <> with session <3mIg4FOj2Cq9oT33mygYn9> [2025-08-06T20:52:42Z WARN librespot_core::dealer] No subscriber for msg.uri: social-connect/v2/broadcast_status_update [2025-08-06T20:52:42Z INFO librespot_connect::spirc] session update: <Ok(NEW_SESSION)> for self, current session_id f2aabefedd15477884b669f06f5d80bf, new session_id b0c30ca6f80d8a74b392b7a7327eb286 [2025-08-06T20:52:42Z ERROR librespot_connect::spirc] could not parse session_update: Invalid state { Unknown enum variant name: WIFI_BROADCAST_CHANGED at 1:11 } [2025-08-06T20:52:42Z INFO librespot_playback::player] Loading with Spotify URI spotify:track:2jbBVcRxdJpNkgnmsat2gq [2025-08-06T20:52:42Z WARN librespot_core::cdn_url] Cannot parse CDN URL expiry timestamp 'verify=1754599962-t7jZk1QTGFjO0hw0QI%2FMZAcRxaiNeic9ikHyQWIrOqw%3D' from 'https://audio-cf.spotifycdn.com/audio/f099e22cb61d328ae93ead693240e08c6f2eda72?verify=1754599962-t7jZk1QTGFjO0hw0QI%2FMZAcRxaiNeic9ikHyQWIrOqw%3D' [2025-08-06T20:52:43Z INFO librespot_playback::player] (186407 ms) loaded

YutongGu avatar Aug 06 '25 20:08 YutongGu

Also tested it, but it only works partially. Some songs are played, some not. ERROR librespot_playback::player] Unable to load encrypted file: Error { kind: Unavailable, error: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" }) }) }

b-nobis avatar Aug 06 '25 21:08 b-nobis

Also tested it, but it only works partially. Some songs are played, some not. ERROR librespot_playback::player] Unable to load encrypted file: Error { kind: Unavailable, error: hyper_util::client::legacy::Error(Connect, Custom { kind: Other, error: ConnectError("dns error", Custom { kind: Uncategorized, error: "failed to lookup address information: Name or service not known" }) }) }

There are currently two known issues, this and Spotify providing bad CDN URLs. The fix at #1524 addresses the latter, ideally you'd want to apply the workaround here on top of #1524.

kingosticks avatar Aug 06 '25 21:08 kingosticks

With both fixes applied, it works like a charm now. Thank you.

b-nobis avatar Aug 06 '25 21:08 b-nobis

@ayosec can you open a PR?

Diegovsky avatar Aug 06 '25 23:08 Diegovsky

can you open a PR?

I can send a patch if https://github.com/librespot-org/librespot/issues/1527#issuecomment-3161397815 is the correct solution, though I don't know if the maintainers prefer a better approach (like adding another field to RequestOptions, instead of hard-coding the strings for the URL).

ayosec avatar Aug 07 '25 00:08 ayosec

I am a total noob - so I maybe posting in here wrongly. Sorry.

I have rebuilt from latest dev but am getting "ERROR librespot_playback::player] Track should be available, but no alternatives found."

It then skips to next track and repeats this error. I have authenticated etc.

audas avatar Aug 07 '25 06:08 audas

@audas Since the fix is not merged yet, the changes are not on dev yet. You are seeing the error message described in this issue.

keks avatar Aug 07 '25 07:08 keks

can you open a PR?

I can send a patch if https://github.com/librespot-org/librespot/issues/1527#issuecomment-3161397815 is the correct solution, though I don't know if the maintainers prefer a better approach (like adding another field to RequestOptions, instead of hard-coding the strings for the URL).

Looks good to me.

Though I'm on holiday, I can try and find some time to do a release together with @photovoltex.

roderickvd avatar Aug 07 '25 07:08 roderickvd

With both fixes applied, it works like a charm now. Thank you.

could I ask you how to apply those two fixes? my git knowledge amounts to using git pull, but I don't know how to merge a specific commit, if that makes sense at all ¯\(ツ)/¯

reinob avatar Aug 07 '25 09:08 reinob