What does "operation not permitted" mean in failed/our of sync?

I have a small number of files which fail to synchronise between systems. The error for all of them is just “operation not permitted”. I have checked all the files with this error and the syncthing process does have permission to write to them.

However the files do have a different owner on one of the systems being synchronised, will this cause the “operation not permitted” error and is there any way around it?

As I said the syncthing process does have permission to write the files everywhere but another process (with a different user) writes files into the synchronised directories and thus sometimes files with different ownership will appear.

1 Like

It might not have the right to read the files or change permissions on the files.

The error clearly indicates that syncthing is not allowed to do something. You might want to check ignore permissions flag on the folder.

Yes, it’s because the file has a different owner than the user running syncthing. I can resolve the error by changing the ownership of files to that of the syncthing process.

However this is a problem! In my situation there will always be files created by more than one owner in the folders I want to synchronise. Syncthing has permission to write, delete and copy any file in the folders but it isn’t always the file owner.

I don’t think ignorePermissions will halp as, if the documentation is correct, that just means to ignore file permissions when looking for changes. I need a flag to say “don’t try to chmod” when copying changed files.

I also means “don’t try to set permissions”.

OK, thanks, I’ll try setting it and see if it resolves my issues.

You’re also not saying what operation it is that fails. For example, syncthing needs to be able to create new files in a directory, regardless of the permissions on the files themselves.

It’s failing to synchronise some files which are owned by ‘chris’ (that’s me!) on one system and by www-data (the apache2 user) on another system. Both www-data and chris have permission to write and delete files in the synchronised folder on both systems.

So again… It’s apparently attempting to do something that it’s not allowed to, but without the error message I don’t know what and can’t guide you in what to check.

Sorry if I’m not explaining well.

I am synchronising a wiki (i.e. a web application) across three systems. The files in the wiki may be written by me (i.e. they will have owner ‘chris’) or by the apache process (when they will have owner www-data). Both ‘chris’ and ‘www-data’ have all the permissions needed to read, write and delete files in the synchronised folders.

The error message I see in the syncthing web GUI is just “operation not permitted” against a number of files which have failed to synchronise. When I look at these files it turns out that they are owned by ‘chris’ on one system and ‘www-data’ on the other.

In the syncthing log file I see errors like:-

[BKI6D] 09:45:53 INFO: Puller (folder “wiki”, file “data/index/relation_references_i.idx”): shortcut: chmod: chmod /home /chris/wiki/data/index/relation_references_i.idx: operation not permitted [BKI6D] 09:45:53 INFO: Puller: shortcut: chmod /home/chris/wiki/data/index/relation_references_i.idx: operation not perm itted

So, yes, it’s chmod failing. If setting ignorePermissions will stop syncthing trying to do the chmod then it will solve my problem.

Yes, it should.

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