# WindowsError 5 (Access Denied) when syncing a read-only shared folder

**URL:** <https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249>\
**Category:** ℹ️ Support\
**Tags:** nc32, desktop-client, nc33\
**Created:** [July 23, 2026, 7:26am UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249 "2026-07-23T07:26:26Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![CoffeeHT](https://help.nextcloud.com/user_avatar/help.nextcloud.com/coffeeht/32/56226_2.png) [@CoffeeHT](https://help.nextcloud.com/u/CoffeeHT)\
**Post date:** [July 23, 2026, 7:26am UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/1 "2026-07-23T07:26:26Z")

</div>

Hi everyone,

I’m running into a persistent “WindowsError 5: Access Denied” when the NextCloud desktop client tries to download files from a **read-only shared folder** to my local sync directory.

**Setup:**

- **OS:** Windows (desktop client)
- **NextCloud version:** _32.0.9 managed Service_
- **Desktop client version:** 33.0.7
- **Local sync path:** `C:\_My\Cloud`

**What works:**

- Syncing folders where my NextCloud account has **read AND write** permissions works flawlessly (~1 GB synced without errors).

**What fails:**

- As soon as the client begins downloading files from a **read-only shared folder** (shared by another NextCloud account with read-only permissions), I get: `WindowsError: 5: Zugriff verweigert (Access Denied)`

**What I’ve already tried:**

1. Reset NTFS permissions and explicitly granted Full Control to all local users on the sync directory (`icacls /reset /T` + `icacls /grant`)
2. Verified Windows Defender Controlled Folder Access is **disabled** (`EnableControlledFolderAccess = 0`)
3. No third-party antivirus running

**Observation:** The error appears to occur only when the client attempts to **write downloaded files locally** from a server-side read-only share — not during the initial folder scan/metadata phase.

**Question:** Is this a known issue with read-only shared folders? Could the NextCloud client be applying read-only attributes locally that reflect the server-side permissions, thereby preventing itself from writing the downloaded files to disk?

Any insights would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [July 26, 2026, 11:54pm UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/2 "2026-07-26T23:54:10Z")

</div>

Hi @CoffeeHT,

> [@CoffeeHT](#):
>
> **Question:** Is this a known issue

**Answer:** Yes it is, and your own guess is exactly right, so you can stop fighting the permissions on your side.

For a read-only share the desktop client does not just set the Windows read-only attribute, it writes an actual deny-write entry into the folder’s ACL, an `ACCESS_DENIED_ACE` against the built-in Users group that takes away `FILE_WRITE_DATA` and `FILE_APPEND_DATA` among others. On a folder those two are exactly “create a new file” and “create a new subfolder”, so the moment the client has finished downloading and wants to write the file into that folder, Windows denies it, and you get `WindowsError 5` in the writing phase rather than during the scan. The client is locking itself out.

That also explains why your `icacls` full control changed nothing. On Windows a deny entry always wins over any allow entry, no matter how much access you grant on top, and the client rewrites that deny entry on every sync run, so it comes right back.

It is tracked here, and both are still open:

> <https://github.com/nextcloud/desktop/issues/9488>
>
> \### ⚠️ 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
> 
> Good morning,
> 
> I will try to organize the topic with the information:
> 
> Although at first I thought the permission denied sync error was caused by file names containing Ñ or accented characters, I have discovered that it has nothing to do with that. It happens regardless of whether the file or folder names are normal.
> 
> I believe the problem lies in how the sync client handles shared folders that have read-only permissions. For example:
> 
> 2.1. User A shares a folder and its contents with User B or a group of users, assigning read-only permissions to that folder and disabling the options to create, modify, or delete. It does not matter whether this is done from the Nextcloud web interface or from their synced folder.
> 
> 2.2. The clients of User B or the user group create the shared folder, but afterward they are unable to sync its contents, showing a permission denied error.
> 
> 2.3. I have also discovered that if this folder was syncing correctly in previous versions that did not have this problem, and I update to the latest version (4.0.6), if a conflict appears in any file, trying to resolve it by asking the application to keep the server version does not work, and it behaves as if it cannot take any action.
> 
> 3. I can solve all these problems if I change the permissions of the shared folder using chmod -R 755 /path/folder.
> 
> 4. I have also discovered that the same thing happens on Windows clients, not only on Linux/Debian clients.
> 
> I know that at first I blamed the problem on file names, since the first issues I encountered involved names containing Ñ or accents. However, over time I noticed that the problems increased and were unrelated to file names. Finally, it seems that the issue is caused by the permissions of the local folder when it is created by the application if that folder is a shared folder with read-only permissions, as I explained above. On the web interface, I do not have any problems with these folders; it only happens during synchronization.
> 
> I hope I have explained myself more clearly. If you need more information, please do not hesitate to ask, and I will try to provide everything I can. 
> 
> Thank you very much for your patience.
> 
> \### Steps to reproduce
> 
> 1. User A share a folder in nextcloud with read-only permissions. (no modification, creation or delete permissions)
> 2. User B syncs this folder with the app. The app creates this folder, but can not create the files, giving permission denied error
> 3. in linux, using chmod -R 755 /path/read-only-shared-folder fixes this error
> 4. In windows, syncing in normal mode (no virtual folders), i am having same error, but i can not fix it.
> 5. I have probe with fresh install and updated installs. In previous versions of sync app, i have not this problem (version 3.X)
> ...
> 
> 
> \### Expected behavior
> 
> When clicking on the share dialog, share by e-mail should be an option.
> ...
> 
> 
> \### Which files are affected by this bug
> 
> syncing shared folder with read only permissions
> 
> \### Operating system
> 
> Linux
> 
> \### Which version of the operating system you are running.
> 
> ubuntu 22.04, windows 11
> 
> \### Package
> 
> Official PPA
> 
> \### Nextcloud Server version
> 
> 31.0.8
> 
> \### Nextcloud Desktop Client version
> 
> 4.0.6
> 
> \### Is this bug present after an update or on a fresh install?
> 
> Fresh desktop client install
> 
> \### Are you using the Nextcloud Server Encryption module?
> 
> Encryption is Disabled
> 
> \### Are you using an external user-backend?
> 
> \- \[\] Default internal user-backend
> \- \[\] LDAP/ Active Directory
> \- \[\] SSO - SAML
> \- \[\] Other
> 
> \### Nextcloud Server logs
> 
> \`\`\`shell
> 
> \`\`\`
> 
> \### Additional info
> 
> \_No response\_

> <https://github.com/nextcloud/desktop/issues/7586>
>
> \- \[x\] This is a \*\*bug\*\*, not a question or a configuration issue.
> \- \[x\] This iss…ue is \*\*not\*\* already reported on Github, other reports differ.
> \- \[x\] Nextcloud Server and Desktop Client are \*\*up to date\*\*.
> \- \[x\] I agree to follow Nextcloud's Code of Conduct.
> 
> \### Bug description
> 
> My local sync client has permission issues with a group folder to which the user is only granted read-only access.
> 
> On Linux, macOS and Windows, I get an error when removing a subfolder from a read-only folder in sync settings.
> 
> If another user with write access deletes a file or folder within such a synced read-only folder, windows correctly deletes that file, macOS yields an "unknown error: 513" (and re-syncs as usual but then yields the error again) while the sync client constantly syncs on Linux (see screencast below).
> 
> \### Steps to reproduce
> 
> My local user L account syncs a to a Nextcloud 28.0.12 using Desktop 3.15.0. One of the synced folders is a group folder F. The Nextcloud user U has restricted access (read-only) to that folder F. F contains a sub-folder S.
> 
> \#### Issue 1: (De)Selecting folders in Nextcloud Desktop settings (Linux, Windows, macOS)
> 
> If I deselect S in the Nextcloud Desktop settings and apply, a sync is triggered. That (and subsequent) syncs yield an error: "S: access denied":
> 
> !\[Image\](https://github.com/user-attachments/assets/6b39a341-7d4e-42f8-8103-40cee3d9a0b8)
> 
> I can fix that by manually re-adding write access for L to F and S (\`chmod u+w F F/S\`). Then, the sync client deletes the folder \*and it's read-only (\`444\`) file!\* and resets the access mode of F to \`555\`.
> 
> If I now re-select S in the Nextcloud Desktop settings and apply, a sync is triggered and S is added correctly (with \`555\`). If I had manually added write access to F beforehand, it also is reset to \`555\` for F upon adding a subfolder.
> 
> \#### Issue 2: External deletion of a file/folder within a read-only folder (Linux and macOS)
> 
> If some other Nextcloud user V (with regular write access) changes any file within F, these changes are written correctly to the local file, although that file is read-only. However, when V deletes a file or folder within F, my sync client enters an endless re-sync loop on Linux:
> 
> https://github.com/user-attachments/assets/4d704c13-ccac-45c2-b8c9-e4748ac4107a
> 
> On macOS the deletion triggers an "Unknown error: 513" and runs into that again on each sync.
> On Windows, the remote deletion works as expected: the local (read-only) file is deleted correctly.
> 
> The only way I found to remedy this situation was to manually recursively give write access to all folders from S to the deleted file/folder. Then, the sync client deletes that file/folder and removes write access again.
> 
> \### Expected behavior
> 
> It seems to be reasonable to deny write access to files on a system level, but the sync client should be able to override them. It does that for synced files but the devs (and tests!) seem to have missed folders and the deletion scenario. The user must be able to deselect subfolders and sync incoming deletions without errors.
> 
> \### Which files are affected by this bug
> 
> test.md
> 
> \### Operating system
> 
> Linux
> 
> \### Which version of the operating system you are running.
> 
> EndeavourOS = Arch Linux, up-to-date
> 
> \### Package
> 
> Distro package manager
> 
> \### Nextcloud Server version
> 
> 28.0.12
> 
> \### Nextcloud Desktop Client version
> 
> 3.15.0
> 
> \### 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?
> 
> \- \[x\] Default internal user-backend
> 
> \### Additional info
> 
> I cannot attach the Linux Debug Logs since this is my regular business PC and the files within the Debug ZIP cannot easily reduced to one cloud instance. Thus the files would yield information on clouds of my customers.
> 
> But I captured just the cloud I tested with on Windows and macOS now:
> 
> \[3.15.0-W11.zip\](https://github.com/user-attachments/files/17957551/3.15.0-W11.zip)
> \[3.15.0-mac.zip\](https://github.com/user-attachments/files/17957658/3.15.0-mac.zip)

I would add your setup and a short log snippet to the first one and give it a thumbs up, the more confirmations it gathers the more likely it gets picked up. Your 33.0.7 is worth mentioning there, it shows the bug is still live in the current client.

The honest part is that there is no clean fix on Windows yet. The `chmod 755` workaround people bring up in the issue is a Linux thing and does not carry over, because the client just reapplies the deny entry regardless. Until it is fixed, the reliable way to reach that read-only content is to take the folder out of the sync client and get to it over WebDAV instead, where none of this ACL enforcement is in play. For exactly that kind of case I would point you at a small tray client I maintain, NcDavTray, which mounts your Nextcloud over WebDAV and gives you straight access to read-only shares like this one:

> **[GitHub - ernolf/NcDavTray: Tiny Nextcloud WebDAV Tray App for Windows](https://github.com/ernolf/NcDavTray)**
>
> Tiny Nextcloud WebDAV Tray App for Windows

The other option, if you really need it mirrored into the local filesystem and that is acceptable, is to ask whoever shared it to grant you write permission, since read-write folders sync without any of this, as you already saw with your first gigabyte.

h.t.h.

* * *

ernolf

---

<div class="post-metadata">

**Author:** ![CoffeeHT](https://help.nextcloud.com/user_avatar/help.nextcloud.com/coffeeht/32/56226_2.png) [@CoffeeHT](https://help.nextcloud.com/u/CoffeeHT)\
**Post date:** [July 30, 2026, 6:25pm UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/3 "2026-07-30T18:25:01Z")

</div>

> <https://github.com/nextcloud/desktop/issues/9488#issuecomment-5134705941>
>
> \### ⚠️ 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
> 
> Good morning,
> 
> I will try to organize the topic with the information:
> 
> Although at first I thought the permission denied sync error was caused by file names containing Ñ or accented characters, I have discovered that it has nothing to do with that. It happens regardless of whether the file or folder names are normal.
> 
> I believe the problem lies in how the sync client handles shared folders that have read-only permissions. For example:
> 
> 2.1. User A shares a folder and its contents with User B or a group of users, assigning read-only permissions to that folder and disabling the options to create, modify, or delete. It does not matter whether this is done from the Nextcloud web interface or from their synced folder.
> 
> 2.2. The clients of User B or the user group create the shared folder, but afterward they are unable to sync its contents, showing a permission denied error.
> 
> 2.3. I have also discovered that if this folder was syncing correctly in previous versions that did not have this problem, and I update to the latest version (4.0.6), if a conflict appears in any file, trying to resolve it by asking the application to keep the server version does not work, and it behaves as if it cannot take any action.
> 
> 3. I can solve all these problems if I change the permissions of the shared folder using chmod -R 755 /path/folder.
> 
> 4. I have also discovered that the same thing happens on Windows clients, not only on Linux/Debian clients.
> 
> I know that at first I blamed the problem on file names, since the first issues I encountered involved names containing Ñ or accents. However, over time I noticed that the problems increased and were unrelated to file names. Finally, it seems that the issue is caused by the permissions of the local folder when it is created by the application if that folder is a shared folder with read-only permissions, as I explained above. On the web interface, I do not have any problems with these folders; it only happens during synchronization.
> 
> I hope I have explained myself more clearly. If you need more information, please do not hesitate to ask, and I will try to provide everything I can. 
> 
> Thank you very much for your patience.
> 
> \### Steps to reproduce
> 
> 1. User A share a folder in nextcloud with read-only permissions. (no modification, creation or delete permissions)
> 2. User B syncs this folder with the app. The app creates this folder, but can not create the files, giving permission denied error
> 3. in linux, using chmod -R 755 /path/read-only-shared-folder fixes this error
> 4. In windows, syncing in normal mode (no virtual folders), i am having same error, but i can not fix it.
> 5. I have probe with fresh install and updated installs. In previous versions of sync app, i have not this problem (version 3.X)
> ...
> 
> 
> \### Expected behavior
> 
> When clicking on the share dialog, share by e-mail should be an option.
> ...
> 
> 
> \### Which files are affected by this bug
> 
> syncing shared folder with read only permissions
> 
> \### Operating system
> 
> Linux
> 
> \### Which version of the operating system you are running.
> 
> ubuntu 22.04, windows 11
> 
> \### Package
> 
> Official PPA
> 
> \### Nextcloud Server version
> 
> 31.0.8
> 
> \### Nextcloud Desktop Client version
> 
> 4.0.6
> 
> \### Is this bug present after an update or on a fresh install?
> 
> Fresh desktop client install
> 
> \### Are you using the Nextcloud Server Encryption module?
> 
> Encryption is Disabled
> 
> \### Are you using an external user-backend?
> 
> \- \[\] Default internal user-backend
> \- \[\] LDAP/ Active Directory
> \- \[\] SSO - SAML
> \- \[\] Other
> 
> \### Nextcloud Server logs
> 
> \`\`\`shell
> 
> \`\`\`
> 
> \### Additional info
> 
> \_No response\_

---

<div class="post-metadata">

**Author:** ![CoffeeHT](https://help.nextcloud.com/user_avatar/help.nextcloud.com/coffeeht/32/56226_2.png) [@CoffeeHT](https://help.nextcloud.com/u/CoffeeHT)\
**Post date:** [July 30, 2026, 6:27pm UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/4 "2026-07-30T18:27:03Z")

</div>

Perhaps someone should add lable Windows there?  
I don’t know how to do that.

---

<div class="post-metadata">

**Author:** ![CoffeeHT](https://help.nextcloud.com/user_avatar/help.nextcloud.com/coffeeht/32/56226_2.png) [@CoffeeHT](https://help.nextcloud.com/u/CoffeeHT)\
**Post date:** [July 30, 2026, 6:57pm UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/5 "2026-07-30T18:57:10Z")

</div>

> [@ernolf](#):
>
> h.t.h.

Hello @ernolf

A big thank you for your very informative reply.  
This saves me a lot of time that I would otherwise have spent on further fruitless troubleshooting on my end.

I use NextCloud in combination with Cryptomator for my personal file storage.

My use case is that I want to give a few loved ones read-only access to my file storage.  
Where I set up my loved ones’ PCs myself, I can now consider whether I want to take the risk of relying solely on Cryptomator’s ‘Read-Only’ option, without the protection provided by the ‘Read-Only’ setting in NextCloud.

Best regards  
Coffee

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [October 28, 2026, 6:57pm UTC](https://help.nextcloud.com/t/windowserror-5-access-denied-when-syncing-a-read-only-shared-folder/247249/6 "2026-10-28T18:57:32Z")

</div>

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