Error uploading file Access Denied

This is a new installation of NextCloud on Ubuntu 16.04. The installation went well. Created various folders then deleted them and then removed them permanently from the trash.

Then tried to create a new test folder and now it is giving permission denied.

I did a chmod 777 on the data folder recursively. This didn’t help. The only thing I did between deleting and trying to create another folder was create various groups but this was still the root login.

Any ideas is greatly appreciated.

{“reqId”:“h0enhG9ra3iu4i7ItIRw”,“remoteAddr”:“”,“app”:“webdav”,“message”:“Exception: {“Message”:“HTTP\/1.1 403 Access denied”,“Exception”:“OCA\\DAV\\Connector\\Sabre\\Exception\\Forbidden”,“Code”:0,“Trace”:”#0 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(1150): OCA\\DAV\\Connector\\Sabre\\Directory->createDirectory(‘test’)\n#1 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/CorePlugin.php(588): Sabre\\DAV\\Server->createCollection(‘test’, Object(Sabre\\DAV\\MkCol))\n#2 [internal function]: Sabre\\DAV\\CorePlugin->httpMkcol(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#3 \/var\/www\/nextcloud\/3rdparty\/sabre\/event\/lib\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\n#4 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(459): Sabre\\Event\\EventEmitter->emit(‘method:MKCOL’, Array)\n#5 \/var\/www\/nextcloud\/3rdparty\/sabre\/dav\/lib\/DAV\/Server.php(248): Sabre\\DAV\\Server->invokeMethod(Object(Sabre\\HTTP\\Request), Object(Sabre\\HTTP\\Response))\n#6 \/var\/www\/nextcloud\/apps\/dav\/appinfo\/v1\/webdav.php(60): Sabre\\DAV\\Server->exec()\n#7 \/var\/www\/nextcloud\/remote.php(165): require_once(’\/var\/www\/nextcl…’)\n#8 {main}",“File”:"\/var\/www\/nextcloud\/apps\/dav\/lib\/Connector\/Sabre\/Directory.php",“Line”:174,“User”:“root”}",“level”:4,“time”:“2016-10-20T21:59:07+00:00”,“method”:“MKCOL”,“url”:"/nextcloud/remote.php/webdav/test",“user”:“root”}

It’s not a shared folder?
Can you run the filescan-command to make sure your files are properly indexed:
sudo -u www-data php /var/www/nextcloud/occ files:scan username

Ok thanks I will have to try this tonight. I don’t have access via work.

I ran the scan. The scan reported 11 folders and 19 files however in next cloud under that user I have 2 folders and 8 files. I removed all the groups I created because prior to that I was able to add folders or files but it is still a no go.

Can you give more details about your setup? Do you use the default data-directory or did you move it to a different folder? On an external disk or network-mount? Which filesystem?

With the standard-data folder you shouldn’t have this error and there would be tons of users complaining.

I did a basic install. I didn’t change any data directories. I am running ubuntu 16.04, PHP 7.0 mysql 5.7.15

Also we are not configured so far that I can’t just do a reinstall. If removing and starting over can be done easily than I will do that.

Data directory: /var/www/nextcloud/data

I agree this doesn’t make sense. Because it was working. I did remove one program that was causing the CPU to peg on the server. Ejabberd just an fyi. Other than that I don’t see or have any other errors just warnings.

our data directory and your files are probably accessible from the Internet. The .htaccess file is not working. We strongly suggest that you configure your web server in a way that the data directory is no longer accessible or you move the data directory outside the web server document root.

You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our security tips.

No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.

Then you probably haven’t set up apache correctly and you are missing this:

Removed and reinstalled and everything is working fine. I suspect there was an issue with a configuration file.