Spotify search no longer working

Hi, Spotify search just stopped working on my Pi Music Box. I only get “No tracks found”. It still worked yesterday. Anyone else affected or is it just me? Searching from local files and other services works, playing back Spotify playlists works, only search fails. I restarted my Music Box but it didn’t help.

Hmm this only seems to affect the default web client – Spotify search works in Mopify.

Because Mopify makes it’s own calls to a different Spotify API i.e. it only uses mopidy-spotify (libspotify) for playback.

I’m seeing the exact same thing myself. I also noticed a load of Roku users were reporting similar problems on the Spotify forums; I believe the Roku boxes also use libspotify.

However, mopidy-spotify v3.x (non-Pi Musicbox) is still working just fine. I need to get a debug log and see what’s going wrong in our old version.

Uh oh, ChannelError messages.

2017-04-26 14:51:35,968 DEBUG [6267:HttpServer] mopidy.http.handlers: Received WebSocket message from u'{"method":"","params":{"query":{"any":["underoath"]},"uris":["spotify:"]},"jsonrpc":"2.0","id":86}'
2017-04-26 14:51:35,972 DEBUG [6267:SpotifyBackend-10] mopidy_spotify.library: Spotify search query: underoath
2017-04-26 14:51:35,982 DEBUG [6267:Dummy-12] mopidy_spotify.session_manager: System message: 14:51:35.982 E [ap:4210] ChannelError(0, 1, search)
2017-04-26 14:51:36,007 DEBUG [6267:HttpServer] mopidy.http.handlers: Sent WebSocket message to '{"jsonrpc": "2.0", "id": 86, "result": [{"__model__": "SearchResult", "uri": "spotify:search:underoath"}]}'

And I now remember why this doesn’t occur in mopidy-spotify v3.x etc. When Spotify broke it last time in 2016 we moved to use the Web API for searching as Spotify actually maintains this. There is no guarantee Spotify will fix this issue, last time it took them about a month to respond. Which means I need to revise my Pi Musicbox release plans.

1 Like

I’ve backported a fix from the latest version of mopidy-spotify. You can install it with:

pip install --no-deps

If you are not in the UK you’ll need to also specify your account country code in settings.ini in order for the search results to be playable in your region:

# Supply your PREMIUM account credentials to enable Spotify
enabled = false
username = 
password = 
# Two letter country code for your account (see
user_country = GB
# The bitrate, the quality of the music played by Spotify, can be set to 96, 160 (default) or 320
bitrate = 320
cache_dir = ""

Hi, I tried this but I don’t think it worked.

When I run the command I get SNIMissingWarning, two InsecurePlatformWarnings and this:

Requirement already satisfied (use --upgrade to upgrade): Mopidy-Spotify==1.4.0 from in /usr/local/lib/python2.7/dist-packages

Also this in musicbox_startup.log:

WARNING Found spotify configuration errors, the extension has been automatically disabled:
WARNING spotify/user_country unknown config key.
WARNING Please fix the extension configuration errors or disable the extensions to silence these messages.

Sorry I messed up that command, the suggestion in the error message is correct and the following should do it:

pip install --no-deps --upgrade

That warning message will go away once you have successfully installed the updated version using the above command.

Perfect, thanks! :+1:

From what I read on the Spotify forums earlier there is a good chance they’ve now fixed it themselves. But that’s not to say they won’t break it again next week so this (short-term) solution is the best way forward for now.

Oh dear, it seems Spotify search is broken again.

Yes, they have changed the authorisation required for their Web API endpoints (which this workaround was using). However, they have since fixed libspotify search so we can go back to using that. I need to push the reverted version when I get home.

1 Like

Hello, I want to try this, but I get a 404…
Have you got another URI for this file?

HTTP error 404 while getting
Could not install requirement because of error 404 Client Error: Not Found for url:  spotify/archive/pimusicbox/
Could not install requirement because of HTTP error 404 Client Error: Not Found for url: for URL

You do not need that code, search should work out of the box.

Can I restore Spotify search by doing clean install, or is there some other way to roll back the previous fix?

Sorry, yes, clean install or try something like:
pip install --no-deps --ignore-installed mopidy-spotify==1.4.0

Hi, tried both methods, both worked :slight_smile: Search works fine with the exception of artist/cover images, they no longer seem to load.

Oh yeh, I forgot that images have always been fetched from the Web API, which Spotify have now changed to require authentication. Maybe I will have to backport the fix that’s hopefully going into the latest mopidy-spotify. That’s annoying, thanks Spotify.