I got syncthing working fine yesterday and did a lot of testing. It works great.
Today when I signed into my two computers I see Remote Devices.
Disconnected
I added two images to my shared Images folder on one computer and nothing happened.
Are they not supposed to connect automatically? I see the syncthing service service running fine on both computers. I ran netstat -tpln he service is listening on the correct port on both computers. I ran the journalctl command on both sides.
$ journalctl -r -u syncthing.service
-- No entries --
I waited for more than an hour to see if they would automatically connect but they did not. I have searched other posts on a solution to this issue.
I am running syncthing 1.22.0 on both Linux computers.
When you ran netstat -tpln, where you logged on as “root” or one of the regular users? (Based on the journalctl command output, it looks like a regular user.)
Output from systemctl --user status syncthing.service
Screenshots from the computers of Syncthing’s web GUI with the device panels expanded to show the details?
I just need to know of it’s the same hardware and software setup as the previous post involving two users running Syncthing independently. If it’s not, then details about the current setup are needed.
So the reason you’re randomly seeing “Disconnected” status for remote devices is because of the way that systemd works.
As you’re already aware, the command systemctl --user enable syncthing.service tells systemd that you want Syncthing to auto-start for the current user.
After the command above has been issued, any of the following actions will result in Syncthing auto-starting for that user:
systemctl --user start syncthing.service
Logging off and logging back on again.
However, if the system is rebooted and no users log on afterwards, no instances of Syncthing will be auto-started.
That’s because systemd starts and stops user services at logon and logoff – i.e., Syncthing only runs for a user when the user is interactively logged in. As soon as the user logs off, it’s like issuing the command systemctl --user stop syncthing.service.
In order for a user service to persist between interactive login sessions, log on as the intended user and issue the following command:
loginctl enable-linger
It tells systemd that you want all enabled user services for the intended user to auto-start at system boot time and to continue running whether or not the intended user is interactively logged on.
With the Syncthing service running 24x7x365, the only times it’ll appear disconnected to other Syncthing devices is if there’s a connectivity issue.
Are you saying that the problem is syncthing.service is not running?
Syncthing has been running for 4+ hours on both computers. The service started as soon as I logged in.
Active: active (running) since Wed 2022-12-28 11:11:34 EST; 4h 0min ago
Why would the two computers not connect to each other to synconize?
Yes, that’s at least one of the issues. I bet if you do a last, the line that says “still logged in” for the user is at least 4+ hours old.
If you were to log off, within a few seconds any Syncthing peer that’s linked to the Syncthing instance on that particular computer would update the status to “Disconnected”.
I’d need to see at least screenshots of Syncthing’s web GUI (with the relevant panels expanded) to be able to debug further because there are all kinds of other external factors besides Syncthing itself that can cause sync failures.
Alternatively, if sharing more details isn’t possible, check under Actions → Logs. Besides the default log output, there are a bunch of debugging features that can be toggled on/off.
(This forum also has a direct message feature if you’d prefer that instead.)
Thanks for your help. I found the solution to the problem.
I looked at another post on the same issue and found something interesting.
It is possible to specify the devices by IP address and port instead of “dynamic”. That way devices connect faster.
In the Remote Devices > Edit > Advanced, I deleted the word “dynamic” and added tcp://192.168.0.33:22022.
On the other host I added tcp://192.168.0.34:22022 and they connected instantly. I no longer see the word “Disconnected”.