Skip to content

login5 returns 503 Service Unavailable after successful AP login; Connect cannot start (since 2026-09-29 13:47 UTC) #1771

Open

Description

@madenvel

Description

Since about 13:47 UTC on 2026-09-29, librespot can no longer start Spotify Connect for my Premium account (country GB). Every start ends like this:

  1. Login to the access point succeeds (Authenticated as '…' !).
  2. The next request, to https://login5.spotify.com/v3/login, is the last one logged.
  3. librespot fails with could not initialize spirc: Service unavailable { Response status code: 503 Service Unavailable } and exits.

An already-running librespot on another host lost its session at 13:47:18 UTC, and its automatic reconnect failed with the same error. Both devices had worked normally earlier that day.

What I've checked:

  • It reproduces with unpatched v0.8.0 (d36f9f1); the log below is from that build.
  • It fails the same way with stored credentials and with a fresh zeroconf pairing from the Spotify app, which gives new credentials and a different device name and device ID.
  • Two hosts on the same network fail identically.
  • The Spotify app on my phone, on the same account and network, plays normally. It also discovers the librespot device and hands over credentials.
  • It was still failing at 14:47 UTC, when the attached log was taken.
  • I haven't yet tried another account or another network.

It's a 503 rather than a 401 or 403, so it may be an outage or throttling rather than rejected credentials, but I can't tell from the client side.

Version

librespot 0.8.0 (d36f9f1), built with --no-default-features --features with-libmdns,rustls-tls-native-roots.

How to reproduce

  1. Pair librespot from the Spotify app, or reuse cached credentials.
  2. Launch librespot --name librespot-test --backend pipe --cache <dir> --disable-audio-cache --disable-discovery --verbose.
  3. librespot authenticates with the AP, then exits with the 503 error above.

Log

Full debug log from the unpatched build. I redacted the username, client token, pusher connection ID, cache path and the financial-product value, and changed nothing else.

librespot --verbose (unpatched v0.8.0)
[2026-09-29T14:47:38Z INFO  librespot] librespot 0.8.0 d36f9f1 (Built on 2026-09-29, Build ID: 9qlaILgl, Profile: release)
[2026-09-29T14:47:38Z TRACE librespot] Command line argument(s):
[2026-09-29T14:47:38Z TRACE librespot] 		name "librespot-test"
[2026-09-29T14:47:38Z TRACE librespot] 		backend "pipe"
[2026-09-29T14:47:38Z TRACE librespot] 		cache "<cache-dir>"
[2026-09-29T14:47:38Z TRACE librespot] 		disable-audio-cache
[2026-09-29T14:47:38Z TRACE librespot] 		disable-discovery
[2026-09-29T14:47:38Z TRACE librespot] 		verbose
[2026-09-29T14:47:38Z TRACE librespot] Using cached credentials.
[2026-09-29T14:47:38Z DEBUG librespot_core::session] new Session
[2026-09-29T14:47:38Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2026-09-29T14:47:38Z DEBUG librespot_connect::spirc] new Spirc[0]
[2026-09-29T14:47:38Z DEBUG librespot::component] new DealerManager
[2026-09-29T14:47:38Z DEBUG librespot_playback::player] new Player [0]
[2026-09-29T14:47:38Z DEBUG librespot::component] new SpClient
[2026-09-29T14:47:38Z DEBUG librespot_core::spclient] Client token unavailable or expired, requesting new token.
[2026-09-29T14:47:38Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2026-09-29T14:47:38Z INFO  librespot_playback::audio_backend::pipe] Using StdoutSink (pipe) with format: S16
[2026-09-29T14:47:38Z DEBUG librespot_core::http_client] Requesting https://clienttoken.spotify.com/v1/clienttoken
[2026-09-29T14:47:38Z DEBUG librespot_core::spclient] Received a granted token
[2026-09-29T14:47:38Z TRACE librespot_core::spclient] Got client token: GrantedTokenResponse { token: "<redacted>", 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 } } }
[2026-09-29T14:47:38Z DEBUG librespot::component] new ApResolver
[2026-09-29T14:47:38Z DEBUG librespot_core::http_client] Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
[2026-09-29T14:47:38Z INFO  librespot_core::session] Connecting to AP "ap-gew1.spotify.com:4070"
[2026-09-29T14:47:38Z DEBUG librespot_core::connection] Connection to AP established.
[2026-09-29T14:47:39Z DEBUG librespot_core::connection] Authenticating with AP using AUTHENTICATION_STORED_SPOTIFY_CREDENTIALS
[2026-09-29T14:47:39Z INFO  librespot_core::session] Authenticated as '<redacted-username>' !
[2026-09-29T14:47:39Z DEBUG librespot::component] new Login5Manager
[2026-09-29T14:47:39Z DEBUG librespot_core::http_client] Requesting https://login5.spotify.com/v3/login
[2026-09-29T14:47:39Z TRACE librespot_core::session] Received Ping
[2026-09-29T14:47:39Z TRACE librespot_core::session] keep-alive state: PendingPong, timeout in 60.0
[2026-09-29T14:47:39Z DEBUG librespot_core::session] Session strong=5 weak=6
[2026-09-29T14:47:39Z INFO  librespot_core::session] Country: "GB"
[2026-09-29T14:47:39Z TRACE librespot_core::session] Received product info: {
        "setup-headphones-changes": "0",
        "enable-annotations-read": "0",
        "ugc-abuse-report-url": "https://support.spotify.com/abuse/?uri={uri}",
        "type": "premium",
        "key-caching-max-count": "10000",
        "shows-collection-jam": "1",
        "name": "Spotify Premium",
        "audio-quality": "1",
        "prefetch-window-max": "2",
        "publish-playlist": "1",
        "storage-size-config": "10240,90,500,3",
        "sidebar-navigation-enabled": "0",
        "metadata-link-lookup-modes": "0",
        "ugc-abuse-report": "1",
        "capping-bar-threshold": "3601",
        "pick-and-shuffle": "0",
        "enable-crossfade": "1",
        "head-file-caching": "1",
        "is-standalone-audiobooks": "0",
        "jam-social-session": "EXPANDED",
        "on-demand": "1",
        "rating-access": "1",
        "social-session": "1",
        "streaming": "1",
        "mobile": "1",
        "collection": "1",
        "ab_recently_played_feature_time_filter_threshold": "com.spotify.gaia=30,driving-mode=120,spotify%3Ainternal%3Astartpage=30",
        "ad-formats-preroll-video": "0",
        "key-caching-max-offline-seconds": "1800",
        "remote-control": "6",
        "image-url": "https://i.scdn.co/image/{file_id}",
        "financial-product": "<redacted>",
        "ad-session-persistence": "1",
        "streaming-only-premium": "0",
        "shuffle-algorithm": "FRESH",
        "jam": "1",
        "shuffle": "0",
        "publish-activity": "0",
        "yl-kids-restricted-content": "0",
        "dma-mode-enabled": "0",
        "is-puffin": "0",
        "is_email_verified": "1",
        "on-demand-trial-in-progress": "0",
        "enable-annotations": "2",
        "filter-explicit-content": "0",
        "player-license": "premium",
        "dsa-mode-enabled": "0",
        "incognito_mode_timeout": "21600",
        "send-email": "0",
        "is-tuna": "0",
        "has-audiobooks-subscription": "1",
        "key-caching-auto-offline": "0",
        "unrestricted": "1",
        "is-cheetara": "0",
        "app-developer": "0",
        "ads": "0",
        "explicit-content": "1",
        "key-memory-cache-mode": "1:15,300",
        "preferred-locale": "en",
        "radio": "1",
        "ab-ad-player-targeting": "1",
        "shows-collection": "1",
        "prefetch-keys": "1",
        "payments-initial-campaign": "default",
        "video-cdn-sampling": "100",
        "social-session-free-tier": "0",
        "prefetch-strategy": "18",
        "obfuscate-restricted-tracks": "0",
        "on-demand-trial": "expired",
        "video-device-blacklisted": "0",
        "widevine-license-url": "https://spclient.wg.spotify.com/widevine-license/v1/video/license",
        "audiobook-onboarding-completed": "0",
        "catalogue": "premium",
        "ab-watch-now": "0",
        "apply-child-content-restrictions": "0",
        "is-pigeon": "0",
        "high-bitrate": "1",
        "loudness-levels": "1:-5.0,0.0,3.0:-2.0",
        "dma-mode-available": "1",
        "video-manifest-url": "https://spclient.wg.spotify.com/manifests/v6/{type}/sources/{source_id}/options/supports_drm",
        "nft-disabled": "1",
        "employee-free-opt-in": "0",
        "is-thalia": "1",
        "offline": "1",
        "restrict-playlist-collaboration": "0",
        "playlist-annotations-markup": "0",
        "audio-preview-url-template": "https://p.scdn.co/mp3-preview/{id}",
        "libspotify": "1",
        "payments-locked-state": "0",
        "arsenal_country": "1",
        "autoplay": "1",
        "dsa-mode-available": "0",
        "head-files-url": "https://heads-fa-tls13.spotifycdn.com/head/{file_id}",
    }
[2026-09-29T14:47:39Z DEBUG librespot::component] new MercuryManager
[2026-09-29T14:47:39Z TRACE librespot_core::mercury] mercury response <hm://pusher/v1/connections/<redacted>> is handled by dealer
[2026-09-29T14:47:39Z ERROR librespot] could not initialize spirc: Service unavailable { Response status code: 503 Service Unavailable }

Host (what you are running librespot on):

  • OS: Fedora Linux 44, x86_64 (unpatched build above). Also seen on Debian 13 arm64 (Raspberry Pi) with a v0.8.0 build that carries local patches; those patches don't touch core (session, AP or login5 code).
  • Platform: x86_64 desktop; Raspberry Pi

Additional context

Both hosts are on the same network, so they share a public IP. The account uses Spotify Premium in GB.

Activity

  1. joseafonsogvalente commented on Sep 29, 2026

    @joseafonsogvalente

    Also happening to me on two different devices

    I am using an older build though
    [2026-09-29T14:34:34Z INFO librespot] librespot 0.8.0 d36f9f19 (Built on 2025-11-12, Build ID: BYx5gwoK, Profile: release)

  2. NickTheWilder commented on Sep 29, 2026

    @NickTheWilder

    Might be related? Could be an upstream outage with Spotify.

    @SpotifyStatus: We’re aware of some issues right now and are checking them out!

    https://x.com/SpotifyStatus/status/2104940227190255889?s=20

  3. milancermak commented on Sep 29, 2026

    @milancermak

    I also ran into the issue in a pet project I have. I asked Astra to fix it. If it's helpful to anyone, here's the TL;DR version its local fix:

    Before the fix, Tops had two authentication paths:

    • Browsing/search: used that OAuth token directly.
    • Playback: librespot connected using a saved playback credential, then asked Login5 for another access token. That second exchange returned 503, so playback setup failed—even though Tops’ original OAuth token was still valid.
      After the fix, the playback library uses the same OAuth token as browsing. We tested that Spotify accepts it for the native playback services, so the extra Login5 exchange is no longer needed.
      The token still expires normally. Tops renews it using your saved refresh token, with browsing and playback sharing the updated result.
  4. madenvel commented on Sep 29, 2026

    @madenvel
    Author

    Update, 2026-09-29 15:39–15:52 UTC

    Still reproducible with unpatched v0.8.0 at 15:39 UTC: could not initialize spirc: Service unavailable { Response status code: 503 Service Unavailable } right after a successful AP login.

    I tried the approach from the comment above. --enable-oauth on its own doesn't avoid login5:

    • Spirc::new pre-fetches session.login5().auth_token() (connect/src/spirc.rs:227).
    • The dealer and spclient use that same token (core/src/dealer/manager.rs:87, core/src/spclient.rs:494).
    • Login5Manager::auth_token() always exchanges the session's stored credential at login5 (core/src/login5.rs:185-191), however the session originally signed in.

    Experiment: unpatched v0.8.0 plus the diff below, which seeds Login5Manager's token cache with the access token from --enable-oauth. It doesn't refresh the token; it's a diagnostic only. Run with --enable-oauth --disable-discovery --backend pipe --device /dev/null.

    Result, sign-in at 15:46:58 UTC:

    • AP login succeeded, and no login5 request was made.
    • The dealer started, and PUT /connect-state/v1/devices/<id> succeeded. librespot logged active device is <> with session <…> from the returned cluster.
    • The dealer websocket stayed healthy (ping/pong every 30 s), with no errors until the run ended at 15:52 UTC.
    • The device did not appear in the Spotify app on my phone, although the phone app itself plays normally on the same account.

    So while login5 was returning 503, Spotify accepted the OAuth token for the dealer and connect-state, but that alone didn't make the device visible in the app. I can't tell whether that's another effect of the incident or something the OAuth token path lacks.

    Experiment diff (against d36f9f1)
    diff --git a/core/src/login5.rs b/core/src/login5.rs
    index 9cf7133..72c9868 100644
    --- a/core/src/login5.rs
    +++ b/core/src/login5.rs
    @@ -258,6 +258,13 @@ impl Login5Manager {
             Ok(())
         }
     
    +    /// Experiment: serve an externally obtained (OAuth) access token instead
    +    /// of exchanging the stored credential at login5 until it expires.
    +    pub fn set_auth_token(&self, access_token: String, expires_in: i32) {
    +        let token = Self::token_from_login(access_token, expires_in);
    +        self.lock(|inner| inner.auth_token = Some(token));
    +    }
    +
         fn token_from_login(token: String, expires_in: i32) -> Token {
             Token {
                 access_token: token,
    diff --git a/src/main.rs b/src/main.rs
    index fb85803..f6e5eb8 100644
    --- a/src/main.rs
    +++ b/src/main.rs
    @@ -1965,6 +1965,14 @@ async fn main() {
                 error!("Failed to get Spotify access token: {e}");
                 exit(1);
             });
    +        let expires_in = oauth_token
    +            .expires_at
    +            .saturating_duration_since(std::time::Instant::now())
    +            .as_secs() as i32;
    +        warn!("Experiment: using the OAuth token for Connect instead of login5 ({expires_in} s)");
    +        session
    +            .login5()
    +            .set_auth_token(oauth_token.access_token.clone(), expires_in);
             last_credentials = Some(Credentials::with_access_token(oauth_token.access_token));
             connecting = true;
         } else if discovery.is_none() {
  5. blackketter commented on Sep 29, 2026

    @blackketter

    My existing install of raspotify with librespot just started working. Also, restarting snapserver using librespot brought it back online.

  6. joseafonsogvalente commented on Sep 29, 2026

    @joseafonsogvalente

    crmne/spotifast#621 (comment)

    My devices are also working now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions