Syncthing isn't working all of a sudden

I don’t know if it has anything to do with it, but my windows PC installed an update from patch tuesday this morning, and Syncthing isn’t loading on reboot. I tried 3 times. It leaves a console window open, and when I try to access the GUI on the machine, it can’t find it.

Any ideas?

edit: I can run and start it manually. Must be something windows did with the startup.

Which method or tool do you use to start Syncthing on boot?

Windows task manager, as per the instructions. Or one of them anyway. I tried to setup synctrazor after I got Syncthing running, but it started a new instance. I only wanted one. thanks, jts

I just ran the batch to get it back up this morning.

I assume that you mean the Task Scheduler, right? If yes, then can you try to start the task directly from there and see what happens? Although if the console window does pop up, this would suggest that the task itself is at least trying to start Syncthing. Also, there may be something in the Syncthing log file that could indicate the culprit.

Additionally, if this is Windows 10, you may also want to check Windows Defender and see if there is nothing there related to the Syncthing process. On top of that, the Event Viewer can give some information too.

On a reboot, the console window appears with the batch file contents, then it closes and another console window that is blank, no prompt or anything, and it stays there.

The task scheduler says “The operation completed successfully.” on the last boot. There has to be something recent that changed it. It is on Windows 10.

I didn’t see anything in the event viewer, but there is a lot of stuff there, so I may have overlooked it.

I will try Defender and the Syncthing log. thanks, Terry

This sounds strange. Are you using the Task Scheduler configuration recommended in https://docs.syncthing.net/users/autostart.html? Can you perhaps try to delete and re-create the task from scratch just to double check it?

Also, you could export the task as XML and paste the contents of the file here. I can probably check if there is anything unusual there. Just make sure that there is no personal information in the file, e.g. in the file paths and such.

Yes, I tried to follow the recommendation, and it’s been starting perfectly for about two months or so, maybe more. It just started “not starting” today. I will try deleting and rescheduling it. Meanwhile, here is the xml:

<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2020-09-24T22:23:44.2737009</Date>
    <Author>DELL1\TERRY</Author>
    <URI>\Syncthing Start</URI>
  </RegistrationInfo>
  <Triggers>
    <LogonTrigger>
      <Enabled>true</Enabled>
    </LogonTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-1267482001-1716422932-930909332-1001</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>false</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>D:\SYNCTHING\syncthing.bat</Command>
      <WorkingDirectory>D:\SYNCTHING</WorkingDirectory>
    </Exec>
  </Actions>
</Task>

This may be it, but I don’t know how to fix it. From the Syncthing log:

2021-01-13 19:47:19 Couldn't fetch release information: Get "https://upgrades.syncthing.net/meta.json": dial tcp: lookup upgrades.syncthing.net: no such host
2021-01-13 19:47:46 c.S.listenerSupervisor: Exiting backoff state.
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2021-01-13 19:47:46 Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": dial tcp: lookup relays.syncthing.net: no such host
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2021-01-13 19:47:46 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.000000 failures of 2.000000), restarting: true, error: %!s(<nil>)
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2021-01-13 19:47:46 Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": dial tcp: lookup relays.syncthing.net: no such host
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2021-01-13 19:47:46 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (1.999978 failures of 2.000000), restarting: true, error: %!s(<nil>)
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) starting
2021-01-13 19:47:46 Listen (BEP/relay): Get "https://relays.syncthing.net/endpoint": dial tcp: lookup relays.syncthing.net: no such host
2021-01-13 19:47:46 Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2021-01-13 19:47:46 c.S.listenerSupervisor: Entering the backoff state.
2021-01-13 19:47:46 c.S.listenerSupervisor: Failed service 'dynamic+https://relays.syncthing.net/endpoint' (2.999978 failures of 2.000000), restarting: false, error: %!s(<nil>)```

The code has been butchered by the forum software. You need to put it inside “```” (three `) to make it look as supposed, e.g.

image

Can you try to edit and fix the posts?

One thing that I can see immediately is syncthing.bat. What is the reason for using a separate batch file instead of starting Syncthing directly with the Task Scheduler?

I was following the directions for the batch file. It was from here but may not be the one that you referenced.Your link didn’t work for me.
My edit didn’t appear to work, I will re-post the xml. Oops, my bad, 3 tilde, not apostrophes. The contents of the batch file:

start "Syncthing" syncthing.exe -no-console -no-browser

Sorry about the character mix up, I don’t see real well. I don’t know for sure, but I think it is due to a windows update last evening. I have been unable to connect to websites like Amazon and SmallNetBuilders sometimes today. I got an error message a couple of times like “The site has experienced a network protocol violation that cannot be repaired” A reboot cures it.

It has worked flawlessly until now. BTW, Syncthing is starting, it just takes a loooong time. The terminal window everntually disappears. Part of the latest log:

2021-01-13 21:28:11 Completed initial scan of sendreceive folder "ACADJOBS1" (ACADJOBS)
2021-01-13 21:28:38 Couldn't fetch release information: Get "https://upgrades.syncthing.net/meta.json": dial tcp: lookup upgrades.syncthing.net: no such host
2021-01-13 21:28:38 Automatic upgrade: no version to select
2021-01-13 21:39:21 Couldn't fetch release information: Get "https://upgrades.syncthing.net/meta.json": dial tcp: lookup upgrades.syncthing.net: no such host```

The xml file:
```<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
  <RegistrationInfo>
    <Date>2020-09-24T22:23:44.2737009</Date>
    <Author>DELL1\TERRY</Author>
    <URI>\Syncthing Start</URI>
  </RegistrationInfo>
  <Triggers>
    <LogonTrigger>
      <Enabled>true</Enabled>
    </LogonTrigger>
  </Triggers>
  <Principals>
    <Principal id="Author">
      <UserId>S-1-5-21-1267482001-1716422932-930909332-1001</UserId>
      <LogonType>InteractiveToken</LogonType>
      <RunLevel>LeastPrivilege</RunLevel>
    </Principal>
  </Principals>
  <Settings>
    <MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
    <DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
    <AllowHardTerminate>false</AllowHardTerminate>
    <StartWhenAvailable>false</StartWhenAvailable>
    <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
    <IdleSettings>
      <StopOnIdleEnd>true</StopOnIdleEnd>
      <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <AllowStartOnDemand>true</AllowStartOnDemand>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>PT0S</ExecutionTimeLimit>
    <Priority>7</Priority>
  </Settings>
  <Actions Context="Author">
    <Exec>
      <Command>D:\SYNCTHING\syncthing.bat</Command>
      <WorkingDirectory>D:\SYNCTHING</WorkingDirectory>
    </Exec>
  </Actions>
</Task>

The task looks fine, although the separate batch script is not needed. You can start Syncthing directly with

<Actions Context="Author">
  <Exec>
    <Command>syncthing.exe -no-console -no-browser</Command>
    <WorkingDirectory>D:\SYNCTHING</WorkingDirectory>
  </Exec>
</Actions>

This will likely not change the situation though, as something else seems to be going on with the connections and such.

I did a system restore to two days ago, and everything is back to normal. I have paused the windows update to give me time to research the problem. I think it came from there. Regardless, it is nothing wrong with Syncthing, it is on my end entirely. Thanks for the help, Terry

1 Like

If it happens again, some screenshots might be useful in helping others understand what’s happening. :slight_smile:

3 Likes

I found the culprit. Surfshark VPN client app on my PC update was the guilty party. I was almost sure it was windows update, but I had forgot about Surfshark updating to v. 2.7.8. I haven’t ironed out what the wrinkles are, but I know where they came from.

After the system restore, I wouldn’t let the app update, and took them one at a time, then a reboot. After Surfshark updated, it was back to slow and poor to no connections. Fortunately they programmed a restore point in the app, so I didn’t have to go back far this time.

1 Like

It is good to hear that you have got the problem solved :slightly_smiling_face:.

I would still modify the task not to use a batch file as it is just superfluous. And, even if you do keep the batch, there is no need to use start in it, i.e.

you can do

syncthing.exe -no-console -no-browser

instead of

start "Syncthing" syncthing.exe -no-console -no-browser.

The batch file and the start command is responsible for the multiple flashing windows. Normally there should only be one.

Yes, thanks, I will do that. I think I was using an older “cookbook”, but it originated around here somewhere.

I just went through a couple hours diagnostics etc with Surfshark rep and they finally conceded that it was indeed a bug. Looking forward to hearing back on it. thanks again, jts