[GH-ISSUE #1111] Zeroconf fails with "Setting up dns-sd failed: Address already in use (os error 98)" #519

Closed
opened 2026-02-27 19:31:05 +03:00 by kerem · 3 comments
Owner

Originally created by @khink on GitHub (Jan 26, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1111

Describe the bug

raspotify keeps crashing with the message "Setting up dns-sd failed: Address already in use (os error 98)".

I filed this in raspotify first, but the error is from librespot, so i thought it made sense to ask/report here.

To reproduce

1.tail -f /var/log/syslog
2. Launch sudo systemctl start raspotify
3. In the log, see "Setting up dns-sd failed: Address already in use (os error 98)", and next "Discovery is unavailable and no credentials provided. Authentication is not possible."

Log

pi@raspberrypi:~ $ journalctl
...
Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z WARN  librespot] Without a `--cache` / `-c` path, and/or if the `--disable-audio-cache` / `-G` flag is set, `--cache-size-limit` / `-M` has no >
Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z WARN  librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98)
Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z ERROR librespot] Discovery is unavailable and no credentials provided. Authentication is not possible.
Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE
Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Failed with result 'exit-code'.
Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Triggering OnFailure= dependencies.
Jan 25 22:01:11 raspberrypi systemd[1]: Starting Raspotify Crash Report Generator...
Jan 25 22:01:12 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Succeeded.
Jan 25 22:01:12 raspberrypi systemd[1]: Finished Raspotify Crash Report Generator.
Jan 25 22:01:12 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Consumed 1.509s CPU time.

Host (what you are running librespot on):

I'm running a standard raspotify on bullseye on a Pi 3. It's running without a monitor (only SSH access), although lxde is installed (i think from when i first set it up a year or two ago).

pi@raspberrypi:~ $ sudo apt show raspotify
Package: raspotify
Version: 0.43.26~librespot.v0.4.2-a56a567
...

pi@raspberrypi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
...

pi@raspberrypi:~ $ cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 4 (v7l)
...
Hardware	: BCM2835
Revision	: a02082
Serial		: 00000000e6a3a0de
Model		: Raspberry Pi 3 Model B Rev 1.2

Additional context

  • I use the same router as before. No recent firmware upgrades.
  • I upgraded to bullseye some 3 weeks ago, this also brought a raspotify/librespot upgrade. In the first days after the upgrade i've restarted raspotify a lot to toy with the settings. The last couple weeks not so much, it's just been running.
  • Specifying a zeroconf port in the raspotify config file (LIBRESPOT_ZEROCONF_PORT) has no effect
  • For now i just disabled zeroconf (and entered my username+password in the raspotify config file), and it works again.
Originally created by @khink on GitHub (Jan 26, 2023). Original GitHub issue: https://github.com/librespot-org/librespot/issues/1111 **Describe the bug** raspotify keeps crashing with the message "Setting up dns-sd failed: Address already in use (os error 98)". I filed this in [raspotify](https://github.com/dtcooper/raspotify/issues/607) first, but the error is from librespot, so i thought it made sense to ask/report here. **To reproduce** 1.`tail -f /var/log/syslog` 2. Launch `sudo systemctl start raspotify` 3. In the log, see "Setting up dns-sd failed: Address already in use (os error 98)", and next "Discovery is unavailable and no credentials provided. Authentication is not possible." **Log** ``` pi@raspberrypi:~ $ journalctl ... Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z WARN librespot] Without a `--cache` / `-c` path, and/or if the `--disable-audio-cache` / `-G` flag is set, `--cache-size-limit` / `-M` has no > Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z WARN librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98) Jan 25 22:01:11 raspberrypi librespot[8216]: [2023-01-25T21:01:11Z ERROR librespot] Discovery is unavailable and no credentials provided. Authentication is not possible. Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Main process exited, code=exited, status=1/FAILURE Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Failed with result 'exit-code'. Jan 25 22:01:11 raspberrypi systemd[1]: raspotify.service: Triggering OnFailure= dependencies. Jan 25 22:01:11 raspberrypi systemd[1]: Starting Raspotify Crash Report Generator... Jan 25 22:01:12 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Succeeded. Jan 25 22:01:12 raspberrypi systemd[1]: Finished Raspotify Crash Report Generator. Jan 25 22:01:12 raspberrypi systemd[1]: raspotify-crash-report-generator.service: Consumed 1.509s CPU time. ``` **Host (what you are running `librespot` on):** I'm running a standard raspotify on bullseye on a Pi 3. It's running without a monitor (only SSH access), although lxde is installed (i think from when i first set it up a year or two ago). ``` pi@raspberrypi:~ $ sudo apt show raspotify Package: raspotify Version: 0.43.26~librespot.v0.4.2-a56a567 ... pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" ... pi@raspberrypi:~ $ cat /proc/cpuinfo processor : 0 model name : ARMv7 Processor rev 4 (v7l) ... Hardware : BCM2835 Revision : a02082 Serial : 00000000e6a3a0de Model : Raspberry Pi 3 Model B Rev 1.2 ``` **Additional context** - I use the same router as before. No recent firmware upgrades. - I upgraded to bullseye some 3 weeks ago, this also brought a raspotify/librespot upgrade. In the first days after the upgrade i've restarted raspotify a lot to toy with the settings. The last couple weeks not so much, it's just been running. - Specifying a zeroconf port in the raspotify config file (`LIBRESPOT_ZEROCONF_PORT`) has no effect - For now i just disabled zeroconf (and entered my username+password in the raspotify config file), and it works again.
kerem 2026-02-27 19:31:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@kingosticks commented on GitHub (Jan 26, 2023):

This looks like a system-level issue, not a librespot bug. The Raspotify project should be able to help you.

<!-- gh-comment-id:1404843290 --> @kingosticks commented on GitHub (Jan 26, 2023): This looks like a system-level issue, not a librespot bug. The Raspotify project should be able to help you.
Author
Owner

@kingosticks commented on GitHub (Jan 26, 2023):

Fundamentally the issue is that the librespot binary packaged in Raspotify provides its own Zeroconf server. Your system seems to also have a standalone Zeroconf server running (e.g. Avahi). It probably got installed by another package during your recent system updates. When librespot tries to start its integrated zeroconf server, it finds the port is already taken by Avahi. A solution is to remove Avahi. That might break something else on your system which is using Avahi. An alternate solution is the config change you already did. There is no librespot bug here.

There's some info at https://github.com/dtcooper/raspotify/search?q=with-dns-sd&type=issues

<!-- gh-comment-id:1404857998 --> @kingosticks commented on GitHub (Jan 26, 2023): Fundamentally the issue is that the librespot binary packaged in Raspotify provides its own Zeroconf server. Your system seems to also have a standalone Zeroconf server running (e.g. Avahi). It probably got installed by another package during your recent system updates. When librespot tries to start its integrated zeroconf server, it finds the port is already taken by Avahi. A solution is to remove Avahi. That might break something else on your system which is using Avahi. An alternate solution is the config change you already did. There is no librespot bug here. There's some info at https://github.com/dtcooper/raspotify/search?q=with-dns-sd&type=issues
Author
Owner

@khink commented on GitHub (Jan 26, 2023):

Thanks for taking the time to reply!

Indeed i have avahi.

pi@raspberrypi:~ $ apt list avahi-daemon 
Listing... Done
avahi-daemon/stable,now 0.8-5+deb11u1 armhf [installed]

But disabling it doesn't help:

pi@raspberrypi:~ $ sudo service avahi-daemon stop
Warning: Stopping avahi-daemon.service, but it can still be activated by:
  avahi-daemon.socket
pi@raspberrypi:~ $ sudo vi /etc/raspotify/conf # comment out LIBRESPOT_DISABLE_DISCOVERY=
pi@raspberrypi:~ $ sudo systemctl restart raspotify
pi@raspberrypi:~ $ tail -f /var/log/syslog
...
Jan 26 14:27:10 raspberrypi librespot[23953]: [2023-01-26T13:27:10Z WARN  librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98)
...

Even when i completely remove it:

pi@raspberrypi:~ $ sudo apt remove avahi-daemon 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  bind9-host bind9-libs libavahi-core7 libdaemon0 libfstrm0 libmaxminddb0 libprotobuf-c1 libuv1
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
  avahi-daemon ipp-usb libnss-mdns
0 upgraded, 0 newly installed, 3 to remove and 1 not upgraded.
After this operation, 5,160 kB disk space will be freed.
Do you want to continue? [Y/n] Y

After restart:

Jan 26 14:32:00 raspberrypi librespot[24421]: [2023-01-26T13:32:00Z WARN  librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98)

So are we sure another zeroconf server is running, and if yes how do we find out which one it is? (Also, not sure how the issue search you refer to relates to this though, as none of them is about this "Address already in use" error.)

Update edit: After a reboot, the problem has gone. 💯 for your avahi suggestion. Thanks!

<!-- gh-comment-id:1405018040 --> @khink commented on GitHub (Jan 26, 2023): Thanks for taking the time to reply! Indeed i have avahi. ``` pi@raspberrypi:~ $ apt list avahi-daemon Listing... Done avahi-daemon/stable,now 0.8-5+deb11u1 armhf [installed] ``` But disabling it doesn't help: ``` pi@raspberrypi:~ $ sudo service avahi-daemon stop Warning: Stopping avahi-daemon.service, but it can still be activated by: avahi-daemon.socket pi@raspberrypi:~ $ sudo vi /etc/raspotify/conf # comment out LIBRESPOT_DISABLE_DISCOVERY= pi@raspberrypi:~ $ sudo systemctl restart raspotify ``` ``` pi@raspberrypi:~ $ tail -f /var/log/syslog ... Jan 26 14:27:10 raspberrypi librespot[23953]: [2023-01-26T13:27:10Z WARN librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98) ... ``` Even when i completely remove it: ``` pi@raspberrypi:~ $ sudo apt remove avahi-daemon Reading package lists... Done Building dependency tree... Done Reading state information... Done The following packages were automatically installed and are no longer required: bind9-host bind9-libs libavahi-core7 libdaemon0 libfstrm0 libmaxminddb0 libprotobuf-c1 libuv1 Use 'sudo apt autoremove' to remove them. The following packages will be REMOVED: avahi-daemon ipp-usb libnss-mdns 0 upgraded, 0 newly installed, 3 to remove and 1 not upgraded. After this operation, 5,160 kB disk space will be freed. Do you want to continue? [Y/n] Y ``` After restart: ``` Jan 26 14:32:00 raspberrypi librespot[24421]: [2023-01-26T13:32:00Z WARN librespot] Could not initialise discovery: Setting up dns-sd failed: Address already in use (os error 98) ``` So are we sure another zeroconf server is running, and if yes how do we find out which one it is? (Also, not sure how the issue search you refer to relates to this though, as none of them is about this "Address already in use" error.) Update edit: After a reboot, the problem has gone. :100: for your avahi suggestion. Thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#519
No description provided.