Spotify login error: <ErrorType.UNABLE_TO_CONTACT_SERVER: 8>

I’ve been experiencing connection issues to Spotify for the past 4 hours:

May 31 15:40:29 turing mopidy[11198]: ERROR    2021-05-31 15:40:29,545 [11198:SpotifyEventLoop] spotify.session
May 31 15:40:29 turing mopidy[11198]:   Spotify login error: <ErrorType.UNABLE_TO_CONTACT_SERVER: 8>
May 31 15:40:29 turing mopidy[11198]: INFO     2021-05-31 15:40:29,859 [11198:SpotifyBackend-8] mopidy_spotify.web
May 31 15:40:29 turing mopidy[11198]:   Logged into Spotify Web API as 1166720951

It seems that the connection through libspotify fails, but the one through the web API succeeds.

As a result, I can see the list of playlists in my MPD client but I can’t load nor play any of the items.

I have tried to refresh my Spotify client ID/secret - still no luck.

Requests to auth.mopidy.com succeed, and Spotify works both from the desktop and mobile apps.

Is anybody else experiencing similar issues? Could it be related to a temporary outage of some local Spotify backend used by libspotify?

I’m also having same issues as of today afternoon. I’m hoping it’s nothing too critical going on with libspotify.

It seems this has happened before.

The issue seems solved now, I just had to restart a bunch of Mopidy instances that had dead Spotify sessions and everything worked again.

I’ve seen this problem in the past, it was usually related to short-lived Spotify outages. The things that spooked me this time have been both the duration (libspotify failed to connect for at least 6 hours) and the fact that in the previous occurrences the Spotify apps also had login/session issues, while this time everything worked fine on the app side.

1 Like

The issue is back today, and according to my Mopidy logs it’s already been going on for almost 3 hours.

Is anybody else also experiencing these issues? These connection errors seem to be more common lately and they last for longer. I’m not sure if it’s due to some changes on the Spotify infra side. @kingosticks @jodal is there anything that can be done on the Mopidy side (e.g. have a way to manage fallback streaming servers) or everything that happens inside of libspotify is a black box?

I am encountering the same issue right now. It started about 4 weeks ago. Every now and then it’s not possible to stream from spotify while all native spotify players seem to work.

I’m having the same starting from around 4h ago, similarly as what @blacklight said. Let’s see…

Things are working again now - the outage lasted approximately 6 hours according to my application logs.

I have also reached out to the Spotify support for explanations, and they again replied with “libspotify has been unsupported since 2012, we won’t investigate issues on that end”.

Do we have a way to control which servers are used for streaming, and in case configure a fallback? If not, may it be worth to investigate a possible migration from libspotify to LibreSpot? Every time I see one of these errors lasting more than a couple of hours I come to believe that it’s the ultimate nail in the coffin for libspotify…

1 Like

Hm… I still have the same issue here. Not sure when the issue started (at least 1h ago).

Hoping that it’s a regional thing, and that I’ll get a fix soon too.

For now I appreciate the interoperability of mopidy, which lets me not be fully reliant on spotify. :headphones:

Hey!
I also have the same issue. Isn’t it connected to the fact that https://ap.spotify.com is not reachable?
Or: is it reachable for you or not?

Regards,
Xyo

Same issue for me, been down all day with same error. I also cannot connect to https://ap.spotify.com in a browser

Same issue here in Italy, since 5 hours ago.

1 Like

I have been having the same issues since this morning. But strace seems to think that the plugin has been disabled due to missing keys in my mopidy.conf but this exact config worked yesterday.

Following the advice of Spotify’s support, I have opened an idea on their board to get an official alternative to libspotify (although today I have experimented for the first time with LibreSpot while mopidy-spotify was down and I’ve also found it a good alternative).

Please upvote the idea if you’re also interested.

3 Likes

Could you please share a link to the idea

[Developer] Official alternative to libspotify - The Spotify Community (also linked in the previous comment)

I have not been able to use spotify since yesterday (around the time of this post). https://ap.spotify.com is also unrecheable to me (from Switzerland).

Also reporting this issue - I’m getting the same error for almost 24 hours now, and still can’t connect. Is Spotify actually working for anyone? Just wondering if there is some variance, or if it’s now broken for everyone?

Broken for me too. Oddly enough, I’m no longer getting the login error (login seems successful), but Session must be logged in and online to load objects appears when trying to load a playlist.

EDIT: I’ve found a solution for now, albeit a hacky one. ap.spotify.com is where pyspotify tries to connect to the API. Often, this will return an IP address that can’t be reached. What I did was use dig ap.spotify.com to get various IP addresses for that A record and ping each one until I got packets back. Once I did that, I modified /etc/hosts and manually set ap.spotify.com to that working IP address. Example entry:

104.154.126.229	ap.spotify.com

This has resolved my problem for now until Spotify fixes this on their end.

2 Likes

Dirty trick. But works!

Thank you!