chme / forked-daapd-web

Web interface for forked-daapd
GNU General Public License v2.0
2 stars 0 forks source link

forked-daapd.local and "Connection lost. Reconnecting ..." #3

Open ejurgensen opened 6 years ago

ejurgensen commented 6 years ago

If I connect to the webinterface using the CNAME address, http://forked-daapd.local:3689, then the page loads, but it then says "Connection lost. Reconnecting ..." for quite a while. It then seems to work fine. This is using Chrome. Something with libwebsockets, perhaps? Probably hard to solve, but thought I would let you know.

MS Edge doesn't work with the CNAME at all. I would have thought that address resolution was the OS's job, so that it would either work with all browsers, or it wouldn't. Guess not...

Porco-Rosso commented 6 years ago

I am having the same problem, it's more of an annoyance than a showstopper, but I would like to help debug if I could. I believe it is tied to the same issues I mentioned here: https://github.com/ejurgensen/forked-daapd/pull/538

My logs from /usr/sbin/forked-daapd -f show:


[  LOG]     main: Forked Media Server Version 26.0 taking off
[  LOG]     main: Built with:
[  LOG]     main: - ffmpeg
[  LOG]     main: - iTunes XML
[  LOG]     main: - LastFM
[  LOG]     main: - Chromecast
[  LOG]     main: - MPD
[  LOG]     main: - Device verification
[  LOG]     main: - Websockets
[  LOG]     main: - ALSA
[  LOG]     main: - Pulseaudio
[  LOG]     main: mDNS init
[  LOG]     mdns: Avahi state change: Client running
[  LOG]       db: Now vacuuming database, this may take some time...
[  LOG]       db: Database OK with 10760 active files and 198 active playlists
[  LOG]   laudio: Pulseaudio failed with error: Connection refused
[  LOG]   laudio: Error initializing Pulseaudio: Connection refused
[2018/06/09 10:21:05:2372] NOTICE: libuv support not compiled in
[2018/06/09 10:21:05:2372] NOTICE: Creating Vhost 'default' port 3688, 2 protocols, IPv6 off
[2018/06/09 10:21:05:2372] ERR: ERROR on binding fd 47 to port 3688 (-1 98)
[2018/06/09 10:21:05:2372] ERR: init server failed
[2018/06/09 10:21:05:2372] ERR: Failed to create default vhost
[  LOG]      web: Failed to create websocket context
[FATAL]    httpd: Websocket init failed
[FATAL]     main: HTTPd thread failed to start
[  LOG]     main: Player deinit
[  LOG]     main: Library scanner deinit
[  LOG]      lib: Library init scan completed in 3 sec (3 changes)
[  LOG]     main: Cache deinit
[  LOG]     main: Worker deinit
[  LOG]     main: Database deinit
[  LOG]     main: mDNS deinit
[  LOG]     main: Exiting.```
chme commented 6 years ago

@Porco-Rosso libwebsockets failed binding to the default port 3688 for the websocket. Maybe another application is already using this port? Could you try with a different port (you can change it by setting a different value for "websocket_port" in forked-daapd.conf under the general section).

chme commented 6 years ago

Or maybe an instance of forked-daapd is already running? And if you compile from ejurgensen master (or from the v26.1 sources), the libwebsockets logs will appear in the forked-daapd log file.

Porco-Rosso commented 6 years ago

Killing forked-daapd and restarting it seems to fix this issue, but eventually it returns after awhile.

Will try recompiling from master and trying different ports in a few days when I have time. I doubt anything is trying to use the same ports, but who knows.