[GH-ISSUE #519] Lots of failing songs - "Error from channel for data receiver" #328

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

Originally created by @Malvineous on GitHub (Aug 15, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/519

Is anyone else experiencing a lot of problems playing files within the last couple of days? I am getting a lot of errors like this:

ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3677412 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3794352 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3827120 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3876272 (+16384).
ERROR librespot_core::channel] channel error: 2 0
WARN  librespot_audio::fetch] Error from channel for data receiver for range 3843504 (+16384).

Sometimes it keeps going and the song plays fine, sometimes it just skips that track, other times it just stops playback completely and I have to find where it's up to and press play on the following track.

Is it just me or is anyone else seeing this as well?

It only seems to affect certain songs, as many of them play fine, but you get one or two that won't play no matter what you do, with the above errors coming up all the time.

Originally created by @Malvineous on GitHub (Aug 15, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/519 Is anyone else experiencing a lot of problems playing files within the last couple of days? I am getting a lot of errors like this: ``` ERROR librespot_core::channel] channel error: 2 0 WARN librespot_audio::fetch] Error from channel for data receiver for range 3677412 (+16384). ERROR librespot_core::channel] channel error: 2 0 WARN librespot_audio::fetch] Error from channel for data receiver for range 3794352 (+16384). ERROR librespot_core::channel] channel error: 2 0 WARN librespot_audio::fetch] Error from channel for data receiver for range 3827120 (+16384). ERROR librespot_core::channel] channel error: 2 0 WARN librespot_audio::fetch] Error from channel for data receiver for range 3876272 (+16384). ERROR librespot_core::channel] channel error: 2 0 WARN librespot_audio::fetch] Error from channel for data receiver for range 3843504 (+16384). ``` Sometimes it keeps going and the song plays fine, sometimes it just skips that track, other times it just stops playback completely and I have to find where it's up to and press play on the following track. Is it just me or is anyone else seeing this as well? It only seems to affect certain songs, as many of them play fine, but you get one or two that won't play no matter what you do, with the above errors coming up all the time.
kerem closed this issue 2026-02-27 19:30:03 +03:00
Author
Owner

@Malvineous commented on GitHub (Aug 15, 2020):

Seems to be very random - here's a playlist of songs I haven't been able to play in the last day: https://open.spotify.com/playlist/22NyzfaVl8fxWY1c97IlUP

I contacted Spotify support who gave me some test credentials and I see the same issue on the same songs with the test creds.

<!-- gh-comment-id:674377159 --> @Malvineous commented on GitHub (Aug 15, 2020): Seems to be very random - here's a playlist of songs I haven't been able to play in the last day: https://open.spotify.com/playlist/22NyzfaVl8fxWY1c97IlUP I contacted Spotify support who gave me some test credentials and I see the same issue on the same songs with the test creds.
Author
Owner

@devgianlu commented on GitHub (Aug 15, 2020):

Seems to be very random - here's a playlist of songs I haven't been able to play in the last day: https://open.spotify.com/playlist/22NyzfaVl8fxWY1c97IlUP

They all play fine on librespot-java.

<!-- gh-comment-id:674379546 --> @devgianlu commented on GitHub (Aug 15, 2020): >Seems to be very random - here's a playlist of songs I haven't been able to play in the last day: https://open.spotify.com/playlist/22NyzfaVl8fxWY1c97IlUP They all play fine on librespot-java.
Author
Owner

@Malvineous commented on GitHub (Aug 15, 2020):

How strange. Are you playing the songs all the way through? They will usually start ok but the data stops coming in at some point in the middle of the song. They all play fine right through in the web player though.

I'm also getting other errors if I try to re-play the broken tracks, these come up at the start of the song and prevent any playback at all:

ERROR librespot_core::channel] channel error: 2 0
ERROR librespot_playback::player] Unable to load encrypted file.

However retrying a few times eventually allows playback to start, but it still usually gets cut off at some point in the middle.

<!-- gh-comment-id:674385854 --> @Malvineous commented on GitHub (Aug 15, 2020): How strange. Are you playing the songs all the way through? They will usually start ok but the data stops coming in at some point in the middle of the song. They all play fine right through in the web player though. I'm also getting other errors if I try to re-play the broken tracks, these come up at the start of the song and prevent any playback at all: ``` ERROR librespot_core::channel] channel error: 2 0 ERROR librespot_playback::player] Unable to load encrypted file. ``` However retrying a few times eventually allows playback to start, but it still usually gets cut off at some point in the middle.
Author
Owner

@devgianlu commented on GitHub (Aug 15, 2020):

librespot-java doesn't use channels anymore to retrieve tracks, therefore the issue cannot appear. Maybe Spotify is slowly dismissing this API.

<!-- gh-comment-id:674393897 --> @devgianlu commented on GitHub (Aug 15, 2020): librespot-java doesn't use channels anymore to retrieve tracks, therefore the issue cannot appear. Maybe Spotify is slowly dismissing this API.
Author
Owner

@andrewfedun commented on GitHub (Aug 16, 2020):

wanted to add that I've been facing the same issue as @Malvineous on most songs throughout the past few days. Is switching over the librespot-java the best fix?

<!-- gh-comment-id:674536254 --> @andrewfedun commented on GitHub (Aug 16, 2020): wanted to add that I've been facing the same issue as @Malvineous on most songs throughout the past few days. Is switching over the librespot-java the best fix?
Author
Owner

@inickt commented on GitHub (Aug 16, 2020):

I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc. I am experiencing both this and #510 which is a bummer. Please let me know if there are any other debugging steps I can help with!

<!-- gh-comment-id:674560708 --> @inickt commented on GitHub (Aug 16, 2020): I gave `librespot-java` a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc. I am experiencing both this and #510 which is a bummer. Please let me know if there are any other debugging steps I can help with!
Author
Owner

@devgianlu commented on GitHub (Aug 16, 2020):

I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc.

Yeah, the new protocol is much more complex and requires a lot of dumping to get it right. The JVM doesn't help either on lower end systems where resources are limited and everything is slowed down. I've just planned a rewrite of some of its parts (for that matters): https://github.com/librespot-org/librespot-java/issues/249

Please let me know if there are any other debugging steps I can help with!

I don't think there's anything more to debug. The channel system exists since librespot was born and it's getting old as I've started implementing CDN on 16/03/2019 and it probably was there even before. My thought is that they are slowly shutting it down.

The CDN loading system is quite simple and it'll take someone who knows Rust no more that 3 days. Sadly, I don't know it, but I can help anybody who wants to implement it.

<!-- gh-comment-id:674564875 --> @devgianlu commented on GitHub (Aug 16, 2020): > I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc. Yeah, the new protocol is much more complex and requires a lot of dumping to get it right. The JVM doesn't help either on lower end systems where resources are limited and everything is slowed down. I've just planned a rewrite of some of its parts (for that matters): https://github.com/librespot-org/librespot-java/issues/249 > Please let me know if there are any other debugging steps I can help with! I don't think there's anything more to debug. The channel system exists since librespot was born and it's getting old as I've started implementing CDN on 16/03/2019 and it probably was there even before. My thought is that they are slowly shutting it down. The CDN loading system is quite simple and it'll take someone who knows Rust no more that 3 days. Sadly, I don't know it, but I can help anybody who wants to implement it.
Author
Owner

@andrewfedun commented on GitHub (Aug 16, 2020):

@inickt I know this is a really dumb question but I was hoping you could help me - what was your installation process for librespot-java? I was struggling to find instructions on the librespot-java page. Thanks!

<!-- gh-comment-id:674568573 --> @andrewfedun commented on GitHub (Aug 16, 2020): @inickt I know this is a really dumb question but I was hoping you could help me - what was your installation process for librespot-java? I was struggling to find instructions on the [librespot-java](https://github.com/librespot-org/librespot-java) page. Thanks!
Author
Owner

@devgianlu commented on GitHub (Aug 16, 2020):

@andrewfedun Have a look here.

<!-- gh-comment-id:674569143 --> @devgianlu commented on GitHub (Aug 16, 2020): @andrewfedun Have a look [here](https://github.com/librespot-org/librespot-java/tree/dev/player).
Author
Owner

@andrewfedun commented on GitHub (Aug 16, 2020):

@devgianlu Thanks that's super helpful! And thanks for building librespot in general, it's a really great project

<!-- gh-comment-id:674571170 --> @andrewfedun commented on GitHub (Aug 16, 2020): @devgianlu Thanks that's super helpful! And thanks for building librespot in general, it's a really great project
Author
Owner

@pentlander commented on GitHub (Aug 18, 2020):

I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc.

Yeah, the new protocol is much more complex and requires a lot of dumping to get it right. The JVM doesn't help either on lower end systems where resources are limited and everything is slowed down. I've just planned a rewrite of some of its parts (for that matters): librespot-org/librespot-java#249

Please let me know if there are any other debugging steps I can help with!

I don't think there's anything more to debug. The channel system exists since librespot was born and it's getting old as I've started implementing CDN on 16/03/2019 and it probably was there even before. My thought is that they are slowly shutting it down.

The CDN loading system is quite simple and it'll take someone who knows Rust no more that 3 days. Sadly, I don't know it, but I can help anybody who wants to implement it.

Could you point to the code in librespot-java that handles this new protocol? I might be interested in taking a look.

<!-- gh-comment-id:675186648 --> @pentlander commented on GitHub (Aug 18, 2020): > > I gave librespot-java a test and while it works I found it to be way slower/buggier for picking songs/skipping/shuffle/etc. > > Yeah, the new protocol is much more complex and requires a lot of dumping to get it right. The JVM doesn't help either on lower end systems where resources are limited and everything is slowed down. I've just planned a rewrite of some of its parts (for that matters): [librespot-org/librespot-java#249](https://github.com/librespot-org/librespot-java/issues/249) > > > Please let me know if there are any other debugging steps I can help with! > > I don't think there's anything more to debug. The channel system exists since librespot was born and it's getting old as I've started implementing CDN on 16/03/2019 and it probably was there even before. My thought is that they are slowly shutting it down. > > The CDN loading system is quite simple and it'll take someone who knows Rust no more that 3 days. Sadly, I don't know it, but I can help anybody who wants to implement it. Could you point to the code in librespot-java that handles this new protocol? I might be interested in taking a look.
Author
Owner

@devgianlu commented on GitHub (Aug 18, 2020):

@pentlander When I say "new protocol" I refer to a different thing that then CDN loading. Anyway, here's the CDN loading (and its PR) and here's the new protocol stuff (and its PR).

<!-- gh-comment-id:675302832 --> @devgianlu commented on GitHub (Aug 18, 2020): @pentlander When I say "new protocol" I refer to a different thing that then CDN loading. Anyway, [here](https://github.com/librespot-org/librespot-java/blob/dev/lib/src/main/java/xyz/gianlu/librespot/audio/cdn/CdnManager.java)'s the CDN loading (and its [PR](https://github.com/librespot-org/librespot-java/pull/57)) and [here](https://github.com/librespot-org/librespot-java/tree/dev/lib/src/main/java/xyz/gianlu/librespot/dealer)'s the new protocol stuff (and its [PR](https://github.com/librespot-org/librespot-java/pull/105)).
Author
Owner

@kaymes commented on GitHub (Aug 18, 2020):

@devgianlu I just had a quick look at the CDN code. Am I understanding the logic correctly?:

  1. You make a request to https://spclient.wg.spotify.com/storage-resolve/files/audio/interactive/TRACK_ID.
    The request requires some authorisation token. It seems to come from Mercury and is called "playlist-read".
  2. The above request returns a protobuf which contains a URL
  3. You can download the encrypted file from this URL with normal http features as you like (i.e. whole file or range requests are possible)

Regarding the token in step 1:
We have a currently unused function get_token(session, client_id, scopes) in keymaster.rs. I would guess that the scope argument is the "playlist-read" from the Java code. We've got a mercury session no problem. But I can't see where the client_id would have to come from.

<!-- gh-comment-id:675320367 --> @kaymes commented on GitHub (Aug 18, 2020): @devgianlu I just had a quick look at the CDN code. Am I understanding the logic correctly?: 1) You make a request to https://spclient.wg.spotify.com/storage-resolve/files/audio/interactive/TRACK_ID. The request requires some authorisation token. It seems to come from Mercury and is called "playlist-read". 2) The above request returns a protobuf which contains a URL 3) You can download the encrypted file from this URL with normal http features as you like (i.e. whole file or range requests are possible) Regarding the token in step 1: We have a currently unused function get_token(session, client_id, scopes) in keymaster.rs. I would guess that the scope argument is the "playlist-read" from the Java code. We've got a mercury session no problem. But I can't see where the client_id would have to come from.
Author
Owner

@devgianlu commented on GitHub (Aug 18, 2020):

You make a request to https://spclient.wg.spotify.com/storage-resolve/files/audio/interactive/TRACK_ID.

It's the file ID of the AudioFile with the format you want.

But I can't see where the client_id would have to come from.

client_id is hardcoded into every Spotify client and corresponds to 65b708073fc0480ea92a077233ca87bd. playlist-read is also the only scope that is used in the entire client.

Implementation note:
If you play a track longer than an hour the URL will expire mid-track and you'll need to get a new one.

<!-- gh-comment-id:675322549 --> @devgianlu commented on GitHub (Aug 18, 2020): > You make a request to https://spclient.wg.spotify.com/storage-resolve/files/audio/interactive/TRACK_ID. It's the file ID of the `AudioFile` with the format you want. > But I can't see where the client_id would have to come from. `client_id` is hardcoded into every Spotify client and corresponds to `65b708073fc0480ea92a077233ca87bd`. `playlist-read` is also the only scope that is used in the entire client. Implementation note: If you play a track longer than an hour the URL will expire mid-track and you'll need to get a new one.
Author
Owner

@Malvineous commented on GitHub (Aug 21, 2020):

I don't want to speak too soon but this afternoon I noticed Spotify have fixed the bug that prevented songs from being removed when you delete them from a playlist (via the website), and at the same time I have noticed that I am no longer getting these channel errors and all the songs that used to give me errors are now playing correctly again.

I hope this means they have just deployed an update that fixed the issue!

<!-- gh-comment-id:678092129 --> @Malvineous commented on GitHub (Aug 21, 2020): I don't want to speak too soon but this afternoon I noticed Spotify have fixed the bug that prevented songs from being removed when you delete them from a playlist (via the website), and at the same time I have noticed that I am no longer getting these channel errors and all the songs that used to give me errors are now playing correctly again. I hope this means they have just deployed an update that fixed the issue!
Author
Owner

@inickt commented on GitHub (Aug 22, 2020):

@Malvineous Looked good so far. I probably had 5-6 hours of playback last night without issues, with before I was having problems at least every 15-30 minutes.

<!-- gh-comment-id:678640440 --> @inickt commented on GitHub (Aug 22, 2020): @Malvineous Looked good so far. I probably had 5-6 hours of playback last night without issues, with before I was having problems at least every 15-30 minutes.
Author
Owner

@Malvineous commented on GitHub (Aug 22, 2020):

Thanks for confirming. I've also not seen the error come back again so I'm going to close this issue as "fixed upstream by Spotify".

<!-- gh-comment-id:678640906 --> @Malvineous commented on GitHub (Aug 22, 2020): Thanks for confirming. I've also not seen the error come back again so I'm going to close this issue as "fixed upstream by Spotify".
Author
Owner

@Semmu commented on GitHub (Jun 8, 2021):

FYI this issue started happening to me again since a couple of hours. If it is indeed an issue from Spotify's side, I guess there is not much we can do.

<!-- gh-comment-id:856769645 --> @Semmu commented on GitHub (Jun 8, 2021): FYI this issue started happening to me again since a couple of hours. If it is indeed an issue from Spotify's side, I guess there is not much we can do.
Author
Owner

@Malvineous commented on GitHub (Jun 9, 2021):

At least this time they were aware of it pretty quickly and wrote about it on their status page: https://twitter.com/spotifystatus

It's been working fine again for me for many hours now.

<!-- gh-comment-id:857592058 --> @Malvineous commented on GitHub (Jun 9, 2021): At least this time they were aware of it pretty quickly and wrote about it on their status page: https://twitter.com/spotifystatus It's been working fine again for me for many hours now.
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#328
No description provided.