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

Unable to access Spotify-playlists #425

Closed
Robusiek opened this Issue Apr 23, 2013 · 11 comments

Comments

3 participants
@Robusiek

Robusiek commented Apr 23, 2013

I get the following error in the console 2-3 seconds after starting up Mopidy.

Exception spotify.SpotifyError: 'Failed to get link from a playlist' 
in < bound method SpotifySessionManager.log_message 
of < SpotifySessionManager(SpotifyThread, started daemon 
140522985015040)>> ignored

I cannot see my playlists at all in any http-end or MPDroid.

@jodal

This comment has been minimized.

Member

jodal commented Apr 23, 2013

I think this may be caused by new playlists having been created since the last time you ran Mopidy, and may thus be the same issue as #387.

If you delete Mopidy's cache, typically stored at ~/.cache/mopidy/, and then start Mopidy again, do you get the same error or does it work?

@Robusiek

This comment has been minimized.

Robusiek commented Apr 23, 2013

I deleted the spotify-folder inside ~/.cache/mopidy/ and restarted Mopidy and still got the error.

@Robusiek

This comment has been minimized.

Robusiek commented Apr 24, 2013

I left it on over night and this morning two copies of these errors were added to the first error:

Exception spotify.SpotifyError: 'Failed to get link from a playlist' in < bound method 
SpotifyContainerManager.container_loaded of 
< mopidy.backends.spotify.container_manager.SpotifyContainerManager instance 
at 0x200acf8>> ignored
@Robusiek

This comment has been minimized.

Robusiek commented Apr 27, 2013

With verbose mode i notice the following when the HTTP.frontend asks for a playlist:

DEBUG    2013-04-27 22:38:33,003 [24579:WebSocket client at 192.168.0.11:58276] mopidy.frontends.http
  Received WebSocket message from 127.0.0.1:1111: '{"method":"core.playlists.get_playlists","params":[false],"jsonrpc":"2.0","id":8}'
DEBUG    2013-04-27 22:38:33,006 [24579:WebSocket client at 192.168.0.11:58276] mopidy.frontends.http
  Sent WebSocket message to 127.0.0.1:1111: '{"jsonrpc": "2.0", "id": 8, "result": []}'

Other interesting messages from my log:

It seems it recognizes that I have playlists. (Just to add to this thread: I have never got the playlists working with Mopidy, not even when I firstly installed it, so no "new playlists having been created since the last time you ran Mopidy").

DEBUG    2013-04-27 22:13:10,937 [23079:SpotifyThread] mopidy.backends.spotify
  Callback called: playlist container loaded
DEBUG    2013-04-27 22:13:10,938 [23079:SpotifyThread] mopidy.backends.spotify
  Still getting data; skipped refresh of playlists
DEBUG    2013-04-27 22:13:10,939 [23079:SpotifyThread] mopidy.backends.spotify
  Watching 60 playlist(s) for changes

This one seems strange?

DEBUG    2013-04-27 22:13:12,299 [23079:SpotifyThread] mopidy.backends.spotify
  Callback called: 132 track(s) added to position 0 in playlist ""
DEBUG    2013-04-27 22:13:12,299 [23079:SpotifyThread] mopidy.backends.spotify
  Still getting data; skipped refresh of playlists
DEBUG    2013-04-27 22:13:12,300 [23079:SpotifyThread] mopidy.backends.spotify
  System message: 20:13:12.300 W [playlist.cpp:45] Adding observer while updating
DEBUG    2013-04-27 22:13:12,300 [23079:SpotifyThread] mopidy.backends.spotify
  System message: 20:13:12.300 W [playlist.cpp:45] Adding observer while updating
@kingosticks

This comment has been minimized.

Member

kingosticks commented Apr 27, 2013

My guess is that playlist doesn't have a name as its still not loaded. Since you've never had playlists working I'd say all your playlists are 'new' in Mopidy's eyes. The libspotify playlist load should be triggered when the container is loaded (which it appears it is) and that in turn seems to be loading the tracks ok. But the full Mopidy playlist structure refresh won't happen until a certain string is seen in the libspotify log, maybe that's not happening. And at certain points libspotify should be saving the playlist data in a local cache, so that next time it loads up far quicker. Perhaps this isn't happening, I don't think the current logout functionality works properly so it'll unlikely happen at this point like it's supposed to. It might be simpler to debug the behaviour with the pyspotify jukebox example.

@kingosticks

This comment has been minimized.

Member

kingosticks commented Apr 27, 2013

EDIT: looked again!

So the playlist container loads and Mopidy correctly 'recognises' you have 60 playlists to watch. But the Mopidy playlist refresh won't occur until 'offline-mgr'/'files unlocked' is seen in the libspotify log (signalling all the data has loaded). But the playlists are still 'watched' so when the tracks are loaded for a playlist tracks_added() will fire and Mopidy will try (and fail) again to refresh its playlists list. My guess is the tracks may be loaded but the other playlist data may still not be (hence the empty name string). It looks like the 'offline-mgr'/'files unlocked' log message is never received so you'll never complete a Mopidy playlist refresh - weird!

@Robusiek: could you have a good look in your Mopidy log for those 'offline-mgr'/'files unlocked' strings?

@jodal

This comment has been minimized.

Member

jodal commented Apr 28, 2013

Looking closer at this issue myself, I see that the very first error @Robusiek pasted happened in the log_message callback, which just refreshes the stored playlists. In other words, the 'offline-mgr'/'files unlocked' happened at least originally.

@jodal jodal closed this in c81c563 Apr 28, 2013

@jodal

This comment has been minimized.

Member

jodal commented Apr 28, 2013

I'm quite confident this should be fixed by the fix for #387. I'll release 0.14 later today, so you're free to wait for that before testing.

@kingosticks

This comment has been minimized.

Member

kingosticks commented Apr 28, 2013

Apologies for my ramblings, hopefully the fix will take care of it. Its probably worth deleting the cache again if it doesn't work straight off.

@jodal

This comment has been minimized.

Member

jodal commented Apr 28, 2013

No worries! It was your comments that had me thinking and looking into this :-)

@Robusiek

This comment has been minimized.

Robusiek commented Apr 29, 2013

Great! It is working now! 👯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment