syntching cannot connect to private strelaysrv

Hello,

I am new to this forum as well as I am new user of syncthing so my apologies if I should not ask about the relay server in this forum perhaps, not sure admin may just delete the post if it is wrong.

I have successfully installed syncthing and I got it working between an windows and mac in not time without any issues. I see that they are using the local lan connection since both of those are on the same LAN network so this is ok public relay is not used.

So the case is that I have two more pc`s that are outside of this LAN and they are located on totally different location and they need to use public relay in order to be able to reach those two other pc/mac. In this case I want to use private relay server which I also managed to start on one windows pc, I also opened the ports on the firewall so it is reachable from the internet via port 22067.

Now all of the PC and mac both those on local lan as well as those remote ones have configured relay server in Connections tab, the only difference is of course that remote ones need to use WAN ip address whereas those two that are on the same LAN they use internal ip to reach the relay that is on the same network as those two pc/mac I mentioned in the beginning. The problem is now that all clients receives the message:

global discovery unsupported scheme relay

for relay server URL I have of course used the full relay:// URL provided by the strelaysrv upon first startup… I use complete URL

I read a bit about this warning on this link: What does "Global discovery: unsupported scheme announce.syncthing.net" mean and someone mentioned wrong version…

I am running strelaysrv 1.22.1 and Syncthing ver 1.27.3

I see that relay server ver is very old (2 years) if I am not mistaken, so if this still valid version to be used or there is newer ones out ??

thank you!

Best regards Ken

Hi and welcome to the forum. This is the right place.

Your problem is that the address should not be entered under discovery servers. That’s a different thing. Instead, it must go into the Sync Protocol Listen Addresses field. You can just append it with a comma after the “default” value.

Note that if you can open firewall ports, you could do this directly for the client devices, without a custom relay server in between. See Firewall Setup — Syncthing documentation

2 Likes

Hi Andre,

thank you for quick response!!

Ok I have now edited the settings and I put the “default” back on to Global Discovery Servers field and I added URL only on to the field above it named: “Sync Protocol Listening Address” but it still seems that PC outside of the network can not connect to the Relay although the port is opened and Relay server is visible to public. Regarding direct connections between the clients via FW I need some time to figure out this part, I found this with relay kinda more “logic” …

Btw I do not see any warning messages anymore but it still can not connect to the relay server, need to try a bit more…

Look at the “Listeners” entry under your own device section in the GUI. It says how many of the configured listen addresses could be activated successfully. Click it and it will show details, especially an error message in case the relay server can’t be reached.

1 Like

ok, so far I have managed following:

  1. relay setup and open ports towards it
  2. two pc that are on the same network as relay server can connect to each other via this relay server and they can exchange files
  3. remote pc which uses WAN ip address to reach the relay server can also connect to the relay server successfully

BUT, the problem is I am not able to add any devices on to this remote PC that is outside of the relay server network even tough it is connected to the relay server and I should then be able to add devices but when I add the device I got the message Device disconnected …

So to sum up, only pc that are on the same LAN as relay server canboth connect to relay and add them self to each other in the device list whereas the remote pc can ONLY connect to the relay server but it can not add any of those two devices that are on the same lan as relay server.

log on remote pc: relay://ip_addres:22067… relay relay://ip_addres:22067… starting relay://ip_addres:22067… shutting down, timeout…

I did not type the ip address because of the security reasons…

It seems pretty clear from those log messages, that the relay server is in fact not reachable through the firewall from the outside. How do you get the impression that it is in fact connected successfully?

If you mean with “cannot add device”, that the ID is not listed as a suggestion below the device ID field, this is expected. Those only work for local discovery on the same LAN. You’ll need to enter the device ID manually on the other side. And of course mutually, as a connection configured on only one end will not be established.

Actually, if they are configured mutually, both sides will try to connect, so you can check both logs for hints. And also do have a look at the discovered addresses listed in the device section, along with possibly error messages for every address tried.

Did you have a look at the listener status? Is it showing the relay ad being joined successfully?

1 Like

well it`s kinda strange not sure if we can say that relay is not reachable because for the first I see that traffic is hitting the access list (firewall rule) on my Mikrotik router and second is the screen shot below for example from an iPhone (it is exact same for remote pc same situations) it shows 1/1 green status (listeners) and it sudenly goes bac to 0/1 red color and again 1/1 green so it is able to connect but it gets disconnected after aprox 15-30 sec period… please see uploaded screen shot from iPhone running Mobius Sync.

We can’t really say anything about Möbius Sync. It’s a commercial application which has its own support channels and the creators should be asked about what it’s doing. Being based on, and supposedly compatible with, Syncthing doesn’t mean much here.

It could very well be the iOS system deciding that this idle connection does not need to be kept alive. Who knows…

Having only this one listener is a strange configuration, however. I’d say keeping the “default” keyword in there as well makes sense. Do you have any screenshot of the error message in the state where 0/1 listeners are active? Probably best with a bigger screen to show the whole message.

1 Like

ok, got that… I now made tests from another windows PC which is out on the internet and I tried to connect from that windows towards the relay server via WAN ip, see the attached screen shots in the sequence from the top to bottom for what is exactly going on… It tries to connect, gets connected then it disconnect and so on all the time… so it can form the session but it does not hold for a long period…

as you can see in this last screen shot, this is how it looks like when it finally get connected to the relay server. And I have already opened the port 22067 towards the relay server on the firewall.

Do the relay server logs indicate any more useful error message, besides the connection dropping? Is the timing predictable, i.e. how long between each connection and disconnecting?

1 Like

hm I think I could get used for some help on what is the best way to get the logs out now because I think that that syncthing documentation does not shows us complete usage of the commands for example now I have started the strelaysrv like this in windows

C:\strelaysrv-windows-amd64-v1.22.1>strelaysrv.exe -pools=“”

so now I am not supposed ro run any other commands while the service is up and running… I need to interrupt it again or is there something I am missing here? documentation is mentioning a lot of commands but not how to use those commands … so I only found out that one I wrote here above worked for me but it all stops there since I am new to syncthing and its relay server in general. How can I check the current logs or run the debug when it is already up and running ?

I too would have to check what the relevant options are, never used them myself.

I just think you might be better off getting direct connections to work first, without using a custom relay. Opening two ports in the firewall for two devices is still simpler than opening one port and setting up a custom relay server. Plus the configuration on each device can then just be set to default.

1 Like

no worries dude thank you very much for helping! Well perhaps you`re right it would be even better to fix this without relay at least easier, but not sure how do I configure two hosts to sync with each other when one of them is out on the internet… ? opening ports is ok but where do I type the syncthing remote PC address in the source pc and vice versa ? is it also in the Connections - Syncthing Listening Address ? just remove the relay URL and paste what ? I am a bit confused about this because this field Listening Address is this the ip adderss that LOCAL PC itself is listening on OR remote PC listening address ?

thank you again ! Still learning…

Just leave everything at default values. Syncthing is made to do what you want, choosing a local connection if possible and finding some way to establish a connection through the internet if required. It has a couple of tricks implemented to make these connections even under difficult circumstances, with relay servers being the last resort if all else fails.

Just open up the ports (for IPv6 if that works for you), or forward them (for IPv4 with NAT involved). Let Syncthing’s magic do the rest.

1 Like

The Docs probably assume that if someone wants to run a custom relay server, they are already well accustomed to the command line, etc., which I’d argue isn’t really that unreasonable :sweat_smile:.

If you still want to run a relay server in Windows in an unobtrusive manner, you can follow the same guide as for how to start Syncthing with Task Scheduler (see https://docs.syncthing.net/users/autostart.html). Just replace the commands with what you need for strelaysrv.exe. Of course, before doing all that, you should make sure that the commands and server itself actually work.

As for entering remote device IP addresses, that is done in the device editing dialog, under advanced.

1 Like

my goal here was to avoid using any public relay so when everything is on default apart from Global Discovery two pc on same LAN find each other in not time this part is working but two pc where one is on LAN and another is remote out in the internet want be able to find each other without the relay server or will they ? if I just open the ports to that specific pc and it will work then ?

thank you for the tip, running relay on windows now is just a test it will run on another OS not windows… I am just testing…

the documentations should never “assume” anything regarding the user knowledge or/and experience but instead “show” everything even some examples how the command is formed as a complete command, should not be that difficult ? :slight_smile:

ah ok, got that now… I think I will figure it out now, thanks a lot!

Well if you want to avoid public relays, you can just disable relaying completely. Setting up your own relay server doesn’t give any advantage over just setting up external port access for the devices themselves.

And you should ask yourself for what reason do you want to avoid public relays? They are only used as a fallback, as explained. If a better connection is available, that replaces the relay connection. And in any case, the data is always encrypted in transit, so what is it you fear that using public relays seems troublesome for you?

1 Like