[NEWBIE] Can't play Spotify songs - "Extension disabled"

Hello,

Newbie disclaimer— Not being a proper developer, I may have missed things that should have been obvious. Thank you in advance for your patience.

I’m trying to replicate the music-cards project, but keep getting stuck.

No problem to install a disk image on the SD card, and get the Raspberry to run. Once I could access the web interface, I set up Spotify on /settings (as well as Wi-Fi and Hifiberry Digi)

I can see/browse my Songs, but they won’t play. Sound is working, I can play Radio stations fine.

In the config.ini file, I can see values for client_id and client_secret, but here’s what I get entering mopidy config in my Terminal (connected via SSH):

[spotify_web]
enabled = false  ; Extension disabled due to config errors.
client_id =   ; Must be set.
client_secret =   ; Must be set.
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

I tried to update my Spotify password to remove special characters as this seems to cause issues, but it is not the case for me. I also tried to update SSH, Mopify, etc. not really knowing what I was doing.

I run mopidy 1.1.2. I don’t know version of Pi MusicBox I have, can’t find where the info is. :confused:

Any advice? Should I retry from scratch? I’ll happily give more details.

You would need to run service mopidy run config to see the service config in use. You are interested in the Spotify extension rather than the Spotify_Web extension as that’s what actually plays the music. But either way, if you can see your playlists and search then everything is OK there. Can you provide the config (by running the command above) and the log file /var/log/mopidy/mopidy.log

Hello @kingosticks, thank you for the fast reply!

service mopidy run config

[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
max_tracklist_length = 10000

[logging]
color = true
console_format = %(levelname)-8s %(message)s
debug_format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n  %(message)s
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging-debug.conf

[audio]
mixer = software
mixer_volume = 100
output = alsasink

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

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

[http]
enabled = true
hostname = 0.0.0.0
port = 6680
static_dir = /opt/musicbox/webclient
zeroconf =

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

[m3u]
enabled = true
playlists_dir = /music/playlists

[softwaremixer]
enabled = true

[file]
enabled = true
media_dirs =
  /music|Music
show_dotfiles = false
follow_symlinks = true
metadata_timeout = 1000

[local]
enabled = true
library = sqlite
media_dir = /music
data_dir = $XDG_DATA_DIR/mopidy/local
scan_timeout = 1000
scan_flush_threshold = 100
scan_follow_symlinks = true
excluded_file_extensions =
  .directory .html
  .jpeg
  .jpg
  .log
  .nfo
  .png
  .txt
  .mkv
  .avi
  .divx
  .qt
  .htm
  .zip
  .rar
  .gz
  .pdf
  .exe
  .ini
  .mid
  .db
  .m3u
  .sfv
  .midi

[youtube]
enabled = true

[websettings]
enabled = true
musicbox = true
config_file = /boot/config/settings.ini

[tunein]
enabled = true
timeout = 5000

[subsonic]
enabled = false  ; Extension disabled by user config.

[spotify]
enabled = false  ; Extension disabled due to config errors.
username = vichbdn
password = ********
client_id =   ; Must be set.
client_secret =   ; Must be set.
bitrate = 320
timeout = 10
cache_dir =
settings_dir = $XDG_CONFIG_DIR/mopidy/spotify
toplist_countries =
  AD
  AR
  AU
  AT
  BE
  CO
  CY
  DK
  EE
  FI
  FR
  DE
  GR
  HK
  IS
  IE
  IT
  LV
  LI
  LT
  LU
  MY
  MX
  MC
  NL
  NZ
  NO
  PT
  ES
  SG
  SE
  CH
  TW
  TR
  GB
  US
search_album_count = 20
search_artist_count = 10
search_track_count = 50

[spotify_web]
enabled = true
client_id = [my client_id]
client_secret = [my client_secret]
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

[spotify_tunigo]
enabled = true
region =
sub_genres = true
cache_time = 3600

[soundcloud]
enabled = false  ; Extension disabled by user config.

[somafm]
enabled = false  ; Extension disabled by user config.

[simple-webclient]
enabled = true

[scrobbler]
enabled = false  ; Extension disabled by user config.

[podcast]
enabled = true
browse_root = Podcasts.opml
browse_order = desc
lookup_order = asc
cache_size = 64
cache_ttl = 86400
timeout = 10

[podcast-itunes]
enabled = true
retries = 3
country = US
explicit =
base_url = http://itunes.apple.com/
charts = audioPodcasts
search_limit = 20
timeout = 10
charts_limit = 20

[musicbox_webclient]
enabled = true
musicbox = true
websocket_host =
websocket_port =
on_track_click = PLAY_ALL

[mopify]
enabled = true
debug = false

[moped]
enabled = true

[mobile]
enabled = true
title = Mopidy Mobile on $hostname
ws_url =

[local-sqlite]
enabled = true
directories =
  Albums                  local:directory?type=album
  Artists                 local:directory?type=artist
  Composers               local:directory?type=artist&role=composer
  Genres                  local:directory?type=genre
  Performers              local:directory?type=artist&role=performer
  Release Years           local:directory?type=date&format=%25Y
  Tracks                  local:directory?type=track
  Last Week's Updates     local:directory?max-age=604800
  Last Month's Updates    local:directory?max-age=2592000
timeout = 10
use_album_mbid_uri = true
use_artist_mbid_uri = false
use_artist_sortname = false

[internetarchive]
enabled = false  ; Extension disabled by user config.

[http-kuechenradio]
enabled = true
title = Mopidy Küchenradio
default_locale = en

[gmusic]
enabled = false  ; Extension disabled by user config.

[dirble]
enabled = true
api_key = 473279e3fa0e7010cbbbb40ecc31890d46e57a2e
countries =
  US
  NL
  DE
  NO
  SE
timeout = 5000

[audioaddict]
enabled = false  ; Extension disabled by user config.

[alsamixer]
enabled = false  ; Extension disabled by user config.

mopidy.log

I got weird stuff here.

First I ran an ls command in the folder.

root@MusicBox:/var/log/mopidy# ls
mopidy.log  mopidy.log.1  mopidy.log.2.gz

Nothing is displayed with cat mopidy.log. I have results for mopidy.log.1

root@MusicBox:/var/log/mopidy# cat mopidy.log.1
2018-02-24 19:37:57,403 - WARNING  Found spotify configuration errors, the extension has been automatically disabled:
2018-02-24 19:37:57,403 - WARNING    spotify/client_secret must be set.
2018-02-24 19:37:57,404 - WARNING    spotify/client_id must be set.
2018-02-24 19:37:57,404 - WARNING  Please fix the extension configuration errors or disable the extensions to silence these messages.
2018-02-24 19:38:03,163 - WARNING  Found spotify configuration errors, the extension has been automatically disabled:
2018-02-24 19:38:03,164 - WARNING    spotify/client_secret must be set.
2018-02-24 19:38:03,164 - WARNING    spotify/client_id must be set.
2018-02-24 19:38:03,165 - WARNING  Please fix the extension configuration errors or disable the extensions to silence these messages.
2018-03-07 21:14:28,625 - WARNING  404 GET /robots.txt (192.168.2.196) 19.64ms
2018-03-07 21:14:31,705 - WARNING  404 GET /favicon.ico (192.168.2.196) 2.27ms
2018-03-07 21:14:35,009 - WARNING  404 GET /settings/js/simple.js (192.168.2.196) 2.73ms
2018-03-07 21:14:35,014 - WARNING  404 GET /settings/js/mopidy.min.js (192.168.2.196) 2.18ms
2018-03-07 21:14:35,139 - WARNING  404 GET /settings/js/mopidy.min.js (192.168.2.196) 2.27ms
2018-03-07 21:14:35,149 - WARNING  404 GET /settings/js/simple.js (192.168.2.196) 2.19ms

As the errors in the config and the log state:

client_id =   ; Must be set.
client_secret =   ; Must be set

You MUST set these two values. Visit https://www.mopidy.com/authenticate/ to obtain them.

I set those in /musicbox/settings. They do appear in spotify_web in mopidy.log—should I enter them manually in $XDG_CONFIG_DIR/mopidy/spotify ?

The same values need to appear for both [spotify] and [spotify_web] sections in /boot/config/settings.ini. What version are you running here?

I see this in settings.ini:

# -----------
# | Spotify |
# -----------
# https://github.com/mopidy/mopidy-spotify
[spotify]
# Supply your PREMIUM account credentials to enable Spotify
enabled = true
username = myspotifyusername
password = myspotifypassword
# The bitrate, the quality of the music played by Spotify, can be set to 96, 160 (default) or 320
bitrate = 320
cache_dir = ""

# ---------------
# | Spotify-Web |
# ---------------
# https://github.com/lfcabend/mopidy-spotify-web
# Supply your credentials obtained from https://www.mopidy.com/authenticate
[spotify_web]
enabled = true
client_id = 968d4985-67cf-4bef-9c95-fc058ks9a47b
client_secret = XjEJSJmU_pklpa4lIEiPjUEY8UzOldP-T2accZMaqTk=

(id/secret aren’t actual values, but they exist.)

Should I copy/paste the two lines from Spotify-Web to Spotify?

How can I know which version I’m running? (It should be the last one, I just installed it 2 weeks ago).

Yes, you should do that as I said in my previous post.

And it works! Huge thank you :smiley: