Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapserver HTTP/TCP bind not working after reboot #950

Closed
uroborov opened this issue Dec 6, 2021 · 4 comments
Closed

snapserver HTTP/TCP bind not working after reboot #950

uroborov opened this issue Dec 6, 2021 · 4 comments
Labels

Comments

@uroborov
Copy link

uroborov commented Dec 6, 2021

Everytime i reboot odroid snapserver is unable to bind to the HTTP/TCP addresses. after sudo systemctl restart snapserver everything works fine. Am i missing something?

Environment details

  • OS: ubuntu lite on odroid xu4
  • Last Snapcast version [e.g. 0.21.0] + mopidy
  • Installed from deb packages

here is the journalctl. straight after reboot:

-- Reboot --
Dec 06 16:26:32 efesto systemd[1]: Started Snapcast server.
Dec 06 16:26:32 efesto snapserver[344]: Version 0.25.0, revision 2af5292f
Dec 06 16:26:32 efesto snapserver[344]: Adding source: pipe:///tmp/snapfifo?name=EFESTO-Server
Dec 06 16:26:32 efesto snapserver[344]: Settings file: "/var/lib/snapserver/server.json"
Dec 06 16:26:33 efesto snapserver[344]: Failed to create client: Daemon not running
Dec 06 16:26:33 efesto snapserver[344]: PcmStream: EFESTO-Server, sampleFormat: 48000:16:2
Dec 06 16:26:33 efesto snapserver[344]: Stream: EFESTO-Server, metadata={
Dec 06 16:26:33 efesto snapserver[344]:     "STREAM": "EFESTO-Server"
Dec 06 16:26:33 efesto snapserver[344]: }
Dec 06 16:26:33 efesto snapserver[344]: onMetaChanged (EFESTO-Server)
Dec 06 16:26:33 efesto snapserver[344]: PipeStream mode: create
Dec 06 16:26:33 efesto snapserver[344]: Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac",">
Dec 06 16:26:33 efesto snapserver[344]: Init - compression level: 2
Dec 06 16:26:33 efesto snapserver[344]: Exception: end of file
Dec 06 16:26:33 efesto snapserver[344]: Creating TCP acceptor for address: 192.168.1.15, port: 1705
Dec 06 16:26:33 efesto snapserver[344]: error creating TCP acceptor: bind: Cannot assign requested address, code: system:99
Dec 06 16:26:33 efesto snapserver[344]: Creating HTTP acceptor for address: 192.168.1.15, port: 1780
Dec 06 16:26:33 efesto snapserver[344]: error creating HTTP acceptor: bind: Cannot assign requested address, code: system:99
Dec 06 16:26:33 efesto snapserver[344]: Creating stream acceptor for address: 0.0.0.0, port: 1704
Dec 06 16:26:33 efesto snapserver[344]: Number of threads: 4, hw threads: 8
Dec 06 16:27:45 efesto snapserver[344]: Received signal 15: Terminated
Dec 06 16:27:45 efesto snapserver[344]: Stopping streamServer
Dec 06 16:27:45 efesto systemd[1]: Stopping Snapcast server...
Dec 06 16:27:45 efesto snapserver[344]: done
Dec 06 16:27:45 efesto snapserver[344]: Snapserver terminated.
Dec 06 16:27:45 efesto systemd[1]: snapserver.service: Succeeded.

after sudo systemctl restart snapserver:

Dec 06 16:27:45 efesto systemd[1]: Stopped Snapcast server.
Dec 06 16:27:45 efesto systemd[1]: Started Snapcast server.
Dec 06 16:27:45 efesto snapserver[625]: Version 0.25.0, revision 2af5292f
Dec 06 16:27:45 efesto snapserver[625]: Adding source: pipe:///tmp/snapfifo?name=EFESTO-Server
Dec 06 16:27:45 efesto snapserver[625]: Settings file: "/var/lib/snapserver/server.json"
Dec 06 16:27:45 efesto snapserver[625]: Failed to create client: Daemon not running
Dec 06 16:27:45 efesto snapserver[625]: PcmStream: EFESTO-Server, sampleFormat: 48000:16:2
Dec 06 16:27:45 efesto snapserver[625]: Stream: EFESTO-Server, metadata={
Dec 06 16:27:45 efesto snapserver[625]:     "STREAM": "EFESTO-Server"
Dec 06 16:27:45 efesto snapserver[625]: }
Dec 06 16:27:45 efesto snapserver[625]: onMetaChanged (EFESTO-Server)
Dec 06 16:27:45 efesto snapserver[625]: PipeStream mode: create
Dec 06 16:27:45 efesto snapserver[625]: Stream: {"fragment":"","host":"","path":"/tmp/snapfifo","query":{"chunk_ms":"20","codec":"flac",">
Dec 06 16:27:45 efesto snapserver[625]: Init - compression level: 2
Dec 06 16:27:45 efesto snapserver[625]: Exception: end of file
Dec 06 16:27:45 efesto snapserver[625]: Creating TCP acceptor for address: 192.168.1.15, port: 1705
Dec 06 16:27:45 efesto snapserver[625]: Creating HTTP acceptor for address: 192.168.1.15, port: 1780
Dec 06 16:27:45 efesto snapserver[625]: Creating stream acceptor for address: 0.0.0.0, port: 1704
Dec 06 16:27:45 efesto snapserver[625]: Number of threads: 4, hw threads: 8
Dec 06 16:27:45 efesto snapserver[625]: StreamServer::NewConnection: 192.168.1.10
Dec 06 16:27:45 efesto snapserver[625]: Hello from 14:da:e9:c8:c5:ba#2, host: ODISSEO, v0.25.0, ClientName: Snapclient, OS: Windows 8, Ar>
Dec 06 16:27:45 efesto snapserver[625]: ControlServer::NewConnection: 192.168.1.10
Dec 06 16:27:45 efesto snapserver[625]: ControlServer::NewConnection: 192.168.1.10
Dec 06 16:27:45 efesto snapserver[625]: Removing 1 inactive session(s), active sessions: 2
Dec 06 16:27:46 efesto snapserver[625]: StreamServer::NewConnection: 192.168.1.4
Dec 06 16:27:46 efesto snapserver[625]: Hello from dc:a6:32:a9:d0:a4, host: APOLLO, v0.25.0, ClientName: Snapclient, OS: 10.0.0, Arch: aa>
Dec 06 16:27:46 efesto snapserver[625]: Removing 1 inactive session(s), active sessions: 2
@uroborov
Copy link
Author

uroborov commented Dec 6, 2021

issue seems to be gone by changing the systemd unit file for snapserver:

removed:
After=network.target

added:
After=network-online.target
Wants=network-online.target

@badaix
Copy link
Owner

badaix commented Dec 6, 2021

Will it also work without the Wants? I.e. just with:

After=network-online.target

@uroborov
Copy link
Author

Will it also work without the Wants? I.e. just with:

After=network-online.target

sorry badaix, just read your reply. i will try without the wants argument as soon I can find some time. After that fix everything ran smooth on odroid. However i am now moving everything as docker on my synology, where snapserver doesn't run as a service

@badaix
Copy link
Owner

badaix commented Dec 15, 2021

I just saw that there was a similar issue with Snapclient in the past and the fix was to change from After network to After network-online.
I'm just afraid that the server might not be started if the (maybe unnecessary strong) preconditions are not met.

@badaix badaix added the bug label Dec 19, 2021
@badaix badaix closed this as completed Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants