Syncthing constantly disconnects, restarts itself, cannot sync large folders

I just installed Kali Linux on my laptop and fired up Syncthing, installed from the apt repo. Everything works fine except for one thing. Roughly every 90 seconds, I get an error popup on the webUI that Syncthing has lots its connection and is retrying. It always comes back but disconnects again after another 60-90 seconds. I have a shared folder containing thousands of nested files and subfolders, which takes a long time to scan, but due to this error causing Syncthing to restart so often, the scan does not progresss past 0% and never begins syncing.

sudo journalctl -fu syncthing

returns:

Jun 11 13:11:18 kali-lp systemd[1]: syncthing.service: Scheduled restart job, restart counter is at 458.
Jun 11 13:11:18 kali-lp systemd[1]: Stopped Syncthing.
Jun 11 13:11:18 kali-lp systemd[1]: Starting Syncthing...
Jun 11 13:11:18 kali-lp syncthing[78849]: [start] 13:11:18 INFO: syncthing v1.6.1 "Fermium Flea" (go1.14.4 linux-amd64) deb@build.syncthing.net 2020-06-02 09:49:22 UTC
Jun 11 13:11:18 kali-lp syncthing[78849]: [start] 13:11:18 INFO: Using large-database tuning
Jun 11 13:11:18 kali-lp syncthing[78849]: [DBPCG] 13:11:18 INFO: My ID: DBPCGCT-2SROUSY-RM24C7K-5B3CLMC-FVMS2OW-DALDH5J-TB3QFUK-353E4Q7
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Single thread SHA256 performance is 456 MB/s using minio/sha256-simd (391 MB/s using crypto/sha256).
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Hashing performance is 372.07 MB/s
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Overall send rate is unlimited, receive rate is unlimited
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: QUIC listener ([::]:22000) starting
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: TCP listener ([::]:22000) starting
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Ready to synchronize "Applications" (4lpd5-zm94f) (sendreceive)
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Ready to synchronize "Persistent" (xwa2i-ehjix) (sendreceive)
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: GUI and API listening on 127.0.0.1:8384
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: My name is "kali-lp"
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Device VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ is "kali-dk" at [dynamic]
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Device 7EJJSXS-TSQSXCO-VYV2FOW-GYB6RKI-ZBUHYFZ-MKS5QI3-UYRYMKD-IJNRPQE is "Win10 VM" at [dynamic]
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Ready to synchronize "Libraries" (yztpm-xcp5q) (sendreceive)
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Completed initial scan of sendreceive folder "Persistent" (xwa2i-ehjix)
Jun 11 13:11:19 kali-lp syncthing[78849]: [DBPCG] 13:11:19 INFO: Completed initial scan of sendreceive folder "Applications" (4lpd5-zm94f)
Jun 11 13:11:20 kali-lp syncthing[78849]: [DBPCG] 13:11:20 INFO: Established secure connection to VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ at 192.168.1.21:35388-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
Jun 11 13:11:20 kali-lp syncthing[78849]: [DBPCG] 13:11:20 INFO: Device VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ client is "syncthing v1.6.1" named "kali-dk" at 192.168.1.21:35388-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
Jun 11 13:11:29 kali-lp syncthing[78849]: [DBPCG] 13:11:29 INFO: quic://0.0.0.0:22000 detected NAT type: Symmetric NAT
Jun 11 13:11:29 kali-lp syncthing[78849]: [DBPCG] 13:11:29 INFO: quic://0.0.0.0:22000 resolved external address quic://184.75.208.34:22000 (via stun.syncthing.net:3478)
Jun 11 13:11:34 kali-lp syncthing[78849]: [DBPCG] 13:11:34 INFO: New NAT port mapping: external TCP address 24.61.226.221:43771 to local address 0.0.0.0:22000.
Jun 11 13:11:34 kali-lp syncthing[78849]: [DBPCG] 13:11:34 INFO: New NAT port mapping: external TCP address 24.61.226.221:2358 to local address 0.0.0.0:22000.
Jun 11 13:11:34 kali-lp syncthing[78849]: [DBPCG] 13:11:34 INFO: New NAT port mapping: external TCP address 24.61.226.221:53680 to local address 0.0.0.0:22000.
Jun 11 13:11:34 kali-lp syncthing[78849]: [DBPCG] 13:11:34 INFO: Detected 4 NAT services
Jun 11 13:12:48 kali-lp systemd[1]: syncthing.service: start operation timed out. Terminating.
Jun 11 13:12:48 kali-lp syncthing[78849]: [DBPCG] 13:12:48 INFO: QUIC listener ([::]:22000) shutting down
Jun 11 13:12:48 kali-lp syncthing[78849]: [monitor] 13:12:48 INFO: Signal 15 received; exiting
Jun 11 13:12:48 kali-lp syncthing[78849]: [DBPCG] 13:12:48 INFO: Failed initial scan of sendreceive folder "Libraries" (yztpm-xcp5q)
Jun 11 13:12:48 kali-lp syncthing[78849]: [DBPCG] 13:12:48 INFO: Connection to VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ at 192.168.1.21:35388-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256 closed: Syncthing is being stopped
Jun 11 13:12:48 kali-lp syncthing[78849]: [DBPCG] 13:12:48 INFO: TCP listener ([::]:22000) shutting down
Jun 11 13:12:48 kali-lp syncthing[78849]: [DBPCG] 13:12:48 INFO: Exiting
Jun 11 13:12:48 kali-lp systemd[1]: syncthing.service: Failed with result 'timeout'.
Jun 11 13:12:48 kali-lp systemd[1]: Failed to start Syncthing.
Jun 11 13:12:58 kali-lp systemd[1]: syncthing.service: Scheduled restart job, restart counter is at 459.
Jun 11 13:12:58 kali-lp systemd[1]: Stopped Syncthing.
Jun 11 13:12:58 kali-lp systemd[1]: Starting Syncthing...
Jun 11 13:12:58 kali-lp syncthing[79044]: [start] 13:12:58 INFO: syncthing v1.6.1 "Fermium Flea" (go1.14.4 linux-amd64) deb@build.syncthing.net 2020-06-02 09:49:22 UTC
Jun 11 13:12:58 kali-lp syncthing[79044]: [start] 13:12:58 INFO: Using large-database tuning
Jun 11 13:12:58 kali-lp syncthing[79044]: [DBPCG] 13:12:58 INFO: My ID: DBPCGCT-2SROUSY-RM24C7K-5B3CLMC-FVMS2OW-DALDH5J-TB3QFUK-353E4Q7
Jun 11 13:12:59 kali-lp syncthing[79044]: [DBPCG] 13:12:59 INFO: Single thread SHA256 performance is 454 MB/s using minio/sha256-simd (375 MB/s using crypto/sha256).
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Hashing performance is 370.80 MB/s
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Overall send rate is unlimited, receive rate is unlimited
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Ready to synchronize "Applications" (4lpd5-zm94f) (sendreceive)
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: QUIC listener ([::]:22000) starting
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: TCP listener ([::]:22000) starting
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Ready to synchronize "Persistent" (xwa2i-ehjix) (sendreceive)
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Ready to synchronize "Libraries" (yztpm-xcp5q) (sendreceive)
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: GUI and API listening on 127.0.0.1:8384
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Access the GUI via the following URL: http://127.0.0.1:8384/
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: My name is "kali-lp"
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Device VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ is "kali-dk" at [dynamic]
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Device 7EJJSXS-TSQSXCO-VYV2FOW-GYB6RKI-ZBUHYFZ-MKS5QI3-UYRYMKD-IJNRPQE is "Win10 VM" at [dynamic]
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Completed initial scan of sendreceive folder "Persistent" (xwa2i-ehjix)
Jun 11 13:13:00 kali-lp syncthing[79044]: [DBPCG] 13:13:00 INFO: Completed initial scan of sendreceive folder "Applications" (4lpd5-zm94f)
Jun 11 13:13:01 kali-lp syncthing[79044]: [DBPCG] 13:13:01 INFO: Established secure connection to VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ at 192.168.1.21:35460-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
Jun 11 13:13:01 kali-lp syncthing[79044]: [DBPCG] 13:13:01 INFO: Device VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ client is "syncthing v1.6.1" named "kali-dk" at 192.168.1.21:35460-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256
Jun 11 13:13:10 kali-lp syncthing[79044]: [DBPCG] 13:13:10 INFO: quic://0.0.0.0:22000 detected NAT type: Symmetric NAT
Jun 11 13:13:10 kali-lp syncthing[79044]: [DBPCG] 13:13:10 INFO: quic://0.0.0.0:22000 resolved external address quic://184.75.208.34:12149 (via stun.syncthing.net:3478)
Jun 11 13:13:15 kali-lp syncthing[79044]: [DBPCG] 13:13:15 INFO: New NAT port mapping: external TCP address 24.61.226.221:53680 to local address 0.0.0.0:22000.
Jun 11 13:13:15 kali-lp syncthing[79044]: [DBPCG] 13:13:15 INFO: New NAT port mapping: external TCP address 24.61.226.221:43771 to local address 0.0.0.0:22000.
Jun 11 13:13:15 kali-lp syncthing[79044]: [DBPCG] 13:13:15 INFO: New NAT port mapping: external TCP address 24.61.226.221:2358 to local address 0.0.0.0:22000.
Jun 11 13:13:15 kali-lp syncthing[79044]: [DBPCG] 13:13:15 INFO: Detected 4 NAT services
Jun 11 13:14:29 kali-lp systemd[1]: syncthing.service: start operation timed out. Terminating.
Jun 11 13:14:29 kali-lp syncthing[79044]: [DBPCG] 13:14:29 INFO: QUIC listener ([::]:22000) shutting down
Jun 11 13:14:29 kali-lp syncthing[79044]: [monitor] 13:14:29 INFO: Signal 15 received; exiting
Jun 11 13:14:29 kali-lp syncthing[79044]: [DBPCG] 13:14:29 INFO: Failed initial scan of sendreceive folder "Libraries" (yztpm-xcp5q)
Jun 11 13:14:29 kali-lp syncthing[79044]: [DBPCG] 13:14:29 INFO: Connection to VF5YNJ2-L7AXTFC-5MPS23W-YQJIORI-77PTFTI-5LKR3JN-DZGTD2D-X6D6EAJ at 192.168.1.21:35460-192.168.1.164:22000/tcp-client/TLS1.3-TLS_AES_128_GCM_SHA256 closed: Syncthing is being stopped
Jun 11 13:14:29 kali-lp syncthing[79044]: [DBPCG] 13:14:29 INFO: TCP listener ([::]:22000) shutting down
Jun 11 13:14:29 kali-lp syncthing[79044]: [DBPCG] 13:14:29 INFO: Exiting
Jun 11 13:14:29 kali-lp systemd[1]: syncthing.service: Failed with result 'timeout'.
Jun 11 13:14:29 kali-lp systemd[1]: Failed to start Syncthing.

And the cycle just repeats. I cannot trace the source of this error. My desktop PC is running the same setup (same OS) with no issues at all.

That looks like a custom, broken systemd service file:

Jun 11 13:12:48 kali-lp systemd[1]: syncthing.service: start operation timed out. Terminating.

Systemd seems to wait for syncthing to exit to consider it started (or fork or whatever), which it shouldn’t do with the default service file. Please post the output of systemctl cat syncthing.

I actually just found the problem. It was indeed systemd. I had configured syncthing initially using the guide for systemd on the documentation page and at first something wasn’t working so I must have grabbed a config file from another program and left in some attributes that should have been removed.

I fixed it by uninstalling syncthing from user space and reinstalling with apt.

It’s working fine now, everything is syncing up. Thanks for the reply.

1 Like

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