NextCloud Client Deletes Files on the Server

Nextcloud version (eg, 20.0.5): Nextcloud Snap 24.0.6.snap1
Operating system and version (eg, Ubuntu 20.04): Ubuntu 18.04.2 LTS
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): Version: 8.0.24

The issue you are facing:
Suddenly a client NextCloud user which has been offline, starts restoring or deleting the files that are on the server. So, the priority in this case is the user PC and that is the source used to synchronize with the server.

Is this the first time you’ve seen this error? (N):
Yes, it has happened also before, I have just reinstalled the client an re-synchronized and it has worked. But, the problem keeps repeating. So, for example if the file: test.txt is not at the local copy of the Client but it is on the server, the user will delete that file from the server.

Steps to replicate it:
It happens suddenly, espacially when a user has not been connected for some time with the NextCloud /internet.
The output of your Nextcloud log in Admin > Logging:
It is just shows that the user deleted or restored the files.

This is becoming very dangerous and we are considering to remove completely NextCloud since we are having so many issues with it. Your help would be very appreciated.

Best Regards

Start backing up your data. Nextcloud is a sync service and not a backup tool. This means it is only for moving data around and it is up to you to make folders read-only or otherwise limited in how the data can be accessed + you need backups of everything.

The system will only be as resilient as you make it. :heart:

@esula - Fully agree. We encountered the same issue with a user who had been offline for a while and were really shocked: Suddenly in some subfolders the structure was there, but the files were gone.

I have long tried to replicate or find the issue (also on Github), but came to no real conclusion. Because of subfolder structure still existing, but files not, a relatable explanation does not come to my mind. That makes the issue so problematic…

This is by design… if the user deletes a file from the synched folder… it deletes it on the server to stay in sync.

The file test.txt was not deleted from the local user1 with his purpose and it was not before at the local user. This file was created from another user2 and it was uploaded on the server. Once the user1 synchronized with the server, it checked the local folder and deleted the files on the server that are not at the local folder.
Should not be the opposite in this case since the user had no action at the local copy? Should not it prioritize the files on the server…

Thank you

Hmm… It should not prioritize files on the server because then files could never be removed, e.g. every time a user deletes a file, it’s still on the server, so it puts it back on the client.

However, it should not remove a file on the server that was never actually present and deleted on the client.

Do you have the log from the client where this happened?

yes, on the logs it is just showing deleting a specific file or creating a specific file…

Which Desktop client versions are in use? - Some 3.3.x versions are buggy and remove files frequently.
Are the users working with virtual files in the Desktop client? It may cause problems with syncing.