Streaming Spotify to your Pi - Failed to load URI(s)

Hi there,
I’m new here so this may not be the best place to reply but I found some errors with your installer script, I’m working from this - https://learn.pimoroni.com/tutorial/sandyj/streaming-spotify-to-your-pi

Errors:

Adding hifiberry-dac overlay to /boot/config.txt
Disabling default sound driver

snd_bcm2835 unloaded (on-board audio disabled)
sed: can’t read /home/pi/.config/lxpanel/LXDE/panels/panel: No such file or directory
sed: can’t read /home/pi/.config/lxpanel/LXDE-pi/panels/panel: No such file or directory

Also, my /etc/mopidy/mopidy.conf file wasn’t edited:

patching file /etc/mopidy/mopidy.conf
Hunk #3 FAILED at 39.
Hunk #4 succeeded at 67 (offset 6 lines).
Hunk #5 FAILED at 73.
Hunk #6 succeeded at 125 (offset 16 lines).
Hunk #7 succeeded at 148 (offset 16 lines).
Hunk #8 succeeded at 150 (offset 16 lines).
Hunk #9 succeeded at 166 (offset 16 lines).
Hunk #10 FAILED at 167.
Hunk #11 FAILED at 172.
> 4 out of 11 hunks FAILED – saving rejects to file /etc/mopidy/mopidy.conf.rej

There’s a bunch of items in there that were not setup and will cause errors, such as locale - region locked content.
The sound quality is a bit strange too, vocals seem low but instruments seem much louder.

I’m still seeing some issues, webserver seems to work from my laptop but won’t work from my phone.
When I change settings in the webserver, they’re not reflected in the conf file…

I’ve just finished install, so thought I’d dump the error reports here as it may help fine tune the installer script.

if the patch can’t be applied than that means that a freshly generated config is different than expected. This would occur either if some of the modules have failed to install, or have changed drastically.

… all that to say, I’m going to try to see if the later has occurred, but in my experience it is not unusual for the mopidy apt servers to crap out and fail miserably serving the packages.

The error related to LXDE panel is normal if you are using Raspbian Lite. I’ll silence them, but that is not an issue in itself, the script just tries the passify some of the heavy-handy behaviour of the volume control plug-in in Pixel.

Hi Rogue, thanks for getting back to me. In your opinion would I be better off going for a fresh install?
All this was done from a fresh install, so I could wipe the SD, install Jessie Lite and run the script again.
Or would the best option be to manually copy the config changes across from the mopidy.conf.rej to the mopidy.conf?

This would lead me to believe that I can’t be sure of the quality of the install and it may be a good idea to just install it again…

Edit: Even if I do run the installer script again, there’s a good chance I’ll see the same issues again.

well, server errors are inconsistent. But yes, I would start from scratch if possible. Alternatively you could delete /etc/mopidy/mopidy.conf and re-run the installer… well, as much as I recall the process.

Bottom line though is that a failed patch is a big red flag, and a sign that something went wrong with the install, server timeout being the number 1 suspect. It may or may not be resolved by the time you try again (sometimes even a few minutes apart the result may be different).

Is there any way to test the connection to these servers? Can I do an apt-get uninstall and then apt-get install?

no, the scripts adds the required server url to the apt sources and then removes them at the end of the process (to avoid you getting endless issues trying to upgrade a system when this 3rd party server availability is flaky, which I have found is not unusual).

… unfortunately I haven’t found a way to fetch discrete deb files in this instance, as per my preferred approach to handling non-raspbian sources, to avoid all this kerfuffle

Just to follow up on this, I ran a fresh install again and ran into the same mopidy.conf issue:

I’m not sure if it’s from your script or a Mopidy issue. I think I’ve managed to manually make all the required changes anyway…

EDIT: Funnily enough I didn’t get the LXDE sed errors…

sounds like this was a combination of both: Iris 2.14.0 was released the same day you tried originally, and there was a bug that prevented the very last Hunk to be patched.

… which goes to show that it is indeed good practice to ensure there is a final line feed in configs. And avoid trailing spaces too, but well, where would the fun be if you made things easy for your audience.

Anyhow, it should be fixed now.

If you’ve installed mopidy through the script, will updates to the core service come through apt?

I know you have to use pip to update the components.

no - we remove the mopidy apt sources after install… their server is temperamental to say the least so that would stall any attempt at upgrading any software on your Pi when it becomes unresponsive.

The easiest to update the core service is to re-run the installer, but unless you have a strong reason to do so I would advise not to do it too often. At the very least you’ll have to restore your config each time and things may break between updates.

IMHO mopidy management of configs and settings, while on the surface seemingly flexible, is definitely not user-friendly enough for beginners. So, unless you consider yourself an advanced users, get a system up and running and don’t attempt to keep it on the cutting edge. YMMV.

1 Like

same problem…

I followed your guide and I have these errors:

Configuring mopidy …

Patching file /home/pi/.config/mopidy/mopidy.conf
Hunk # 4 FAILED at 61.
Hunk # 6 succeeded at 155 (offset 76 lines).
Hunk # 7 FAILED at 125.
Hunk # 8 FAILED at 148.
Hunk # 9 FAILED at 150.
Hunk # 10 FAILED at 166.
Hunk # 11 FAILED at 183.
6 out of 11 hunks FAILED - saving rejects to file /home/pi/.config/mopidy/mopidy.conf.rej

I have a fresh install of raspian jessie lite

Thanks for your help

I’m also getting a “Failed to load URI(S)” error when trying to play from Spotify. Fresh install with Raspbian Jessie Lite (2017-06-21) last night. I didn’t notice any failures during the install, but had to manually edit the hostname variable under [http] in /etc/mopidy/mopidy.conf to access the web server from another computer since it was only listening to localhost by default.

I authorized the device in Spotify, rebooted, checked authorization again, then tried to play music and got the “Failed to load URI(s) error”. My username and password appear to be correct in /etc/mopidy/mopidy.conf, and in ~/.config/mopidy/mopidy.conf I see them listed as “namevar” and “passvar” respectively.

Couldn’t see any errors in /var/log/mopidy/mopidy.log after turning on debug mode in Iris, but noticed it was trying to access files on /iris/assets and /iris/undefined on my desktop rather than on the Pi for some reason. Any suggestioins where I can change this and force it to check the right IP address?

today i have this error :

Installing mopidy…
Installing mopidy-alsamixer…
Installing mopidy-local-sqlite…
E: Unable to locate package mopidy-local-sqlite
Apt failed to install mopidy-local-sqlite!
Falling back on pypi…
Installing mopidy-spotify…
E: Unable to locate package mopidy-spotify
Apt failed to install mopidy-spotify!
Falling back on pypi…

:-(

Hi lololo,
From this stage:

Did you try comparing the 2 files:

diff /home/pi/.config/mopidy/mopidy.conf /home/pi/.config/mopidy/mopidy.conf.rej

You can manually add the required changes to the /home/pi/.config/mopidy/mopidy.conf file. You’ll need to update your username, password and a few other items here.

I think this is an error with the install script, I’ve never had the script run passed this point without an error.

For the newer issue:

Installing mopidy…
Installing mopidy-alsamixer…
Installing mopidy-local-sqlite…
E: Unable to locate package mopidy-local-sqlite
Apt failed to install mopidy-local-sqlite!
Falling back on pypi…
Installing mopidy-spotify…
E: Unable to locate package mopidy-spotify
Apt failed to install mopidy-spotify!
Falling back on pypi…

This looks like a genuine Modipy error, how did you hit this error, did you try apt-get mopidy install? From RogueM’s comment above, the apt-get sources are removed by the install script.

If not, as mentioned the Mopidy servers are spotty for some people, maybe try again.
You should try from a clean Jessie build again. Then when you hit the previous error, manually hack the config file with your details. That worked for me anyway.

cool, i will try now…thanks for your reply !!

Below are the changes I have manually made to my /etc/mopidy/mopidy.conf file to get this running.
Maybe @RogueM or @sandyjmacdonald can confirm all of these settings?

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

[logging]
debug_file = /var/log/mopidy/mopidy-debug.log
config_file = /etc/mopidy/logging.conf

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

[iris]
enabled = true
pusherport = 6681
country = GB
locale = en_GB

[ttsgpio]
enabled = true
pin_button_main = 6
pin_button_next = 5
pin_button_previous = 13
pin_button_vol_up = 16
pin_button_vol_down = 26
pin_play_led = 20

[spotify]
enabled = true
username = USERNAME
password = PASSWORD

[http]
enabled = true
hostname = ::
port = 6680

[m3u]
`#playlists_dir = /var/lib/mopidy/playlists

[softwaremixer]
enabled = true

[local]
enabled = true
library = json
media_dir = /var/lib/mopidy/media

[alsamixer]
enabled = true
card = 0
control = PCM

@lololo
See newest reply for full details.

1 Like

@AllynH

I used your configuration (thanks a lot)

I still have a problem, I have a 404 with this address http://ip_address:6680/iris/

Have I forgotten anything?

Hello,

I finally managed to install everything. Always with configuration problems. I modified the file mopidy.conf (thanks AllynH) and finally I had access to Iris.

I also had problems with “Failed to load URI (S)”.

The latest version of Mopidy-Spotify requires you to provide additional configuration values and fails to start without these: https://www.mopidy.com/authenticate/#spotify

Thank you all for your help

1 Like

yes, it does not surprised me at all… the way mopidy handles custom parameters is really a pain.

… I’ll have a look and see if we can align the auto-configuration to make this work again, but unfortunately the way things work, or don’t work to be correct, pretty much makes other breaking changes some time in the future pretty much inevitable :/

1 Like