[Bug]: Error removing folder that stops the synchronisation
- Dominant language
- C++
- Stars
- 3.9k
- Forks
- 1k
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 123
Description
### ⚠️ Before submitting, please verify the following: ⚠️
- [x] This is a **bug**, not a question or a configuration issue.
- [x] This issue is **not** already reported on Github (I've searched it).
- [x] Nextcloud Server and Desktop Client are **up to date**. See [Server Maintenance and Release Schedule](https://github.com/nextcloud/server/wiki/Maintenance-and-Release-Schedule) and [Desktop Releases](https://nextcloud.com/install/#install-clients) for supported versions.
- [x] I agree to follow Nextcloud's [Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/)
### Bug description
When a user synchronises a read-only file deletion, the modification is not applied and the synchronisation stops.
There is no error message written on the synchronisation box (it is only possible to see it by looking at the client logs). It makes it really harder to see that there is a synchronisation problem. Perhaps I should open another issue related to the absence of error display for the end-user.
By contrast with issue https://github.com/nextcloud/desktop/issues/6884 also related to problem of synchronisation due to folder permissions, this issue is related to files permissions (and for MacOS).
### Steps to reproduce
1. Set up a synchronisation for userA to a read-only shared folder.
2. User B with write permission on the folder delete a file inside this folder.
3. User A do the synchronisation. After the preparation step, the synchronisation stops without error (but nothing is synchronised).
### Expected behavior
At step 3 before, the file should be deleted locally and the synchronisation should not stop.
### Which files are affected by this bug
Drive_Clients/file.xlsx
### Operating system
macOS
### Which version of the operating system you are running.
MacOS
### Package
Official macOS 12+ universal pkg
### Nextcloud Server version
29.0.7.1
### Nextcloud Desktop Client version
3.14.1daily
### Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 3.3.6 to 3.4.0)
### Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
### Are you using an external user-backend?
- [ ] Default internal user-backend
- [x] LDAP/ Active Directory
- [ ] SSO - SAML
- [ ] Other
### Nextcloud Server logs
_No response_
### Additional info
This is an extract of the log file. The bug has been triggered by two different Mac users in our organisation.
```
2024-10-08 14:24:57:809 [ info nextcloud.sync.engine /var/folders/yr/XXXXX/T/macos-26086/src/libsync/syncengine.cpp:787 ]: #### Discovery end #################################################### 10935 ms
2024-10-08 14:24:57:809 [ debug nextcloud.sync.database /var/folders/yr/XXXXX/T/macos-26086/src/common/syncjournaldb.cpp:3062 ] [ OCC::SyncJournalDb::commitInternal ]: Transaction commit "Post discovery" and starting new transaction
2024-10-08 14:24:57:810 [ info nextcloud.gui.folder /var/folders/yr/XXXXX/T/macos-26086/src/gui/folder.cpp:1678 ]: will delete invalid read-only folders: "Drive_Clients/file.xlsx"
2024-10-08 14:24:57:813 [ info nextcloud.gui.folder /var/folders/yr/XXXXX/T/macos-26086/src/gui/folder.cpp:887 ]: Saved folder "1" to settings, status QSettings::NoError
2024-10-08 14:24:57:813 [ debug nextcloud.gui.socketapi /var/folders/yr/XXXXX/T/macos-26086/src/gui/socketapi/socketapi.cpp:228 ] [ OCC::SocketListener::sendMessage ]: Sending SocketAPI message --> "UPDATE_VIEW:/Users/XZXZ/Nextcloud" to QLocalSocket(0x600000d7d380)
2024-10-08 14:24:57:813 [ info nextcloud.gui.application /var/folders/yr/XXXXX/T/macos-26086/src/gui/owncloudgui.cpp:247 ]: Sync state changed for folder "https://nc.resilio-solutions.com/remote.php/dav/files/XYXY/" : "Sync paused"
2024-10-08 14:24:57:813 [ debug nextcloud.gui.socketapi /var/folders/yr/XXXXX/T/macos-26086/src/gui/socketapi/socketapi.cpp:228 ] [ OCC::SocketListener::sendMessage ]: Sending SocketAPI message --> "UNREGISTER_PATH:/Users/XZXZ/Nextcloud" to QLocalSocket(0x600000d7d380)
2024-10-08 14:24:57:813 [ warning nextcloud.sync.filesystem /var/folders/yr/XXXXX/T/macos-26086/src/libsync/filesystem.cpp:313 ]: Error removing folder "/Users/XZXZ/Nextcloud/Drive_Clients/file.xlsx"
2024-10-08 14:24:57:813 [ info nextcloud.sync.engine /var/folders/yr/XXXXX/T/macos-26086/src/libsync/syncengine.cpp:1006 ]: User aborted sync
2024-10-08 14:24:57:813 [ info nextcloud.sync.engine /var/folders/yr/XXXXX/T/macos-26086/src/libsync/syncengine.cpp:918 ]: Sync run took 10940 ms
```
Contributor guide
Assessment
This issue has not been assessed yet.