librespot icon indicating copy to clipboard operation
librespot copied to clipboard

Starting dealer failed due to "Websocket couldn't be started"

Open isaacheine opened this issue 3 months ago • 2 comments

I'm encountering this issue within music assistant as well as from another device (raspberry pi 4) when running librespot as a cli command. I see the same issue running with and without sudo privelages.

[2025-09-05T21:33:35Z INFO  librespot] librespot 0.7.1 987dfa5 (Built on 2025-09-04, Build ID: juOBtsrQ, Profile: release)
[2025-09-05T21:33:35Z INFO  librespot_playback::mixer::softmixer] Mixing with softvol and volume control: Log(60.0)
[2025-09-05T21:33:35Z INFO  librespot_playback::convert] Converting with ditherer: tpdf
[2025-09-05T21:33:35Z INFO  librespot_playback::audio_backend::alsa] Using AlsaSink with format: S16
[2025-09-05T21:33:36Z INFO  librespot_discovery] Published zeroconf service
[2025-09-05T21:33:43Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
[2025-09-05T21:33:43Z INFO  librespot_core::session] Authenticated as '<removed>' !
[2025-09-05T21:33:43Z INFO  librespot_core::session] Country: "US"
[2025-09-05T21:33:43Z ERROR librespot_connect::spirc] starting dealer failed: Invalid state { Websocket couldn't be started because: Unknown error { Network is unreachable (os error 101) } }
[2025-09-05T21:33:43Z WARN  librespot] Spirc shut down unexpectedly
[2025-09-05T21:33:44Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
[2025-09-05T21:33:44Z INFO  librespot_core::session] Authenticated as '<removed>' !
[2025-09-05T21:33:44Z INFO  librespot_core::session] Country: "US"
[2025-09-05T21:33:45Z ERROR librespot_connect::spirc] starting dealer failed: Invalid state { Websocket couldn't be started because: Unknown error { Network is unreachable (os error 101) } }
[2025-09-05T21:33:45Z WARN  librespot] Spirc shut down unexpectedly
[2025-09-05T21:33:46Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
[2025-09-05T21:33:46Z INFO  librespot_core::session] Authenticated as '<removed>' !
[2025-09-05T21:33:46Z INFO  librespot_core::session] Country: "US"
[2025-09-05T21:33:47Z ERROR librespot_connect::spirc] starting dealer failed: Invalid state { Websocket couldn't be started because: Unknown error { Network is unreachable (os error 101) } }
[2025-09-05T21:33:47Z WARN  librespot] Spirc shut down unexpectedly
[2025-09-05T21:33:48Z INFO  librespot_core::session] Connecting to AP "ap-guc3.spotify.com:4070"
[2025-09-05T21:33:48Z INFO  librespot_core::session] Authenticated as '<removed>' !
[2025-09-05T21:33:48Z INFO  librespot_core::session] Country: "US"
^C[2025-09-05T21:33:49Z ERROR librespot_connect::spirc] starting dealer failed: Invalid state { Websocket couldn't be started because: Unknown error { Network is unreachable (os error 101) } }
[2025-09-05T21:33:49Z WARN  librespot] Spirc shut down unexpectedly

isaacheine avatar Sep 05 '25 21:09 isaacheine

I tried downgrading to V0.5 (before the switch to websockets and now see this error instead:

[2025-09-06T00:04:52Z ERROR librespot_connect::spirc] ContextError: Error { kind: InvalidArgument, error: StatusCode(400) }
[2025-09-06T00:04:52Z ERROR librespot_playback::player] Track should be available, but no alternatives found.
[2025-09-06T00:04:52Z WARN  librespot_playback::player] <spotify:track:0v9nExjadADF3VbZhoB8Ob> is not available
[2025-09-06T00:04:52Z ERROR librespot_playback::player] Skipping to next track, unable to load track <SpotifyId("spotify:track:0v9nExjadADF3VbZhoB8Ob")>: ()
[2025-09-06T00:04:52Z ERROR librespot_playback::player] Track should be available, but no alternatives found.
[2025-09-06T00:04:52Z WARN  librespot_playback::player] <spotify:track:7toMfkxwVQWeuHvXSXtMPt> is not available```

isaacheine avatar Sep 06 '25 00:09 isaacheine

What’s your network and firewall environment? I think this is a network configuration issue.

v0.5 did not complain about the dealer because it did not have the dealer yet :-)

roderickvd avatar Sep 06 '25 05:09 roderickvd

Well I tried again the next day and it worked fine. Maybe a spotify issue? To answer your question it's a home network with all outbound connections open.

isaacheine avatar Sep 11 '25 04:09 isaacheine

For the record, I had this problem too. It turned out that my IPv6 networking was broken, and librespot wasn't falling back to IPv4.

richvdh avatar Nov 14 '25 22:11 richvdh