Errno 98 Adress already in use

Hi,

Im setting up mopidy and snapcast with this tutorial as a guide Mopidy + Snapcast – Multi-Room Music-Setup - Hoerli.NET

I managed to get the snapcast server going by not mopidy.

when I start mopidy i get:

ERROR    2022-10-05 16:23:15,234 [87241:MainThread] mopidy.commands
  Frontend (HttpFrontend) initialization error: HTTP server startup failed: [Errno 98] Address already in use
ERROR    2022-10-05 16:23:15,243 [87241:MainThread] mopidy.commands
  Frontend (MpdFrontend) initialization error: MPD server startup failed: [Errno 98] Address already in use

Mopidy status gets me the following:

mopidy.service - Mopidy music server
     Loaded: loaded (/lib/systemd/system/mopidy.service; enabled; vendor preset: enabled)
     Active: active (running) since Tue 2022-10-04 14:49:58 CEST; 1 day 1h ago
    Process: 9386 ExecStartPre=/bin/mkdir -p /var/cache/mopidy (code=exited, status=0/SUCCESS)
    Process: 9387 ExecStartPre=/bin/chown mopidy:audio /var/cache/mopidy (code=exited, status=0/SUCCESS)
   Main PID: 9388 (mopidy)
      Tasks: 15 (limit: 779)
        CPU: 3.754s
     CGroup: /system.slice/mopidy.service
             └─9388 /usr/bin/python3 /usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf

Oct 04 14:50:01 raspberrypi mopidy[9388]: INFO     [YouTubeBackend-6] mopidy_youtube using jAPI
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [MainThread] mopidy.internal.path Creating dir file:///etc/mopidy/podcast
Oct 04 14:50:02 raspberrypi mopidy[9388]: WARNING  [MainThread] mopidy_podcast.library Cannot access Mopidy-Podcast config directory: Permission denied
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [MainThread] mopidy.commands Starting Mopidy core
Oct 04 14:50:02 raspberrypi mopidy[9388]: ERROR    [PodcastBackend-7] mopidy_podcast.library Cannot retrieve Podcast root directory
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [MainThread] mopidy.commands Starting Mopidy frontends: HttpFrontend, YouTubeAutoplayer, YouTubeCoreListe>
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [HttpFrontend-10] mopidy.http.actor HTTP server running at [::ffff:127.0.0.1]:6680
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [IrisFrontend-14] mopidy_iris.core Starting Iris 3.64.1
Oct 04 14:50:02 raspberrypi mopidy[9388]: INFO     [MainThread] mopidy.commands Starting GLib mainloop
Oct 04 14:50:02 raspberrypi mopidy[9388]: WARNING  [MprisFrontend-13]
 mopidy_mpris.frontend MPRIS frontend setup failed (g-io-error-quark: Cannot autolaunch>

the http part of the config looks like this:

[http]
enabled = true
hostname = 192.168.xxx.xxx 
port = 6680
zeroconf = Mopidy HTTP server on $hostname
allowed_origins =
csrf_protection = true
default_app = mopidy

and lastly these are the IPs i can find:

root@raspberrypi:/home/pi# netstat -tulpn | grep LISTEN
tcp 0 0 0.0.0.0:49149 0.0.0.0:* LISTEN 746/upmpdcli
tcp 0 0 0.0.0.0:1705 0.0.0.0:* LISTEN 734/snapserver
tcp 0 0 0.0.0.0:1704 0.0.0.0:* LISTEN 734/snapserver
tcp 0 0 127.0.0.1:6680 0.0.0.0:* LISTEN 9388/python3
tcp 0 0 0.0.0.0:1780 0.0.0.0:* LISTEN 734/snapserver
tcp 0 0 0.0.0.0:49152 0.0.0.0:* LISTEN 746/upmpdcli

Just to be clear, the host adress is supposed to be the IP of the raspberry pi im running right?
Because I tried several different IPs and ports but the error messages are still the same.

Any idea what this could be?

Cheers
F.

Active: active (running) since Tue 2022-10-04 14:49:58 CEST; 1 day 1h ago

Mopidy is running. You don’t need to try and start it again.

Yes, but i cant reach the mopidy server to reach the web-client.
Or do you mean something different?

https://docs.mopidy.com/en/latest/running/service/

Stop the service, modify the config file for the service and adjust the http hostname to 0.0.0.0. Mopidy-HTTP — Mopidy 3.3.0 documentation

Then start the Mopidy service again.

Hm, I just tried again with 0.0.0.0 and with 127.0.0.1 but in the status i still get

Oct 06 12:10:50 raspberrypi mopidy[144439]: INFO     [HttpFrontend-10] mopidy.http.actor HTTP server running at [::ffff:127.0.0.1]:6680

also I tried:
sudo mopidyctl config
and it prints out only half on the config. the last block it show is [iris] but the [http] block doesnt show up.
when I display the config with nano it shows the whole config.

have I messed up my config somehow? if the [http] is ignored somehow, it at least explains why the [::ffff:127.0.0.1]:6680 IP isnt changing.

I somehow made it work. I think for some reason the config file was locked. So i set new read permissions and now its working.

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