Spotify login issues

Hi,

I am struggling to get mopidy_spotify working. In terms of background:

*I am running it on a PI Zero
*I have a spotify premium account (not facebook based).

  • I am running mopidy as a service
    *I have completed the authentication steps on the mopidy_spotify site and loaded them into the /etc/mopidy/mopidy.conf location.
  • I am using mopidy-Iris as a web front end, but have also tried Remotedy

Within Iris if I click on a spotify track and request it to play the mopidy logs indicate the lookup failed and that I need to be logged in on the backend. I can’t quite work out what to look into next so appreciate any guidance.

sudo mopidyctl config provides the following (note I have ** some characters of my credentials)

Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config” as user mopidy
INFO [MainThread] mopidy.main Starting Mopidy 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: spotify_web = mopidy_spotify_web:Extension
DEBUG [MainThread] mopidy_spotify_web loading mopidy-web extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Spotify-Web 0.3.0
DEBUG [MainThread] mopidy.ext Loading entry point: mpd = mopidy_mpd:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-MPD 3.1.0
DEBUG [MainThread] mopidy.ext Loading entry point: iris = mopidy_iris:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Iris 3.57.6
DEBUG [MainThread] mopidy.ext Loading entry point: file = mopidy.file:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-File 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: http = mopidy.http:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-HTTP 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: m3u = mopidy.m3u:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-M3U 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: softwaremixer = mopidy.softwaremixer:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-SoftwareMixer 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: stream = mopidy.stream:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Stream 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: spotify = mopidy_spotify:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Spotify 4.1.0
DEBUG [MainThread] mopidy.ext Discovered extensions: spotify_web, mpd, iris, file, http, m3u, softwaremixer, stream, spotify
DEBUG [MainThread] mopidy.config.keyring Fetching passwords from your keyring failed. Any passwords stored in the keyring will not be available. (org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11)
INFO [MainThread] mopidy.config Loading config from builtin defaults
INFO [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf
INFO [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf
INFO [MainThread] mopidy.config Loading config from command line options
DEBUG [MainThread] mopidy.ext Validating extension: spotify_web
DEBUG [MainThread] mopidy.ext Validating extension: mpd
DEBUG [MainThread] mopidy.ext Validating extension: iris
DEBUG [MainThread] mopidy.ext Validating extension: file
DEBUG [MainThread] mopidy.ext Validating extension: http
DEBUG [MainThread] mopidy.ext Validating extension: m3u
DEBUG [MainThread] mopidy.ext Validating extension: softwaremixer
DEBUG [MainThread] mopidy.ext Validating extension: stream
DEBUG [MainThread] mopidy.ext Validating extension: spotify
INFO [MainThread] mopidy.main Enabled extensions: spotify_web, stream, file, m3u, http, mpd, iris, softwaremixer, spotify
INFO [MainThread] mopidy.main Disabled extensions: none
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000
restore_state = false

[logging]
verbosity = 4
format = %(levelname)-8s [%(threadName)s] %(name)s %(message)s
color = false
config_file =

[audio]
mixer = software
mixer_volume =
output = autoaudiosink
buffer_time =

[proxy]
scheme =
hostname =
port =
username =
password =

[spotify_web]
enabled = true
client_id = 4afb633b-3b53-4f93-b768-9*****
client_secret = 93UHJdLlfc-EtmeULOVRH1r_9yyU6KoBQOW*****
mopidy_token_url = https://auth.mopidy.com/spotify/token
spotify_token_url = https://accounts.spotify.com/api/token
use_mopidy_oauth_bridge = true
refresh_token = please configure if you want to use spotify auth instead of mopidy swap service

[mpd]
enabled = true
hostname = 0.0.0.0
port = 6600
password =
max_connections = 20
connection_timeout = 60
zeroconf = Shower mpd
command_blacklist =
listall
listallinfo
default_playlist_scheme = m3u

[iris]
enabled = true
country = GB
locale = en_GB
spotify_authorization_url = ******
lastfm_authorization_url = ******
genius_authorization_url = ******
data_dir = $XDG_DATA_DIR/iris

[file]
enabled = true
media_dirs =
$XDG_MUSIC_DIR|Music
~/|Home
excluded_file_extensions =
.directory
.html
.jpeg
.jpg
.log
.nfo
.pdf
.png
.txt
.zip
show_dotfiles = false
follow_symlinks = false
metadata_timeout = 1000

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
zeroconf = Shower http
allowed_origins =
csrf_protection = true
default_app = mopidy

[m3u]
enabled = true
base_dir =
default_encoding = latin-1
default_extension = .m3u8
playlists_dir =

[softwaremixer]
enabled = true

[stream]
enabled = true
protocols =
http
https
mms
rtmp
rtmps
rtsp
metadata_blacklist =
timeout = 5000

[spotify]
enabled = true
username = gn6xankxnvn51hah*****
password = ********
client_id = 4afb633b-3b53-4f93-b768-912074****
client_secret = ********
bitrate = 320
volume_normalization = true
private_session = false
timeout = 10
allow_cache = true
allow_network = true
allow_playlists = true
search_album_count = 20
search_artist_count = 10
search_track_count = 50
toplist_countries =

sudo mopidyctl deps provides:

Running “/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf deps” as user mopidy
INFO [MainThread] mopidy.main Starting Mopidy 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: spotify_web = mopidy_spotify_web:Extension
DEBUG [MainThread] mopidy_spotify_web loading mopidy-web extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Spotify-Web 0.3.0
DEBUG [MainThread] mopidy.ext Loading entry point: mpd = mopidy_mpd:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-MPD 3.1.0
DEBUG [MainThread] mopidy.ext Loading entry point: iris = mopidy_iris:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Iris 3.57.6
DEBUG [MainThread] mopidy.ext Loading entry point: file = mopidy.file:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-File 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: http = mopidy.http:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-HTTP 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: m3u = mopidy.m3u:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-M3U 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: softwaremixer = mopidy.softwaremixer:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-SoftwareMixer 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: stream = mopidy.stream:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Stream 3.1.1
DEBUG [MainThread] mopidy.ext Loading entry point: spotify = mopidy_spotify:Extension
DEBUG [MainThread] mopidy.ext Loaded extension: Mopidy-Spotify 4.1.0
DEBUG [MainThread] mopidy.ext Discovered extensions: spotify_web, mpd, iris, file, http, m3u, softwaremixer, stream, spotify
DEBUG [MainThread] mopidy.config.keyring Fetching passwords from your keyring failed. Any passwords stored in the keyring will not be available. (org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11)
INFO [MainThread] mopidy.config Loading config from builtin defaults
INFO [MainThread] mopidy.config Loading config from file:///usr/share/mopidy/conf.d/mopidy.conf
INFO [MainThread] mopidy.config Loading config from file:///etc/mopidy/mopidy.conf
INFO [MainThread] mopidy.config Loading config from command line options
DEBUG [MainThread] mopidy.ext Validating extension: spotify_web
DEBUG [MainThread] mopidy.ext Validating extension: mpd
DEBUG [MainThread] mopidy.ext Validating extension: iris
DEBUG [MainThread] mopidy.ext Validating extension: file
DEBUG [MainThread] mopidy.ext Validating extension: http
DEBUG [MainThread] mopidy.ext Validating extension: m3u
DEBUG [MainThread] mopidy.ext Validating extension: softwaremixer
DEBUG [MainThread] mopidy.ext Validating extension: stream
DEBUG [MainThread] mopidy.ext Validating extension: spotify
INFO [MainThread] mopidy.main Enabled extensions: softwaremixer, http, spotify, stream, file, iris, spotify_web, mpd, m3u
INFO [MainThread] mopidy.main Disabled extensions: none
Executable: /usr/bin/mopidy
Platform: Linux-5.10.17±armv6l-with-debian-10.9
Python: CPython 3.7.3 from /usr/lib/python3.7
Mopidy: 3.1.1 from /usr/lib/python3/dist-packages
Mopidy-Iris: 3.57.6 from /usr/local/lib/python3.7/dist-packages
setuptools: 40.8.0 from /usr/lib/python3/dist-packages
Pykka: 2.0.3 from /usr/lib/python3/dist-packages
Mopidy: 3.1.1 from /usr/lib/python3/dist-packages
Mopidy-MPD: 3.1.0 from /usr/local/lib/python3.7/dist-packages
setuptools: 40.8.0 from /usr/lib/python3/dist-packages
Pykka: 2.0.3 from /usr/lib/python3/dist-packages
Mopidy: 3.1.1 from /usr/lib/python3/dist-packages
Mopidy-Spotify: 4.1.0 from /usr/lib/python3/dist-packages
Mopidy-Spotify-Web: 0.3.0 from /usr/local/lib/python3.7/dist-packages
Mopidy: 3.1.1 from /usr/lib/python3/dist-packages
Mopidy-Spotify: 4.1.0 from /usr/lib/python3/dist-packages
setuptools: 40.8.0 from /usr/lib/python3/dist-packages
Pykka: 2.0.3 from /usr/lib/python3/dist-packages
spotipy: 2.18.0 from /usr/local/lib/python3.7/dist-packages
urllib3: 1.26.4 from /usr/local/lib/python3.7/dist-packages
requests: 2.25.1 from /usr/local/lib/python3.7/dist-packages
urllib3: 1.26.4 from /usr/local/lib/python3.7/dist-packages
certifi: 2018.8.24 from /usr/lib/python3/dist-packages
chardet: 3.0.4 from /usr/lib/python3/dist-packages
idna: 2.6 from /usr/lib/python3/dist-packages
six: 1.15.0 from /usr/local/lib/python3.7/dist-packages
requests: 2.25.1 from /usr/local/lib/python3.7/dist-packages
urllib3: 1.26.4 from /usr/local/lib/python3.7/dist-packages
certifi: 2018.8.24 from /usr/lib/python3/dist-packages
chardet: 3.0.4 from /usr/lib/python3/dist-packages
idna: 2.6 from /usr/lib/python3/dist-packages
GStreamer: 1.14.4.0 from /usr/lib/python3/dist-packages/gi
Detailed information:
Python wrapper: python-gi 3.30.4
Relevant elements:
Found:
uridecodebin
souphttpsrc
appsrc
alsasink
osssink
oss4sink
pulsesink
id3demux
id3v2mux
lamemp3enc
mpegaudioparse
mpg123audiodec
vorbisdec
vorbisenc
vorbisparse
oggdemux
oggmux
oggparse
flacdec
flacparse
shout2send
Not found:
flump3dec
mad

this is part of the logs when I try to play a track:
May 03 22:21:33 raspberrypi mopidy[487]: DEBUG [SpotifyEventLoop] spotify.eventloop Waiting 299.981s for new events
May 03 22:21:38 raspberrypi mopidy[487]: DEBUG [HttpServer] mopidy.http.handlers Received WebSocket message from 192.168.1.127: '{“method”:“core.tracklist.add”,“params”:{“uris”:[“spotify:track:1UvTPXlImVd4jcucK4qJwb”],"at
May 03 22:21:38 raspberrypi mopidy[487]: DEBUG [SpotifyBackend-6] spotify.session Notify main thread
May 03 22:21:38 raspberrypi mopidy[487]: DEBUG [SpotifyEventLoop] spotify.eventloop Notification received; processing events
May 03 22:21:38 raspberrypi mopidy[487]: INFO [SpotifyBackend-6] mopidy_spotify.lookup Failed to lookup ‘spotify:track:1UvTPXlImVd4jcucK4qJwb’: Session must be logged in and online to load objects: <ConnectionState.LOGGE
May 03 22:21:38 raspberrypi mopidy[487]: DEBUG [SpotifyEventLoop] spotify.eventloop Waiting 295.539s for new events
May 03 22:21:38 raspberrypi mopidy[487]: DEBUG [HttpServer] mopidy.http.handlers Sent WebSocket message to 192.168.1.127: ‘{“jsonrpc”: “2.0”, “id”: 30, “result”: []}’

Happy to provide anything else, that will help.

You need to have a look at the logs while Mopidy is starting to see what’s happening. You should see something like “logged in to Spotify in online mode” towards the bottom. I assume that’s not happening as the error says you aren’t logged in.

Maybe journalctl -u mopidy, but I’m not sure. I expect you can find the command on this forum somewhere.

FYI you don’t see Spotify Web if you’re using Iris as the frontend.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.