Connected to myself - should not happen

The When starting syncthing I get the following code:

[MGG2A] 13:46:40 INFO: Connected to myself (MGG2AF4-AR5Y7BD-VHRJGDW-5JVLX6R-5BNNFAT-TVJ7C5U-VX5VQS6-D4YGZAV) - should not happen
[MGG2A] 13:46:40 INFO: TLS handshake: WSARecv tcp 192.168.1.33:50046: An existing connection was forcibly closed by the remote host.
[MGG2A] 13:46:57 INFO: Established secure connection to OVSOI6W-TAYZFMX-GENVPTO-EKEFVQ4-JMDAK3R-B7JVEPL-FJE4WWV-SWI2LAZ at 192.168.1.33:22000-83.37.232.138:49606

Right after this executes my system detects all my other computers and syncs perfectly. But I’m not really sure about the “connected to myself” thing. Is this a misconfiguration on my side? Thanks :coffee:

It seems that two machines might have the same certificates (hence the same ID) and end up connecting to each other. Otherwise, you config.xml might have some errors?

I checked and all my systems have different ID’s is there any way to list all ID’s a computer has registered as ‘nodes’ and manually delete an entry? Every now and then my machine connects to itself and halts all syncing.

And thanks for such a quick response!!


:watermelon:

I mean I am looking at the code, and this seems to be impossible, as we always check before connecting to someone that that someone is not ourself:

So even two nodes having the same set of certificates shouldn’t be able to cause this. Perhaps you share the same certificate with some other service which then by accident connects to syncthings port?!

I don’t know, you have to provide steps how to reproduce it, as it seems impossible to me.

Is NATting to blame?

OH, actually NAT may be to blaim, I had to define a port redirection in my router so my machines could see eachother, so I pointed port 22000 to the IP of my machine.

I thought this was the correct way to do this.

I had this happen a lot, and indeed port forwarding is the problem. If the two nodes are on the same network and then find each other through the global discovery server both will be forwarded to the same IP when connecting back. For some reason local discovery dosen’t seem to happen that often. I’m trying out setting a local IP adress as an explicit first adress for all nodes i.e. in my case the IP of the node is set to 10.0.1.5:22000,dynamic, which seems to lead to a succesfull local connection most of the time.

I have the same setup: portforwarding for all nodes to be reachable from the outside (via dynDNS), but global and local discovery disabled. All nodes on same lan only have internalname:port as address - but this “error” still happens sometimes. This “error” is weird, because it “should not happen” but it happens :stuck_out_tongue_winking_eye: and the user cannot change anything…

Is there any improvement on this? I still observe this.

It’s caused by misconfiguration.

I had the same error and it stopped after I enabled UPnP on my router. Its may be causes because in syncthing I enabled the option for UPnP without enabling UPnP on my router but I used a manual mapping instead

It’s most likely that your manual mapping was incorrect, hence why it happened.

Two boxes behind the same NAT will cause this as well, if local discovery isn’t working for whatever reason.

(Global discovery returns the external IP for both devices, and one of them will be be port mapped at 22000, which when it tries to connect to the other gets forwarded to itself and closes the connection with this message.)

I have no UpnP enabled and no second box behind a NAT.

You still might have something misconfigured.

1 Like

I honestly doubt that. We are not talking about accessible devices behind the NAT / port forward, but syncthing devices in general.

If you have 2 devices at home, one with a port forward and both have global discovery enabled, the discovery server has both devices with the same IP and port in the list. As soon as the device without the forward isn’t reachable locally any more, the device with the port forward will try to connect through global discovery, gets your internet IP and his own listening port and tries to connect to itself.

You will have to either disable global discovery or assign a unique listening port to every device. (I did the latter, and the messages about “conected to myself” stopped)

2 Likes

It’s also just an informational message. It happening, whatever the cause, doesn’t hurt anything and it can be safely ignored.

This is what you end up with having two devices in you local network with standard settings.

Yes, and UPnP deals with this by mapping a pseudo-random port. If you do not have UPnP and you want both devices to be accessible from the outside, you need to move one of them on a different port (22001 for example), and make sure the port you map on the gateway matches the the listen port.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.