Lost write permission to local nextcloud folder in powershell

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 3.3.6 (Windows)
Operating system and version (eg, Ubuntu 20.04): Windows 10

The issue you are facing:

I access my nextcloud folder through command line quite regularly, and today I discovered I can’t create any new files any more. For example, git can’t create .lock files, mkdir doesn’t work. The errors are like this:

PS D:\Nextcloud>touch test
/usr/bin/touch: cannot touch 'test': No such file or directory
PS D:\Nextcloud>mkdir test
mkdir : Could not find file 'test'.
At line:1 char:1
+ mkdir test
+ ~~~~~~~~~~
    + CategoryInfo          : WriteError: (D:\Nextcloud\test:String) [New-Item], FileNotFoundException
    + FullyQualifiedErrorId : CreateDirectoryIOError,Microsoft.PowerShell.Commands.NewItemCommand

I have no problem using command line in the parent folder (D:), or anywhere else, and I can create files just fine using windows explorer. It’s just powershell that seems to have stopped working (including dos prompt). Running powershell as administrator doesn’t work, either.

According to msi.log I installed 3.3.6 on 9/11/2021, but I’ve only noticed this problem today (a month later). I do however keep my workstation on all the time, and I rebooted it a couple of days ago.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. No idea, update to 3.3.6?

The output of your Nextcloud MSI log:

I’m not sure if posting 10,000 lines is a good idea here.

Well I’ve figured out what I had done.

I added Nextcloud to the “Protected folders”, and had only enabled access to the client. I needed to grant git/powershell/etc as well.