Issue with syncthing-gtk on reconnecting to network

I have recently started using syncthing-gtk for its inotify support and started noticing few issues. I have a desktop & a laptop, both running Linux Mint 64 bit with syncthing-gtk. I have several folders shared between them. The desktop has public ip address and is almost always on and connected to network. The laptop is my portable computer and keeps hopping between wi-fi connections and dropping/reconnecting connections… you know the regular laptop stuff.

I started noticing, quite a few times, when I would reconnect laptop to a new wifi network (like my home network after work), syncthing-gtk would still show desktop to be disconnected. It does not change, no matter how long I wait (2-3 hours). I also noticed the same behavior when my laptop comes out of sleep-mode on the same network (syncthing-gtk was connected before going to sleep). I tried looking into the logs and found this line:

I DaemonProcess Subprocess exited with code 3

Restarting the daemon fixed the problem every single time. Is this something known? I am using v0.7.4.1 (Daemon v0.11.18) from PPA.

I was using the core Syncthing for a couple of months before this and had very smooth and nice experience and never had this type of issue, no matter how many time I would reconnect to network.

Syncthing restarts when it has detected waking from sleep, because everything around it may have changed. The exit code 3 indicates this happening. Normally Syncthing manages restarts internally, but in this case Syncthing-GTK may have disabled that and needs to restart Syncthing itself… Maybe that’s not happening?

I also just noticed something else in the same context. After reconnecting to my home network after a sleep, syncthing-gtk showed that some of the shares were disconnected. However, when I checked the syncthing web-gui, it showed everything was connected. I also checked other devices after remotely logging in - they also showed that my laptop was connected.

Following screenshot was taken after waiting for 10 minutes for syncthing-gtk to update the GUI.

Please open one issue per problem at https://github.com/syncthing/syncthing-gtk/issues.

Done: https://github.com/syncthing/syncthing-gtk/issues/189

I’m sorry, but could you, please, explain me under what condition this happens? Or point me to docs or code that handles it :smiley:

I’m sitting here over my laptop and I’ve tried everything from SIGSTOP to full hibernation and I can’t replicate main problem nor make daemon exit with code 3.

You’ll need to be in standby for at least 2 minutes.

Ok, thanks. I’ve verified that ST-GTK can handle all kinds of restart that daemon can throw at it.

But. This most likely happens when syncthing daemon manages to restart so fast that ST-GTK doesn’t even notice it wasn’t there. That shouldn’t usually happen, but it is possible especially when everything is lagging after hibernation.

Now another stupid question: Is there any reliable way how to tell that syncthing instance I’m talking right now is not same instance I talked 10s ago? I can monitor event IDs and handle when they go backwards, but that’s not entirely reliable thing.

Event IDs moving backwards, yep. To be fair, you need to catch skips in event IDs anyway, so it’s not much more effort.

Aren’t you running Syncthing with -no-restart? If you’re doing that, it will ask to be restarted, and it’s up to you to restart it, so you’ll definitely know it’s been restarted…

I’m setting STNORESTART. Is that any different from -no-restart ?

//edit: It probably[1] shouldn’t[2] be.

Yeah that’s no different. How is Syncthing managing to restart more quickly than you can notice, given that you’re the one restarting it?

Syncthing-GTK can handle both daemon running under it and daemon running separately, for example as system service. In 2nd case, restart is handled by service manager or by Syncthing itself.

I am not familiar with lots of details which is being discussed above. But it has been really easy for me to replicate the issue:

  • Make sure my laptop is connected to network and syncthing-gtk is running (and showing all devices as online).
  • Close the laptop lid, which is set to put the laptop on “Suspend”.
  • Go get some snacks and come back later in 10-15 minutes. I don’t have to even move the laptop.
  • Open the laptop lid, enter login password. Open syncthing-gtk - It shows most devices to be disconnected. A couple of times, but not always, my phone shows up as connected, which is usually connected the same wifi network. Few times, when I am too fast to open syncthing-gtk, it will initially show everything as connected (which might be related to older information before laptop was suspended?) and then moments later updates to disconnected.
  • Open the local web gui, enter password. Every thing shows up as connected.
  • Open a remote web gui, enter password. Every thing shows up as connected. I can even update a file on local/remote and it syncs!
  • Syncthing-gtk still shows the remote as disconnected. However, top right box shows updated information, eg Upload/Download rate when a (big) file is being synced.
  • Restart daemon and everything shows up as connected in few seconds.

I am using Linux Mint 17.2 Rafaela 64-bit with Mate 1.10.0 (Kernel: Linux 3.16.0-38-generic x86_64). Syncthing-GTK: v0.7.4.1 (Daemon v0.11.20).

same to me…still

but I´m using manjaro cinnamon.

I need a “network-change-syncthing-restart”-logic :slightly_smiling: