No sync between a file server and a web server

Dear all,

I have a strange situation here. I’m trying to sync two folders, sitting in two respective servers (physical machines). The two servers are in the same network, in case that matters.

The path to the folder in server A is /media/data/foo/bar/folder. The path to the folder in server B is /var/www/my/folder (yes, it’s a webserver)

Syncthing runs on both servers: v1.10.0, Linux (64 bit) on server A and v1.15.1, Linux (64-bit Intel/AMD) on server B.

When I create files or folders in server B (under /var/www/my/folder), syncthing doesn’t see them.

Any tips will be most welcome. Thanks a lot. Cheers, Manuel

First of all, you should upgrade both of them to the latest version.

Did you verify that the devices are connected, folder ids are the same, etc? Have they finished scanning?

Getting started guide covers some of these basics.

Thanks for your prompt reply, Audrius.

I didn’t think the version would be a problem. I sync several machines (not servers) and they all have different versions.

The devices are connected and the folder ID is the same.

I have made a test syncing the same folder under /home/manuel/folder rather than /var/www/my/folder. The folder is empty and gets filled as soon as I accept the request from the other server and give that path.

That makes me think that it’s really something specific to the /var/www/my folder, either related to the owner, group or permission in that folder, or something else specific to the fact that it’s a web server.

I keep running tests, any more tips welcome. Cheers, Manuel

That indeed sounds like permission issues. Which should pop up as failed items in the web UI. And if that’s not the case, still have a look at the logs if there’s anything noteworthy there.

I’m almost there :slight_smile:

I think there were two problems. I’ll explain the one I haven’t solved yet, in case you have any further tips.

Folders that I create now on the web server are re-created on the file server, so that part works (hurray!).

However, on the file server, syncthing creates sync’ed folders with user/group/permissions that don’t allow other uses (from a Windows workstation) to put files there:

4 drwxrwxr-x  2 ad  ad     4096 Apr 29 19:22 folder

(ad is the user that installed or ran syncthing).

I would need to have something like this (users group):

4 drwxrwxr-x  2 ad  users     4096 Apr 29 19:22 folder

or like this (world has permissions 7):

4 drwxrwxrwx  2 ad  ad     4096 Apr 29 19:22 folder

How can I make syncthing do that?

About the other problem, in the webserver, I fixed it by deleting all files and folders inside the folder I want to sync. Then I changed permissions on /var/www/my/folder as sudo chown $USER:varwwwusers folder/ -R and added it a third time in the syncthing’s UI.

Now it seems to work, so indeed it seemed a permissions problem.

Thank you so much for your help! Cheers, Manuel

syncthing inherits the permissions from the shell it launches. If you want it to use a different group you need to set the group via newgrp. If you want it to use different permissions, you’ve got to set the umask.

Thanks, newgrp sounds like what I need. I’ll try and report back. Cheers, Manuel

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