I recently moved my Nextcloud installations to a new server. After the move, I can still sync/download from the server, but I can't seem to upload anything from the local Nextcloud clients on Windows or Mac. I get this error:
Test.txt: Error downloading https://mysite.com/files/remote.php/webdav/Test.txt - server replied: Forbidden (Sabre\DAV\Exception\Forbidden)
Any idea why this might be happening? Doesn't seem to be a permissions issue. I made sure all of the files were owned by www-data:www-data and tried temporarily setting everything to chmod 777. Didn't make a difference.
Thanks.
Operating system: Ubuntu 16.04
Web server: Apache
PHP version: 7.0.4
ownCloud version: 10.0.2
Are you using encryption: No
Exception: {"Message":"HTTP\/1.1 403 Forbidden","Exception":"Sabre\\DAV\\Exception\\Forbidden","Code":0,"Trace":"#0 \/home\/mysite\/www\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1036): OCA\\DAV\\Connector\\Sabre\\Directory->createFile('Test.txt', Resource id #93)\n#1 \/home\/mysite\/www\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(523): Sabre\\DAV\\Server->createFile('Test.txt', Resource id #93, NULL)\n#2 [internal function]: Sabre\\DAV\\CorePlugin->httpPut(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/home\/mysite\/www\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/home\/mysite\/www\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit('method:PUT', Array)\n#5 \/home\/mysite\/www\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/home\/mysite\/www\/apps\/dav\/appinfo\/v1\/webdav.php(60): Sabre\\DAV\\Server->exec()\n#7 \/home\/mysite\/www\/remote.php(165): require_once('\/home\/mysite\/f...')\n#8 {main}","File":"\/home\/mysite\/www\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php","Line":126,"User":"nick"}
Seems like the permission check fails (https://github.com/nextcloud/server/blob/master/apps/dav/lib/Connector/Sabre/Directory.php#L125). How did you uploaded the files? With the desktop sync client?
I can't reproduce it with 10.0.2 but you could try to update to 11.0.1 if you are working on your installation anyway. Maybe this changes anything?
I uploaded the files by moving them from the old server to the new server via SCP as root, but then I recursively gave ownership back to www-data:www-data.
I am still having the issue after updating to the beta 11.0.1.
The mobile clients work fine. Just the windows and mac desktop ones having this issue.
I tried doing a fresh install on the same server on a different domain and the syncing works fine. It must have something to do with moving an existing installation and its settings. I might just have to do a fresh reinstall and re-sync for the ones I moved.
I'm getting the exact same error, same upload issue, and also migrated FROM this server to ANOTHER (the other works fine) and ironically my username is also 'nick'...
UPDATE: This was just a bad ACL/file ACL that I had added that denied myself everything.
So, maybe this help, maybe an ACL wasn't transferred over during the migration?
Haha oh wow, that's funny. I'm not sure. I was able to fix it by just creating a fresh install and moving my old files over to it and reindexing the files from the occ comand line, then renaming the directory to what it used to be after deleting the old one.
I have same problem (SabreDAVExceptionForbidden:) when I triying upload files, It is strange but before It didn't happen.
I can to make a new instalation but I want to undertand the problem.
regards
I had the same issue. Reindexing the files using occ files:scan [username] seems to have helped.
Hi NC team,
Thanks a lot for your great work, I have tried the solutions mentioned above but didn鈥檛 solve the problem, here is more details I鈥檓 facing.
I have a 00_Blank_Master_Structure folder for my team to use whenever they start a new task, they make a copy of that folder and rename the new folder with the task name.
As the server remembers the folder path / name even after deleting and creating it will still have the issue, I think the folder name is listed somewhere in the database, and that specific folder might be the first step to track why this happens in the first place.
Kindly advise what additional details do you need from my side, this issue does not seem resolved from this aspect, it could be the difference in server configuration for each of us having the same problem.


Many thanks in advance,
Hi All,
this is an update for this subject, as I was reading more through the Nextcloud features, the files locking felt important on this point, which supposed to protect files while being used by others or in transit.
in this specific case, I noticed that if you drop a folder in the NC folder, then it start to synchronize, then before it finishes you rename the folder, then this issue happens with the specific folders that didn't finish copying, in my case above those two folders are the largest to have template files / folders.
considering my users duplicate the a blank template folder from within nextcloud, a new folder will be named like "Copy of Blank Template folder", which the users will rename immediately to the task name while it still syncing to the server, which leads to this issue to happen.
for now I instructed the users to create an empty task folder, give it the right name, and then copy the content of the template into the new folder (with the final name), yet this case still happens in any other cases by the users when they rename a folder before it finishes syncing.
even renaming those tasks folders at any point is being done by me to manage any locked files or avoid any related issues.
I'm not sure what is the best method to avoid this issue, and not sure how NC handles such a case, kindly share your thoughts in here, and ask me for any additional details please.
thanks
M Fota
Hi All,
Testing more on this issue, it seems to be happening only inside the Group Folders, following the exact steps as I mentioned above, inside the private folders or shared folders this issue doesn't happen, inside a Group Folder it happens, I tested this on a personal NextCloud instance (16.0.4), and the original instance had this issue (14.0.14) and on both shows the exact same error (Server replied "403 Forbidden").
Steps to produce:
The same happens on macOS or Windows, except on Windows it doesn't show the error in the activity tab, but the remaining behavior still happen.
Kindly advise if you need any additional details related to this.
Many thanks
M Fota
+1 to what @MohammedFota reported. I have a NextCloud server running using an NFS mount for the data directory. Today I did a bunch of fast folder actions: created a folder, copied some stuff, deleted some stuff, etc. This was all before it finished a sync. It rendered my entire server unusable and all desktop clients on Windows and Mac and Linux report 403, or 404, for my entire account. Even folders which were not even added to the client where I did the folder operations. I tried making a new folder in the web interface and even this reports 404 and 403 when trying to use it in the clients.
Most helpful comment
I had the same issue. Reindexing the files using
occ files:scan [username]seems to have helped.