owntone / owntone-server

Linux/FreeBSD DAAP (iTunes) and MPD audio server with support for AirPlay 1 and 2 speakers (multiroom), Apple Remote (and compatibles), Chromecast, Spotify and internet radio.
https://owntone.github.io/owntone-server
GNU General Public License v2.0
2.09k stars 235 forks source link

Trouble starting forked-daapd (Remote,mDNS) #354

Closed ed050 closed 7 years ago

ed050 commented 7 years ago

Hello,

I have a problem starting forked-daapd. I believe it is something to do with mdns/avahi in conjunction with remote service. After quite a bit of research, I haven't found a solution. As far as I know, avahi-daemon is running and up to date. The program seems to scan some files, but doesn't complete before exiting.

Here's the relevant part of the log:

[2017-02-14 23:23:44] [ LOG] mdns: Avahi state change: Client connecting [2017-02-14 23:23:44] [ LOG] db: Now vacuuming database, this may take some time... [2017-02-14 23:23:44] [ LOG] db: Database OK with 201 active files and 6 active playlists [2017-02-14 23:23:44] [ LOG] mdns: Failed to create service browser: Bad state [2017-02-14 23:23:44] [ LOG] raop: Could not add mDNS browser for AirPlay devices [2017-02-14 23:23:44] [ WARN] ffmpeg: First timestamp is missing, assuming 0. [2017-02-14 23:23:44] [ LOG] mdns: Failed to create service browser: Bad state [2017-02-14 23:23:44] [FATAL] remote: Could not browse for Remote services [2017-02-14 23:23:44] [FATAL] main: Remote pairing service failed to start [2017-02-14 23:23:44] [ LOG] main: MPD deinit [2017-02-14 23:23:44] [ LOG] main: HTTPd deinit [2017-02-14 23:23:44] [ LOG] main: Player deinit [2017-02-14 23:23:44] [ LOG] scan: Scanned 200 files... [2017-02-14 23:23:44] [ LOG] main: Library scaner deinit [2017-02-14 23:23:44] [ LOG] lib: Library init scan completed in 0 sec [2017-02-14 23:23:44] [ LOG] main: Cache deinit [2017-02-14 23:23:44] [ LOG] main: Worker deinit [2017-02-14 23:23:44] [ LOG] main: Database deinit [2017-02-14 23:23:44] [ LOG] main: mDNS deinit [2017-02-14 23:23:44] [ LOG] main: Exiting.

Appreciate any suggestions or help as I'm hoping to be able to make use of forked-daapd!

Thanks for your time, Ed

ejurgensen commented 7 years ago

Not sure, don't recall seeing this before. Normally you should see the message "Avahi state change: Client running", but here it only says client connecting, so it would seem the mdns client is never able to actually connect to Avahi. Could it be a permission problem?

Can you provide a bit more information about the platform (OS)? Perhaps I can recreate.

ed050 commented 7 years ago

I'm running forked-daapd as root in the conf file, so I wouldn't have thought permissions would be a problem. It's running on Ubuntu 14.04.5 with a few other services, eg. Sonarr, Kodi. Don't know if that's helpful, but let me know if you need a more thorough list.

ejurgensen commented 7 years ago

Well, Ubuntu 14.04 is pretty well tested as that is my dev machine. What forked-daapd is doing here is launching a client that will browse for mdns announcements (e.g. Airplay) on your network. It doesn't seem logical that other services should affect that, but who knows. Maybe Avahi has logged something that can provide a clue? I think Avahi logs in /var/log/messages.

ed050 commented 7 years ago

Couldn't find the specific Avahi logs, but this is from Syslog. Clearly something going on with Avahi (running on PID 0?). I tried upgrading to Ubuntu 16.04 to see if that 'refreshed' or changed anything, but same log and errors.

Feb 17 18:36:09 mediaserver dbus[789]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' Feb 17 18:36:09 mediaserver systemd[1]: Starting Avahi mDNS/DNS-SD Stack... Feb 17 18:36:09 mediaserver avahi-daemon[10907]: Daemon already running on PID 0 Feb 17 18:36:09 mediaserver systemd[1]: avahi-daemon.service: Main process exited, code=exited, status=255/n/a Feb 17 18:36:09 mediaserver systemd[1]: Failed to start Avahi mDNS/DNS-SD Stack. Feb 17 18:36:09 mediaserver systemd[1]: avahi-daemon.service: Unit entered failed state. Feb 17 18:36:09 mediaserver systemd[1]: avahi-daemon.service: Failed with result 'exit-code'.

ejurgensen commented 7 years ago

Have you tried this: https://bugzilla.redhat.com/show_bug.cgi?id=1050201#c2

ed050 commented 7 years ago

Thank you!! I ended up just deleting the /var/run/avahi-daemon/pid directory then running Forked-Daapd. All seems to be working now! Thanks again for your time and help :)