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

tcp:: or quic:: fail to bind 22000 at all if only one of ipv4 or ipv6 is enabled #6145

Closed
jackwasey opened this issue Nov 10, 2019 · 2 comments
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@jackwasey
Copy link

actual:

If ipv6 is disabled at system level, e.g. kernel command line or sysctl, then setting tcp:// or quic:// will fail for all protocols, giving the OP's reported behavior, although without a relevant message from kernel or syncthing that I can identify. Switch to tcp4...,/quic4 eliminated this error for me.

syncthing --version
# syncthing v1.3.1 "Fermium Flea" (go1.13.3 linux-amd64) deb@build.syncthing.net 2019-10-07 11:30:25 UTC
cat /proc/sys/net/ipv6/conf/*/disable_ipv6
1
1
1
...
# then the syslog shows only the following, with IP address redacted
Listen (BEP/quic): listen udp a.b.c.d:22000: bind: cannot assign requested address

expected:

syncthing listens on either ipv4 or ipv6, with notice that the other was not possible.

grep syncthing.*listener /var/log/syslog
# gives me ... INFO: TCP listener (a.b.c.d:22000) starting

Version Information

Syncthing Version: v1.3.1
OS Version: Ubuntu Eoan 19.10 5.3.0-19-generic

@calmh
Copy link
Member

calmh commented Nov 10, 2019

Doesn't reproduce for me, but on the other hand IPv6 doesn't seem to disable fully either (Ubuntu 18.04).

jb@test:~ $ sysctl -a 2>/dev/null | grep disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.ens33.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
jb@test:~ $ syncthing -home asd
...
[start] 13:04:09 INFO: syncthing v1.3.1 "Fermium Flea" (go1.13.3 linux-amd64) deb@build.syncthing.net 2019-10-07 11:30:25 UTC
[start] 13:04:09 INFO: Generating ECDSA key and certificate for syncthing...
[start] 13:04:09 INFO: Default folder created and/or linked to new config
[start] 13:04:09 INFO: Default config saved. Edit /home/jb/asd/config.xml to taste (with Syncthing stopped) or use the GUI
...
[QPPMM] 13:04:10 INFO: TCP listener ([::]:22000) starting
[QPPMM] 13:04:10 INFO: QUIC listener ([::]:22000) starting
...

(no errors)

jb@test:~ $ netstat -anp | grep 22000
tcp6       0      0 :::22000                :::*                    LISTEN      4648/syncthing
udp6       0      0 :::22000                :::*                                4648/syncthing

(still udp6/tcp6)

Then again, the tcp4/quic4 schemes sound like they were made for your use case.

@AudriusButkevicius
Copy link
Member

I don't think this is true.

By default tcp in go means dual stack and go tries both stacks internally, and succeeds if any of them succeed.

Can you provide strace output for bind/listen calls failing?

@calmh calmh closed this as completed Jan 26, 2020
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jan 26, 2021
@syncthing syncthing locked and limited conversation to collaborators Jan 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

4 participants