I have been using Mopidy on Raspberry Pis for years. Now I just installed it on a desktop machine with Debian 11. Installation went fine, Configuration is also OK. Everything is working as expected, EXCEPT, that after boot I get this in the Mopidy log:
mopidy.service - Mopidy music server
Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2023-03-05 14:41:12 EET; 7min ago
Process: 388 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
Process: 390 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
Main PID: 392 (mopidy)
Tasks: 13 (limit: 14189)
Memory: 64.0M
CPU: 1.658s
CGroup: /system.slice/mopidy.service
└─392 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [YouTubeBackend-3] mopidy_youtube file caching not enabled
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [YouTubeBackend-3] mopidy_youtube using jAPI
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [Audio-2] mopidy.audio.actor Audio output set to "autoaudiosink"
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [MainThread] mopidy.commands Starting Mopidy core
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [MainThread] mopidy.commands Starting Mopidy frontends: YouTubeAutoplayer, YouTubeCoreListener, MpdFrontend, HttpFrontend
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [MainThread] mopidy_mpd.actor MPD server running at [::]:6600
Mar 05 14:41:14 mcoffice mopidy[392]: ERROR [MainThread] mopidy.commands Frontend (HttpFrontend) initialization error: HTTP server startup failed: [Errno 99] Cannot assign requested address
Mar 05 14:41:14 mcoffice mopidy[392]: INFO [MainThread] mopidy.commands Starting GLib mainloop
This line is the error:
Mar 05 14:41:14 mcoffice mopidy[392]: ERROR [MainThread] mopidy.commands Frontend (HttpFrontend) initialization error: HTTP server startup failed: [Errno 99] Cannot assign requested address
When I issue sudo systemctl restart mopidy
, the error disappears, and the web interface is working normally. So I suspect something is not ready on the system at the time Mopidy starts.
I read it elsewhere that the service unit should have After=network.target
, so I tried adding that to /lib/systemd/system/mopidy.service
, but it made no difference. Also, I saw it already had several “wait for items”:
[Unit]
Description=Mopidy music server
After=avahi-daemon.service
After=dbus.service
After=network-online.target
Wants=network-online.target
After=nss-lookup.target
After=pulseaudio.service
After=remote-fs.target
After=sound.target
What else could be the problem?
(Note this is NOT a RPi, but a desktop PC (thin client).)
Thanks for any pointers in advance!