Skip to content

Connection to server closed #1492

Open
Open
@zhjb7

Description

@zhjb7

Description

After a few hours of continuous playback, spotify will disconnect from librespot and playback will stop.

Version

librespot 0.6.0 release

How to reproduce

Steps to reproduce the behavior in librespot e.g.
Compile and running in ubuntu 22.04.
Compile:cargo build --release
Running: ./target/release/librespot -v -n myubuntu

Log

[2025-04-22T11:05:28Z TRACE librespot_audio::fetch] Streaming from https://audio-fa.scdn.co/audio/df2da2cb6f496e6952eb7f9edae4751048862e4f?1745406328_VizjM4T-hm1tM8VYmv3lAuSKEGEHSBD0JHoOh7ka0zM=
[2025-04-22T11:05:30Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 288 ms
[2025-04-22T11:05:30Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 167 kbps
[2025-04-22T11:05:30Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 246 ms
[2025-04-22T11:05:31Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 288 ms
[2025-04-22T11:05:31Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 186 kbps
[2025-04-22T11:05:32Z INFO  librespot_playback::player] <To Be Loved By You> (199680 ms) loaded
[2025-04-22T11:05:34Z TRACE librespot_core::session] Sending Pong
[2025-04-22T11:05:34Z TRACE librespot_core::session] keep-alive state: ExpectingPongAck, timeout in 20.0
[2025-04-22T11:05:34Z TRACE librespot_core::session] Received PongAck
[2025-04-22T11:05:34Z TRACE librespot_core::session] keep-alive state: ExpectingPing, timeout in 80.0
[2025-04-22T11:05:55Z DEBUG librespot_connect::spirc] At track 13 of 60 <"spotify:playlist:37i9dQZF1E35tZmaR3qqwW"> update [false]
[2025-04-22T11:05:55Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
[2025-04-22T11:05:55Z DEBUG librespot_playback::player] command=Load(SpotifyId("spotify:track:2pUQX4d3Cjh3umGkVz0XyI"), true, 0)
[2025-04-22T11:05:55Z TRACE librespot_connect::spirc] ==> kPlayStatusPlay
[2025-04-22T11:05:55Z TRACE librespot_connect::spirc] Sending status to server: [kPlayStatusPlay]
[2025-04-22T11:05:56Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 250 ms
[2025-04-22T11:05:57Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 276 ms
[2025-04-22T11:05:57Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 149 kbps
[2025-04-22T11:05:57Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 103 kbps
[2025-04-22T11:05:58Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 146 kbps
[2025-04-22T11:05:59Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 127 kbps
[2025-04-22T11:05:59Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 68 kbps
[2025-04-22T11:05:59Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 129 kbps
[2025-04-22T11:05:59Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 244 ms
[2025-04-22T11:05:59Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 192 kbps
[2025-04-22T11:06:00Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 258 kbps
[2025-04-22T11:06:00Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 215 ms
[2025-04-22T11:06:00Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 332 kbps
[2025-04-22T11:06:01Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 240 ms
[2025-04-22T11:06:01Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 482 kbps
[2025-04-22T11:06:01Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 627 kbps
[2025-04-22T11:06:01Z TRACE librespot_audio::fetch::receive] Time to first byte now estimated as: 307 ms
[2025-04-22T11:06:02Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 723 kbps
[2025-04-22T11:06:02Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 472 kbps
[2025-04-22T11:06:03Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 819 kbps
[2025-04-22T11:06:03Z TRACE librespot_audio::fetch::receive] Throughput now estimated as: 912 kbps
[2025-04-22T11:06:04Z DEBUG librespot_audio::fetch] Downloading file df2da2cb6f496e6952eb7f9edae4751048862e4f complete
[2025-04-22T11:06:34Z TRACE librespot_core::session] Received Ping
[2025-04-22T11:06:34Z TRACE librespot_core::session] keep-alive state: PendingPong, timeout in 60.0
[2025-04-22T11:06:34Z DEBUG librespot_core::session] Session strong=4 weak=7
[2025-04-22T11:07:34Z TRACE librespot_core::session] Sending Pong
[2025-04-22T11:07:34Z TRACE librespot_core::session] keep-alive state: ExpectingPongAck, timeout in 20.0
[2025-04-22T11:07:48Z WARN  librespot_core::session] Connection to server closed.
[2025-04-22T11:07:48Z DEBUG librespot_core::session] Shutdown: Invalidating session
[2025-04-22T11:07:48Z DEBUG librespot::component] new ChannelManager
[2025-04-22T11:07:48Z DEBUG librespot_core::session] drop Dispatch
[2025-04-22T11:07:48Z ERROR librespot_connect::spirc] remote update selected, but none received
[2025-04-22T11:07:48Z DEBUG librespot_connect::spirc] drop Spirc[0]
[2025-04-22T11:07:48Z WARN  librespot] Spirc shut down unexpectedly
[2025-04-22T11:07:48Z DEBUG librespot_core::session] new Session
[2025-04-22T11:07:48Z DEBUG librespot_connect::spirc] new Spirc[1]
[2025-04-22T11:07:48Z DEBUG librespot::component] new MercuryManager
[2025-04-22T11:07:48Z DEBUG librespot::component] new SpClient
[2025-04-22T11:07:48Z DEBUG librespot_core::spclient] Client token unavailable or expired, requesting new token.
[2025-04-22T11:07:48Z DEBUG librespot_core::http_client] Requesting https://clienttoken.spotify.com/v1/clienttoken
[2025-04-22T11:07:48Z DEBUG librespot_playback::player] command=SetSession
[2025-04-22T11:07:48Z DEBUG librespot_core::session] drop Session
[2025-04-22T11:07:48Z DEBUG librespot::component] drop ApResolver
[2025-04-22T11:07:48Z DEBUG librespot::component] drop AudioKeyManager
[2025-04-22T11:07:48Z DEBUG librespot::component] drop ChannelManager
[2025-04-22T11:07:48Z DEBUG librespot::component] drop MercuryManager
[2025-04-22T11:07:48Z DEBUG librespot::component] drop SpClient
[2025-04-22T11:07:48Z DEBUG librespot::component] drop Login5Manager
[2025-04-22T11:08:08Z ERROR librespot] could not initialize spirc: Service unavailable { client error (Connect) }

Host (what you are running librespot on):

  • OS: ubuntu 22.04
  • Platform:HP computer

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions