syncthing-inotify Cannot connect to Syncthing

I’m seeing this in my syslog after starting syncthing:

Nov 23 10:12:50 vesuvius syncthing-inotify[9167]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused
Nov 23 10:12:52 vesuvius syncthing-inotify[9167]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused
Nov 23 10:12:53 vesuvius syncthing-inotify[9167]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused
Nov 23 10:12:55 vesuvius syncthing-inotify[9167]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused
Nov 23 10:13:00 vesuvius syncthing-inotify[9167]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused

Some background:

I recently upgraded from Debian wheezy to jessie, after which my init.d startup script stopped working. I decided to remove it and switch to systemd, which I did by following instructions here:

https://docs.syncthing.net/users/autostart.html#how-to-set-up-a-system-service

However, the service wouldn’t start without syncthing-inotify, which I had not been using up until now. I installed syncthing-inotify from the apt.syncthing.net repository and removed and enabled and started the systemd service.

Syncthing startup and is running, but I suspect without syncthing-inotify working.

The syncthing-inotify repository also has a systemd service script which I have not set up, since it was not included in the above instructions, and the syncthing system service seems to run syncthing-inotify already.

syncthing 0.14.12 syncthing-inotify 0.8.3

Is syncthing running? Which port is it listening on?

syncthing is running, listening on 192.168.200.105:8384. I’m able to access through the webGUI and it is syncing with other machines on the network.

Looking more closely at the syslog, the errors occur before the API is up and running:

Nov 23 11:37:16 vesuvius syncthing-inotify[12730]: [WARNING] Cannot connect to Syncthing: Get http://192.168.200.105:8384/rest/404: dial tcp 192.168.200.105:8384: getsockopt: connection refused
Nov 23 11:37:25 vesuvius syncthing[12729]: [6PB6Z] INFO: GUI and API listening on 192.168.200.105:8384
Nov 23 11:37:27 vesuvius syncthing-inotify[12730]: [OK] Watching Company_Files: /home/sync/compsync

syncthing-inotify is running, so I think everything is working and that I’m seeing the warnings until it is finally able to connect to syncthing. Is there a way to confirm that syncthing-inotify is working properly?

Change a file and watch the ui for rescanning.

Changing a file results in the syslog being updated within about 1 second and remote peer has the file synced in about 3 seconds, so it’s definitely working.

Sorry to waste your time. Syncthing is awesome. I’m just an idiot.

FYI: You should be able to set an after line in the unit selection of the inotify service script. After=name_of_syncthing_service This should stop the unnecessary logging.

Thanks, but that’s already set.

After=network.target syncthing@.service

The startup of syncthing-inotify is faster than the startup of syncthing. So, as the author of that service file crap, I decided to live with these errors…

1 Like

That was what I suspected was happening. Thank you for the frank explanation. :slight_smile:

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