Can't bind listenAddress

I would like to use a specific listen address but I encounter problems.

First I would like to know what the listenAddress is used for, the documentation says “The listen address for incoming sync connections.” but it is still not obvious for me. Is a incoming sync connection when, e.g., some other device tries to share a folder?

I’m trying to use 10.100.0.3:22000 which is the IP for the interface. First i get multiple errors but then suddenly the listener service seem to successfully start.

I have used netstat to check if the address and port is used by something else but it’s not, at least not until syncthing manage to set up the listener as described above.

Here is the output form syncthing:

Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: Listen (BEP/tcp): listen tcp4 10.100.0.3:22000: bind: cannot assign requested address
Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: listenerSupervisor@tcp4://10.100.0.3:22000: service tcp4://10.100.0.3:22000 failed: listen tcp4 10.100.0.3:22000: bind: cannot assign requested address
Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: Listen (BEP/tcp): listen tcp4 10.100.0.3:22000: bind: cannot assign requested address
Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: listenerSupervisor@tcp4://10.100.0.3:22000: service tcp4://10.100.0.3:22000 failed: listen tcp4 10.100.0.3:22000: bind: cannot assign requested address
Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: Listen (BEP/tcp): listen tcp4 10.100.0.3:22000: bind: cannot assign requested address
Jan 16 16:59:18 syncthing[6226]: [VDYMD] INFO: listenerSupervisor@tcp4://10.100.0.3:22000: service tcp4://10.100.0.3:22000 failed: listen tcp4 10.100.0.3:22000: bind: cannot assign requested address

And about 1,5 minutes later:

Jan 16 17:00:44 syncthing[6226]: [VDYMD] INFO: TCP listener (10.100.0.3:22000) starting

Netstat output once the listener successfully started:

tcp 0 0 10.100.0.3:22000 0.0.0.0:* LISTEN 6243/syncthing

Thanks in advance!

It’s used to talk to other devices. “Cannot assign requested address” often means you don’t have that IP.

1 Like

Thanks.

How does the listenAddress parameter differ from the address parameter in the device element?

<device id="S7UKX27-GI7ZTXS-GC6RKUA-7AJGZ44-C6NAYEB-HSKTJQK-KJHU2NO-CWV7EQW" name="syno" compression="metadata" introducer="false" skipIntroductionRemovals="false" introducedBy="2CYF2WQ-AKZO2QZ-JAKWLYD-AGHMQUM-BGXUOIS-GYILW34-HJG3DUK-LRRYQAR">
    <address>tcp4//10.100.0.3:22000</address>
</device>

I do have an interface with that IP and the state is UP when syncthing tries to set up the listener.

One is where we receive connection, the other is how we connect to other device (i.e., their listening address).