Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection to server closed. #523

Closed
1 of 6 tasks
mehranz opened this issue Feb 26, 2020 · 18 comments
Closed
1 of 6 tasks

Connection to server closed. #523

mehranz opened this issue Feb 26, 2020 · 18 comments
Labels
bug A functionality or parts of a program that do not work as intended wontfix Issues that will not be fixed under any circumstances

Comments

@mehranz
Copy link

mehranz commented Feb 26, 2020

Description
spotifyd works just fine and plays for one or two minutes or so and then it just crashes and says "Connection to server closed." in output.
I've built spotifyd from latest source on GitHub which has the latest version of librespot and as mentioned in #511 it should fix this problem, but I still getting cut off in the middle of my playback and upgrading to latest commit just changed my error message. It was "Caught panic with message: connection closed" in librespot v0.1.0 and now It's "Connection to server closed." in librespot v0.1.1 !

To Reproduce

  1. after compiling, just run ./spotifyd --config-path ~/.config/spotifyd/spotifyd.conf --no-daemon
  2. connect with a device and play something
  3. wait until one or two minutes!

Logs

Click to show logs
Loading config from "/home/mehran/.config/spotifyd/spotifyd.conf"
Using software volume controller.
Connecting to AP "gew1-accesspoint-b-tk6r.ap.spotify.com:443"
Using proxy "http://127.0.0.1:8889/"
Authenticated as "my_username" !
Using alsa sink
Country: "US"
Loading <Sweet Child O' Mine> with Spotify URI <spotify:track:7snQQk1zcKl8gZ92AnueZW>
<Sweet Child O' Mine> loaded
Connection to server closed.

Compilation flags

  • dbus_mpris
  • dbus_keyring
  • alsa_backend
  • portaudio_backend
  • pulseaudio_backend
  • rodio_backend

Versions :

  • OS: Arch Linux x86_64
  • Spotifyd: master
  • cargo: 1.41.0
@mehranz mehranz added the bug A functionality or parts of a program that do not work as intended label Feb 26, 2020
@mainrs
Copy link
Member

mainrs commented Mar 9, 2020

First off, thanks for following the issue template. Not a lot of people do and it makes it a lot easier :)

The only difference between your setup and mine seems to be the use of a proxy. What software do you use? Can you test it without the proxy?

@Joshua-Hwang
Copy link

Not sure if I should create a new issue but I've been experiencing the same "Caught panic with message: connection closed".
I don't use a proxy and I'm using 0.2.24 (not sure which version of librespot though).
It was installed via AUR on Arch linux.

Strangely I can use the librespot example program without such issues.

@mehranz
Copy link
Author

mehranz commented Mar 17, 2020

First off, thanks for following the issue template. Not a lot of people do and it makes it a lot easier :)

The only difference between your setup and mine seems to be the use of a proxy. What software do you use? Can you test it without the proxy?

no problem :)
I'm using V2ray for proxy. no I can't test without proxy because spotify is blocked in my country!

@bluepuma77
Copy link

I get a similar error running latest spotifyd-linux-armv6-slim on Raspbian Buster Lite (2020-02-13) on a Raspberry Pi Zero with 512MB RAM. I don't use a proxy. After a few long tracks it stops. The Spotify app still shows the device, but it can not play anything anymore.

$ ./spotifyd-slim --no-daemon -d musicbox --device hw:system --control hw:system
Loading config from "/home/pi/.config/spotifyd/spotifyd.conf"
No proxy specified
Using alsa volume controller.
Connecting to AP "xyz.ap.spotify.com:443"
Authenticated as "xyz" !
Using alsa sink
Country: "XY"
[...]
Loading <Kapitel 3 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:6E38po2kH1zU72RaNOqx1g>
<Kapitel 3 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 4 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:5BhYwQio8jcxcK90FWEq5h>
<Kapitel 4 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 5 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:3GpPkUUmm4oKPaOEEazGTe>
<Kapitel 5 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 6 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:0842V4nPvgH2hhwZ0HgHqw>
<Kapitel 6 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 7 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:6ixYXuRzitDF0FYIWTyJ4e>
<Kapitel 7 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 8 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:1A0KdzcvMWqhTkgjAtgnDk>
<Kapitel 8 - Das geheime Olchi-Experiment> loaded
Loading <Kapitel 9 - Das geheime Olchi-Experiment> with Spotify URI <spotify:track:4GwuAO3hv5xH6LX5WugoYS>
<Kapitel 9 - Das geheime Olchi-Experiment> loaded
Os { code: 104, kind: ConnectionReset, message: "Connection reset by peer" }

@shimmerjs
Copy link

I'm also still getting this error after 2 or 3 songs routinely on a build post #511, not running on a proxy, but am running on k3s

@marcospedro97
Copy link

marcospedro97 commented May 25, 2020

same error for me, running with spt, it plays a complete song and then gets 404, running on manjaro, using pulseaudio and no proxy, and as the friend who's using rapbian I see the device on my phone app, but no longer abble to play a song.

@PacoPemo
Copy link

PacoPemo commented Nov 1, 2020

This happens to me while using networkmanager vpn only. I'm using Manjaro Gnome

@stale
Copy link

stale bot commented Jan 30, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issues that will not be fixed under any circumstances label Jan 30, 2021
@mehranz
Copy link
Author

mehranz commented Jan 30, 2021

unfortunately, the problem still remains!

@stale stale bot removed the wontfix Issues that will not be fixed under any circumstances label Jan 30, 2021
@mainrs
Copy link
Member

mainrs commented Jan 30, 2021

Does it still apply to v0.3?

@mainrs mainrs added the waiting for feedback Issues that need user feedback for e.g. log files label Jan 30, 2021
@mehranz
Copy link
Author

mehranz commented Feb 1, 2021

yeah ...

@mainrs mainrs removed the waiting for feedback Issues that need user feedback for e.g. log files label Feb 1, 2021
@stale
Copy link

stale bot commented May 2, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issues that will not be fixed under any circumstances label May 2, 2021
@stale stale bot closed this as completed May 12, 2021
@cheng-dai
Copy link

still have this problem on v0.3.3.

@knthm
Copy link

knthm commented May 10, 2022

+1

@eladyn
Copy link
Member

eladyn commented May 11, 2022

Unfortunately, I think, this is nothing that we can easily fix. One step towards the right direction might be #1059, which should at least recover the session, when spotifyd was started in “credential mode”. You'd still need to restart the playback, however. In the long term, we hopefully see some progress on librespot-org/librespot#609, so that spotifyd can keep playing even on spotty networks.

@mrusme
Copy link

mrusme commented Sep 2, 2022

Gave the spotty networks hint a try and indeed it seems to correlate. spotifyd was playing music up until ping loss set in:

--- 1.1.1.1 ping statistics ---
92 packets transmitted, 91 received, 1.08696% packet loss, time 91134ms
rtt min/avg/max/mdev = 111.423/120.625/146.430/6.978 ms

In that very moment spotifyd simply stopped:

...
Resolved 50 tracks from <"spotify:playlist:37i9dQZF1EIZpfereQw8XL">
<Working For It> (231813 ms) loaded
Connection to server closed.
subscription terminated

If the flaky connection (1% packet loss) should be the cause for instantly losing the connection, it's making spotifyd a bit pointless for a lot of places around the world unfortunately. :(

@eladyn
Copy link
Member

eladyn commented Sep 2, 2022

@mrusme In theory1, librespot (the upstream project that spotifyd uses) has a reconnection logic that tries to restart a session after a connection loss. The one that is used there is a bit better than the one that I implemented in my PR (it also handles sessions over discovery) and is definitely far ahead of the current state on master.

So if you don't strictly depend on one of the features that set spotifyd apart from librespot (MPRIS, keyring support, ...), maybe this solves the issues you have?

Footnotes

  1. Can't confirm this yet from personal experience as I don't have connection issues that often.

@mrusme
Copy link

mrusme commented Sep 2, 2022

@eladyn thank you very much, I just tried librespot and indeed it does seem to work significantly better! I've been listening to a few songs and haven't experienced a connection drop yet, while the connection still seems similarly flaky as 5 hours ago.

mrusme added a commit to mrusme/dotfiles that referenced this issue Sep 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A functionality or parts of a program that do not work as intended wontfix Issues that will not be fixed under any circumstances
Projects
None yet
Development

No branches or pull requests