Closed davidandreoletti closed 7 months ago
Describe the bug Snapserver reports bind: address in use for port 1704, 1705,1780 despite no other process listening on these port (via netstat)
bind: address in use
Steps to Reproduce
snapserver --server.threads=2 --server.user=root --server.group=root --stream.port=1704 --stream.bind_to_address=0.0.0.0 --stream.bind_to_address=:: --http.enabled=true --http.bind_to_address=0.0.0.0 --http.bind_to_address=:: --http.port=1780 --tcp.enabled=true --tcp.bind_to_address=0.0.0.0 --tcp.bind_to_address=:: --tcp.port=1705
1
Environment details
5 [Info] (Snapserver) Version 0.28.0.1 2024-04-01 23-14-16.596 [Info] (Snapserver) Adding source: pipe:///tmp/snapfifo?name=default ... 2024-04-01 23-14-16.630 [Info] (PcmEnc) Init 2024-04-01 23-14-16.630 [Info] (FlacEnc) Init - compression level: 2 2024-04-01 23-14-16.630 [Info] (ControlServer) Creating TCP acceptor for address: 0.0.0.0, port: 1705 2024-04-01 23-14-16.631 [Info] (ControlServer) Creating TCP acceptor for address: ::, port: 1705 2024-04-01 23-14-16.638 [Error] (ControlServer) error creating TCP acceptor: bind: Address in use [system:98 at /var/tmp/openwrt/build/package/davida-router-hw1/friendlyarm_nanopi-r4s/package/openwrt-sdk-Linux-x86_64/staging_dir/target-aarch64_generic_musl/usr/include/boost/asio/detail/reactive_socket_service.hpp:161 in function 'bind'], code: system:98 2024-04-01 23-14-16.639 [Info] (ControlServer) Creating HTTP acceptor for address: 0.0.0.0, port: 1780 2024-04-01 23-14-16.639 [Info] (ControlServer) Creating HTTP acceptor for address: ::, port: 1780 2024-04-01 23-14-16.639 [Error] (ControlServer) error creating HTTP acceptor: bind: Address in use [system:98 at /var/tmp/openwrt/build/package/davida-router-hw1/friendlyarm_nanopi-r4s/package/openwrt-sdk-Linux-x86_64/staging_dir/target-aarch64_generic_musl/usr/include/boost/asio/detail/reactive_socket_service.hpp:161 in function 'bind'], code: system:98 2024-04-01 23-14-16.640 [Info] (StreamServer) Creating stream acceptor for address: 0.0.0.0, port: 1704 2024-04-01 23-14-16.640 [Info] (StreamServer) Creating stream acceptor for address: ::, port: 1704 2024-04-01 23-14-16.640 [Error] (StreamServer) error creating TCP acceptor: bind: Address in use [system:98 at /var/tmp/openwrt/build/package/davida-router-hw1/friendlyarm_nanopi-r4s/package/openwrt-sdk-Linux-x86_64/staging_dir/target-aarch64_generic_musl/usr/include/boost/asio/detail/reactive_socket_service.hpp:161 in function 'bind'], code: system:98 2024-04-01 23-14-16.641 [Info] (Snapserver) Number of threads: 2, hw threads: 6
Investigation
--stream.bind_to_address=::
<IPv4,1704>
<IPv6,1704>
Workaround
I think that the socket is not an IP_V6ONLY socket, and thus :: should accept IPv4 and IPv6, so please try to remove the binds to 0.0.0.0
IP_V6ONLY
::
0.0.0.0
Using :: allow IPv4 an IPv6 client to connect.
Describe the bug Snapserver reports
bind: address in use
for port 1704, 1705,1780 despite no other process listening on these port (via netstat)Steps to Reproduce
snapserver --server.threads=2 --server.user=root --server.group=root --stream.port=1704 --stream.bind_to_address=0.0.0.0 --stream.bind_to_address=:: --http.enabled=true --http.bind_to_address=0.0.0.0 --http.bind_to_address=:: --http.port=1780 --tcp.enabled=true --tcp.bind_to_address=0.0.0.0 --tcp.bind_to_address=:: --tcp.port=1705
1
's command again.Environment details
Investigation
--stream.bind_to_address=::
reports no error for port 1704`.<IPv4,1704>
and<IPv6,1704>
are 2 distinct address, the server should listen on both.Workaround