Open tmh-alex opened 8 months ago
Looks like the entire player task died. We will need some sort of watchdog thingy for all of those long running tasks anyhow. I'll think about it. Same for the file player to make sure the sink is still running, the web server is still running etc...
I think the hyper logs are unrelated.
Ah, do you have logs before the ones you posted? Ideally from the start of the app until you saw the failure? Even the first play request in the logs you posted seems to have failed.
faulty_boot_session.txt I'm starting to like journalctl. It's even possible to get the logs for a particular boot session. Here're the complete logs for the drempelbox process, tell me if you need all the logs (including kernel messages perhaps?).
Awesome, thanks! Looks to me like the spotify player crashed somewhere inside librespot and took the bigger player thread down with it:
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.022170Z INFO drempelbox::server: Got URL request url="https://open.spotify.com/track/4abJbqX8C8CQTXHZxEbJZz?si=f04b62b8e85c4bf1"
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.022264Z INFO drempelbox::server: submitted URL request
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.022463Z INFO drempelbox::player: received URL player request log_url="https://open.spotify.com/track/4abJbqX8C8CQTXHZxEbJZz?si=f04b62b8e85c4bf1"
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.022507Z INFO drempelbox::player: playing spotify from url log_url="https://open.spotify.com/track/4abJbqX8C8CQTXHZxEbJZz?si=f04b62b8e85c4bf1"
Nov 10 23:39:57 toniblaster drempelbox[1365]: Playing...
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.022675Z DEBUG librespot_playback::player: command=Load(SpotifyId { id: 181874502310399482585459847615985601637, audio_type: Track }, true, 0)
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.028615Z DEBUG hyper::proto::h1::conn: read eof
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.051347Z DEBUG librespot_core::session: Invalidating session[0]
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.051520Z ERROR librespot_playback::player: Unable to load audio item: MercuryError
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.051954Z ERROR librespot_playback::player: Unable to load audio item: MercuryError
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052092Z WARN librespot_playback::player: Skipping to next track, unable to load track <SpotifyId { id: 181874502310399482585459847615985601637, audio_type: Track }>: ()
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052181Z DEBUG librespot_playback::player: drop PlayerInternal[0]
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052258Z INFO drempelbox::spotify_player: EndOfTrack!
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052461Z DEBUG librespot_core::session: drop Dispatch
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052622Z ERROR librespot_core::session: Connection reset by peer (os error 104)
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.059097Z DEBUG librespot_playback::player: PlayerInternal thread finished.
Nov 10 23:40:01 toniblaster drempelbox[1365]: 2023-11-10T22:40:01.002751Z INFO drempelbox::server: Got stop request
Nov 10 23:40:01 toniblaster drempelbox[1365]: 2023-11-10T22:40:01.002791Z INFO drempelbox::server: submitted stop request
Nov 10 23:40:01 toniblaster drempelbox[1365]: 2023-11-10T22:40:01.003253Z INFO drempelbox::player: received stop request
Nov 10 23:40:01 toniblaster drempelbox[1365]: 2023-11-10T22:40:01.003294Z INFO drempelbox::spotify_player: stopping spotify
Nov 10 23:40:01 toniblaster drempelbox[1365]: 2023-11-10T22:40:01.003329Z ERROR librespot_playback::player: Player Commands Error: channel closed
Might just have been a network glitch, this line points me to that idea:
Nov 10 23:39:57 toniblaster drempelbox[1365]: 2023-11-10T22:39:57.052622Z ERROR librespot_core::session: Connection reset by peer (os error 104)
We should probably be more resilient about underlying pieces crashing and restart them if necessary. If you have an idea to repro this easily, we could start working and testing a fix/improvement.
Looking at it more closely, our tasks where running just fine, but the librespot internal player died.
From playing with the service file I think i now know what happened here. When you saw this, we still had a broken service definition and the service started before all the dependencies where up, specifically the actually executing user service and the sound device. I have seen the exact same behavior when i was executing the service with the new drempelbox user, but hadn't adjusted the Required
and After
statements. So I'd like to park this as "probably fixed" for now. If it comes up again, we can revisit!
Got this spurious error:
Couldn't repeat it. The steps that came before this error as far as I can remember:
make track
make stop
make volume_up
a couple of times while player was stopped