I select an album an clock on play
→ Error message “Mopidy: Failed to add some tracks”
The logs say:
2019-12-08 11:58:45,309 INFO [497:SpotifyBackend-3] mopidy_spotify.lookup: Failed to lookup “spotify:album:1SvXpumbe1NKEzOAyMjfGT”: Session must be logged in and online to load objects: <ConnectionState.LOGGED_OUT: 0>
Going back some minutes in the log, it gives me. So there is some authentication issue.
2019-12-08 11:40:41,368 ERROR [497:SpotifyEventLoop] spotify.session: Spotify login error: <ErrorType.OTHER_PERMANENT: 10>
2019-12-08 11:40:41,370 INFO [497:SpotifyEventLoop] spotify.session: Spotify logged out
2019-12-08 11:40:42,872 ERROR [497:SpotifyBackend-3] mopidy_spotify.web: OAuth token refresh failed: Unknown error.
2019-12-08 11:40:42,872 ERROR [497:SpotifyBackend-3] mopidy_spotify.web: Failed to load Spotify user profile
2019-12-08 12:01:51,288 INFO [2544:SpotifyEventLoop] spotify.session: Spotify logged in
2019-12-08 12:01:51,290 INFO [2544:SpotifyEventLoop] mopidy_spotify.backend: Logged in to Spotify in online mode
2019-12-08 12:01:51,861 INFO [2544:SpotifyBackend-3] mopidy_spotify.web: Logged into Spotify Web API as m0t0slkutgqsjw6lg48qli1wi
2019-12-08 12:01:51,865 INFO [2544:SpotifyBackend-3] mopidy_spotify.backend: Started spotify backend
Now I can go to Albums, select one and click on play → No error, everything works.
I have to do this everytime I restart the Raspberry.
Does anybody have an idea where to search for the issue?
If you want to play music from Spotify you need to have all the required authentication details in your Mopidy config file, as details on the readme. The location of that file depends on if you run Mopidy as a service or not (http://docs.mopidy.com/en/latest/service/). You can use sudo mopidyctl config to check it’s all correct. Once that’s done iris (and any other webclient) should just work.
To try different thinks, I went to the spotify account overview and tried both, Username and email. Both resulted in the same authentication error.
After restart of the server it works in both options.
I’m not familiar with any incompatibility with Raspberry Pi 4, at least not anything working better on Raspberry Pi 3. If so, that would be something we’d like to look into and solve. Can you elaborate on what you’re referring to?
Could this be an issue with the network not yet being available when Mopidy starts? I think there is an option somewhere (raspi-config maybe?) for the Pi to wait until network is ready during boot. Can you try that please?