[GH-ISSUE #1277] librespot unable to play songs #587

Closed
opened 2026-02-27 19:31:24 +03:00 by kerem · 3 comments
Owner

Originally created by @isolatedvirus on GitHub (Apr 23, 2024).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1277

Describe the bug
Failure to decrypt file for playback. No audio.

To reproduce
Steps to reproduce the behavior:

  1. Launch librespot
  2. Connect with mobile phone to librespot
  3. Attempt to play a song
  4. See error

Log
Unable to load encrypted file: Error { kind: Unavailable, error: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) } } }) }

Host (what you are running librespot on):

  • OS: Fedora 38
  • librespot being started via snapserver

Additional context
Connecting via android phone, using official spotify app. Some songs work, but appear to be songs that have been played before and are likely in the cache.

Originally created by @isolatedvirus on GitHub (Apr 23, 2024). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1277 **Describe the bug** Failure to decrypt file for playback. No audio. **To reproduce** Steps to reproduce the behavior: 1. Launch `librespot` 2. Connect with mobile phone to librespot 3. Attempt to play a song 4. See error **Log** Unable to load encrypted file: Error { kind: Unavailable, error: hyper::Error(Connect, Custom { kind: Other, error: Custom { kind: Other, error: Custom { kind: InvalidData, error: InvalidCertificate(UnknownIssuer) } } }) } **Host (what you are running `librespot` on):** - OS: Fedora 38 - librespot being started via snapserver **Additional context** Connecting via android phone, using official spotify app. Some songs work, but appear to be songs that have been played before and are likely in the cache.
kerem 2026-02-27 19:31:24 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@roderickvd commented on GitHub (Sep 16, 2024):

So it’s saying there’s something up with the cerificate. Do you know what that could be, is there indeed tampering, wrong certificates, anything like that?

<!-- gh-comment-id:2353543294 --> @roderickvd commented on GitHub (Sep 16, 2024): So it’s saying there’s something up with the cerificate. Do you know what that could be, is there indeed tampering, wrong certificates, anything like that?
Author
Owner

@SilverMira commented on GitHub (Nov 19, 2024):

Can this be reopened? It does reproduce even on 0.6.0 when running librespot on Android.

logcat looks something like this when trying to Session::connect

logcat
11-19 16:46:46.873 14890 14927 V rust_lib_frb_base::ap..: Connecting to librespot
11-19 16:46:46.873 14890 14927 D librespot_core::apres..: new ApResolver
11-19 16:46:46.873 14890 14927 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:46.874 14890 14927 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:46.874 14890 14927 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:46.874 14890 14927 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:47.499 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:47.779 14890 14930 W librespot_core::session: Instructed to try another access point...
11-19 16:46:47.780 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:47.780 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:47.780 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:47.780 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:48.057 14890 14914 D EGL_emulation: app_time_stats: avg=19.43ms min=1.18ms max=500.33ms count=38
11-19 16:46:48.406 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:48.674 14890 14930 W librespot_core::session: Instructed to try another access point...
11-19 16:46:48.674 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:48.674 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:48.674 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:48.674 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:49.059 14890 14914 D EGL_emulation: app_time_stats: avg=500.72ms min=500.23ms max=501.21ms count=2
11-19 16:46:49.214 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:49.479 14890 14930 W librespot_core::session: Instructed to try another access point...
11-19 16:46:49.479 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:49.480 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:49.480 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:49.480 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:49.914 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:50.011 14890 14930 W librespot_core::session: Instructed to try another access point...
11-19 16:46:50.011 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:50.011 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:50.011 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:50.011 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:50.555 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:50.557 14890 14914 D EGL_emulation: app_time_stats: avg=499.41ms min=498.30ms max=499.97ms count=3
11-19 16:46:50.823 14890 14930 W librespot_core::session: Instructed to try another access point...
11-19 16:46:50.823 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient
11-19 16:46:50.823 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks
11-19 16:46:50.823 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) }
11-19 16:46:50.824 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443"
11-19 16:46:51.416 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN
11-19 16:46:51.558 14890 14914 D EGL_emulation: app_time_stats: avg=500.38ms min=499.46ms max=501.31ms count=2
11-19 16:46:51.670 14890 14930 E librespot_core::session: Tried too many access points
11-19 16:46:51.670 14890 14930 E rust_lib_frb_base::ap..: Error connecting to librespot: Error { kind: PermissionDenied, error: LoginFailed(TryAnotherAP) }
11-19 16:46:51.671 14890 14930 D librespot_core::session: drop Session
11-19 16:46:51.671 14890 14930 D librespot_core::apres..: drop ApResolver

I'm suspecting we are hitting this issue, where rustls-native-certs doesn't actually support Android/IOS and instead recommends using rustls-platform-verifier instead.

Relevant rustls-native-certs usage here

I will try to put up a minimal repro repo sometime, currently my repro uses docker to cross compile apk since I couldn't actually get aws-lc-sys to compile from Windows

Edit: maybe I misunderstood this issue, it seems to be about using librespot on another desktop and connecting from the official android app, whereas the issue I'm facing is running librespot directly on Android for playback.

<!-- gh-comment-id:2486258156 --> @SilverMira commented on GitHub (Nov 19, 2024): Can this be reopened? It does reproduce even on 0.6.0 when running librespot on Android. logcat looks something like this when trying to Session::connect <details> <summary>logcat</summary> ```sh 11-19 16:46:46.873 14890 14927 V rust_lib_frb_base::ap..: Connecting to librespot 11-19 16:46:46.873 14890 14927 D librespot_core::apres..: new ApResolver 11-19 16:46:46.873 14890 14927 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:46.874 14890 14927 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:46.874 14890 14927 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:46.874 14890 14927 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:47.499 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:47.779 14890 14930 W librespot_core::session: Instructed to try another access point... 11-19 16:46:47.780 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:47.780 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:47.780 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:47.780 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:48.057 14890 14914 D EGL_emulation: app_time_stats: avg=19.43ms min=1.18ms max=500.33ms count=38 11-19 16:46:48.406 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:48.674 14890 14930 W librespot_core::session: Instructed to try another access point... 11-19 16:46:48.674 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:48.674 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:48.674 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:48.674 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:49.059 14890 14914 D EGL_emulation: app_time_stats: avg=500.72ms min=500.23ms max=501.21ms count=2 11-19 16:46:49.214 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:49.479 14890 14930 W librespot_core::session: Instructed to try another access point... 11-19 16:46:49.479 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:49.480 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:49.480 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:49.480 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:49.914 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:50.011 14890 14930 W librespot_core::session: Instructed to try another access point... 11-19 16:46:50.011 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:50.011 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:50.011 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:50.011 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:50.555 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:50.557 14890 14914 D EGL_emulation: app_time_stats: avg=499.41ms min=498.30ms max=499.97ms count=3 11-19 16:46:50.823 14890 14930 W librespot_core::session: Instructed to try another access point... 11-19 16:46:50.823 14890 14930 D librespot_core::http_..: Requesting https://apresolve.spotify.com/?type=accesspoint&type=dealer&type=spclient 11-19 16:46:50.823 14890 14930 W librespot_core::apres..: Failed to resolve all access points, using fallbacks 11-19 16:46:50.823 14890 14930 W librespot_core::apres..: Resolve access points error: Requested entity was not found { no native root CA certificates found (errors: []) } 11-19 16:46:50.824 14890 14930 I librespot_core::session: Connecting to AP "ap.spotify.com:443" 11-19 16:46:51.416 14890 14930 D librespot_core::conne..: Authenticating with AP using AUTHENTICATION_SPOTIFY_TOKEN 11-19 16:46:51.558 14890 14914 D EGL_emulation: app_time_stats: avg=500.38ms min=499.46ms max=501.31ms count=2 11-19 16:46:51.670 14890 14930 E librespot_core::session: Tried too many access points 11-19 16:46:51.670 14890 14930 E rust_lib_frb_base::ap..: Error connecting to librespot: Error { kind: PermissionDenied, error: LoginFailed(TryAnotherAP) } 11-19 16:46:51.671 14890 14930 D librespot_core::session: drop Session 11-19 16:46:51.671 14890 14930 D librespot_core::apres..: drop ApResolver ``` </details> I'm suspecting we are hitting [this issue](https://github.com/rustls/rustls-native-certs/issues/3), where rustls-native-certs doesn't actually support Android/IOS and instead recommends using `rustls-platform-verifier` instead. Relevant `rustls-native-certs` usage [here](https://github.com/librespot-org/librespot/blob/82076e882f3cdebec863a3c0aa79888ec47b3c76/core/src/http_client.rs#L148C1-L149C34) I will try to put up a minimal repro repo sometime, currently my repro uses docker to cross compile apk since I couldn't actually get aws-lc-sys to compile from Windows Edit: maybe I misunderstood this issue, it seems to be about using librespot on another desktop and connecting from the official android app, whereas the issue I'm facing is running librespot directly on Android for playback.
Author
Owner

@roderickvd commented on GitHub (Nov 19, 2024):

Yes, let's make it a separate issue.

<!-- gh-comment-id:2486394841 --> @roderickvd commented on GitHub (Nov 19, 2024): Yes, let's make it a separate 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/librespot#587
No description provided.