mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1566] librespot Invalid state { the provided context has no tracks } #710
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#710
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pjchamberlain on GitHub (Sep 3, 2025).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1566
Description
librespot starts OK but when trying to connect to it from another device, the connection fails and librespot reports the error message:
librespot[2292]: [2025-09-03T12:54:43Z ERROR librespot_connect::spirc] failed to handle request: Invalid state { the provided context has no tracks }
Version
librespot 0.6.0-dev
ba3d501(Built on 2025-08-11, Build ID: tEs7vh4i, Profile: release)How to reproduce
Steps to reproduce the behavior in librespot
librespoteither from the the command line or automatically on boot, no errors at this pointLog
Host (what you are running
librespoton):Additional context
I am seeing the same error on a Mycroft Mark 2 running NeonOS which includes librespot
@kingosticks commented on GitHub (Sep 3, 2025):
Can you reproduce on the latest version i.e. v0.7.1?
@pjchamberlain commented on GitHub (Sep 3, 2025):
Thanks for the reply.
I'm finding this a bit of a rabbit hole of trying to get v0.7.1 built and working on my RPi 5.
@pjchamberlain commented on GitHub (Sep 3, 2025):
UPDATED - same issue with the latest version v0.7.1
@photovoltex commented on GitHub (Sep 4, 2025):
Can you workaround that state by playing something first and switching to librespot afterwards?
@pjchamberlain commented on GitHub (Sep 4, 2025):
No, that's what I'm doing - playing something in my Android app or desktop Spotify and then trying to connect to my RPi 5 and if I look at the latest log I see the error
Sep 04 16:12:34 raspberrypi librespot[912]: [2025-09-04T15:12:34Z ERROR librespot_connect::spirc] failed to handle request: Invalid state { the provided context has no tracks }it's followed by a read out of a message that is empty (as in above log)
@photovoltex commented on GitHub (Sep 4, 2025):
Oh, interesting but that's already a good clue we can follow. I will try to reproduce it with that information.
@photovoltex commented on GitHub (Sep 4, 2025):
Hmm, that seems to just work with a playlist and a single album. Could you give use more information on what your context on the android phone is when you try to transfer to librespot? By context I mean something like "playlist", "liked songs", "autoplay", "recommendation" or something similar.
@pjchamberlain commented on GitHub (Sep 5, 2025):
There's been a slight change - the raspotify logs look the same but what I see in the Android app now is "connecting" but it never connects and reverts to the current device. (Previously it was showing connected but trying to play anything resulted in the play button going back to pause/stop after a second or so.)
The context is a playlist.
My Mycroft MK2 with an RPi 4 is behaving the same.
I can connect successfully to and play music on a Chromecast and a WiiM on my same network.
I'm sure it's a coincidence but I had an email last night from Spotify about updated terms of service.
@Krutsch commented on GitHub (Sep 5, 2025):
Ohh had this issue yesterday too and thought I was messing up with my CamillaDSP setting too much. Also Pi5 and a playlist
@pjchamberlain commented on GitHub (Sep 6, 2025):
I tried with a podcast to see if it made any difference - looks like the same issue
@photovoltex commented on GitHub (Sep 7, 2025):
So @pjchamberlain you have this issue constantly and can't use librespot at all because of that, right? And @Krutsch you only had it for a short period or does it still persist?
@pjchamberlain commented on GitHub (Sep 8, 2025):
That's right. The Pi5 appears in the list of available devices to connect to, but connecting fails after a few seconds and the logs show the same issue - empty context followed by some variation depending on what was playing.
(I see the same issue on my Pi4 inside a Mycroft 2 running NeonAI. Spotify web player works fine on the Pi5, so that's my workaround)
@bai-yi-bai commented on GitHub (Sep 8, 2025):
I am now also receiving this message, but I have additional debug information which might help.
I am using snapcast to stream to multiple devices and was using the librespot 6.1 dev branch.
However, I noticed the day before yesterday that tracks were only playing until about 50% of the way through, with a
(AsioStream) No data since 130 ms, switching to idlebefore advancing to the next track. It would error out with aSymphonia Decoder Error. I built from 7.1 to see if that would help, but now no audio comes through at all.h3. Sep 07 - Behavior: Playback stops at ~50%, skips to the next track
Sep 08 - No playback at all
@photovoltex commented on GitHub (Sep 9, 2025):
@bai-yi-bai I think you are encountering a different issue. The issue here seems to fully prevent playback currently, so if you do not find any similar issue, please open a new issue for your problem.
@photovoltex commented on GitHub (Sep 9, 2025):
@pjchamberlain can you give https://github.com/photovoltex/librespot/tree/fix/harden-transfer-flow a shot? I had to simulate my transfer state because I didn't ran into your issue, but I hope this should solve the issue. I also fixed another behavior where the play/pause button was disabled on transfer, that should also behave better now :D.
@HirbodBehnam commented on GitHub (Sep 13, 2025):
@photovoltex Just a heads up that your fix, fixed my issue! Thank you very much.
@photovoltex commented on GitHub (Sep 13, 2025):
Thanks for the info! That's what I wanted to hear. Then I can create a PR for it :)
@mattrigg9 commented on GitHub (Sep 24, 2025):
Confirming this also fixed the issue for me too, thanks!