Spotify login error: <ErrorType.UNABLE_TO_CONTACT_SERVER: 8>

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