Unable to upload any files via web, webdav

Nextcloud version: 18.0.9
Operating system and version: unknown, shared webhost with cPanel
Apache or nginx version Apache, version unknown
PHP version: 7.2.33

The issue you are facing:
When trying to upload files via web interface, file is uploaded, but not placed in directory being uploaded to. Box in upper right appears, “An unknown error has occurred”.
When trying to upload from Android client via WEBDAV, file is uploaded, but client states ‘Permissions Error’.
New files and folders can be created from the web interface without error.
data/user/uploads fills up with empty directories that have random directory names.

Is this the first time you’ve seen this error? Yes, happening since last week when trying (unsuccessfully a few times) to upgrade from 16 > 17>18

Steps to replicate it:

unknown

The output of your Nextcloud log in Admin > Logging:
Way too long to post here. 2700 log lines for 30 minutes. http://www.meetcweb.com/nextcloud.txt
Here’s a section for the result of one file being uploaded via android client:

{"reqId":"X3zuKEnGqhCMNhkb9nv9twAAAJE","level":0,"time":"2020-10-06T22:22:32+00:00","remoteAddr":"96.30.137.154","user":"jpontes","app":"no app in context","method":"HEAD","url":"/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","message":"Deprecated event type for {\"[object] (OCP\\SabrePluginEvent)\":{\"*statusCode\":200,\"*message\":\"\",\"*server\":{\"[object] (OCA\\DAV\\Connector\\Sabre\\Server)\":{\"tree\":\"[object] (OCA\\DAV\\Connector\\Sabre\\ObjectTree)\",\"*baseUri\":\"/remote.php/webdav/\",\"httpResponse\":\"[object] (Sabre\\HTTP\\Response)\",\"httpRequest\":\"[object] (Sabre\\HTTP\\Request)\",\"sapi\":\"[object] (Sabre\\HTTP\\Sapi)\",\"*plugins\":{\"...\":\"Over 20 items, aborting normalization\"},\"transactionType\":\"head\",\"protectedProperties\":{\"...\":\"Over 20 items, aborting normalization\"},\"debugExceptions\":false,\"resourceTypeMapping\":[],\"enablePropfindDepthInfinity\":true,\"xml\":\"[object] (Sabre\\DAV\\Xml\\Service)\",\"*listeners\":{\"...\":\"Over 20 items, aborting normalization\"},\"*logger\":null}},\"Symfony\\Contracts\\EventDispatcher\\EventpropagationStopped\":false}}: null","userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.13.1","version":"18.0.9.1"}
{"reqId":"X3zuKEnGqhCMNhkb9nv9twAAAJE","level":0,"time":"2020-10-06T22:22:32+00:00","remoteAddr":"96.30.137.154","user":"jpontes","app":"webdav","method":"HEAD","url":"/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","message":{"Exception":"Sabre\\DAV\\Exception\\NotFound","Message":"File with name camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4 could not be located","Code":0,"Trace":[{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":81,"function":"getNodeForPath","class":"OCA\\DAV\\Connector\\Sabre\\ObjectTree","type":"->","args":["camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4"]},{"function":"httpGet","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpGet"],[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:GET",[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":253,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"},false]},{"function":"httpHead","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpHead"],[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:HEAD",[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/webdav/camera/WhatsApp/2020/10/VID-20201004-WA0021.mp4","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/home/yetanoth/own.meetcweb.com/apps/dav/appinfo/v1/webdav.php","line":82,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/home/yetanoth/own.meetcweb.com/remote.php","line":165,"args":["/home/yetanoth/own.meetcweb.com/apps/dav/appinfo/v1/webdav.php"],"function":"require_once"}],"File":"/home/yetanoth/own.meetcweb.com/apps/dav/lib/Connector/Sabre/ObjectTree.php","Line":173,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.13.1","version":"18.0.9.1"}
{"reqId":"X3zuKUnGqhCMNhkb9nv9ugAAAJE","level":0,"time":"2020-10-06T22:22:33+00:00","remoteAddr":"96.30.137.154","user":"jpontes","app":"webdav","method":"MKCOL","url":"/remote.php/dav/uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e","message":{"Exception":"Sabre\\DAV\\Exception\\MethodNotAllowed","Message":"The resource you tried to create already exists","Code":0,"Trace":[{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/CorePlugin.php","line":590,"function":"createCollection","class":"Sabre\\DAV\\Server","type":"->","args":["uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e",{"__class__":"Sabre\\DAV\\MkCol"}]},{"function":"httpMkcol","class":"Sabre\\DAV\\CorePlugin","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/dav/uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/event/lib/EventEmitterTrait.php","line":105,"function":"call_user_func_array","args":[[{"__class__":"Sabre\\DAV\\CorePlugin"},"httpMkcol"],[{"absoluteUrl":"https://own.meetcweb.com/remote.php/dav/uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","line":479,"function":"emit","class":"Sabre\\Event\\EventEmitter","type":"->","args":["method:MKCOL",[{"absoluteUrl":"https://own.meetcweb.com/remote.php/dav/uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]]},{"file":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","line":254,"function":"invokeMethod","class":"Sabre\\DAV\\Server","type":"->","args":[{"absoluteUrl":"https://own.meetcweb.com/remote.php/dav/uploads/jpontes/ee31a6005b3be8edfb544e0672b7582e","__class__":"Sabre\\HTTP\\Request"},{"__class__":"Sabre\\HTTP\\Response"}]},{"file":"/home/yetanoth/own.meetcweb.com/apps/dav/lib/Server.php","line":319,"function":"exec","class":"Sabre\\DAV\\Server","type":"->","args":[]},{"file":"/home/yetanoth/own.meetcweb.com/apps/dav/appinfo/v2/remote.php","line":35,"function":"exec","class":"OCA\\DAV\\Server","type":"->","args":[]},{"file":"/home/yetanoth/own.meetcweb.com/remote.php","line":165,"args":["/home/yetanoth/own.meetcweb.com/apps/dav/appinfo/v2/remote.php"],"function":"require_once"}],"File":"/home/yetanoth/own.meetcweb.com/3rdparty/sabre/dav/lib/DAV/Server.php","Line":1181,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Android) Nextcloud-android/3.13.1","version":"18.0.9.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'instanceid' => '######',
  'passwordsalt' => '######',
  'secret' => '######',
  'trusted_domains' => 
  array (
    0 => 'own.meetcweb.com',
  ),
  'datadirectory' => '/home/yetanoth/ownclouddata',
  'overwrite.cli.url' => 'https://own.meetcweb.com',
  'dbtype' => 'mysql',
  'version' => '18.0.9.1',
  'dbname' => 'yetanoth_ownc571',
  'dbhost' => 'localhost',
  'dbtableprefix' => 'oc_',
  'dbuser' => '######',
  'dbpassword' => '######',
  'installed' => true,
  'theme' => '',
  'maintenance' => true,
  'appstore.experimental.enabled' => false,
  'loglevel' => 0,
  'trashbin_retention_obligation' => 'auto',
  'debug' => false,
  'mail_from_address' => 'admin',
  'mail_smtpmode' => 'smtp',
  'updater.release.channel' => 'stable',
  'mail_domain' => 'meetcweb.com',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => 'mail.meetcweb.com ',
  'mail_smtpport' => '465',
  'mail_smtpname' => '######',
  'mail_smtppassword' => '######',
  'integrity.check.disabled' => false,
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
    1 => 'occweb',
    2 => 'gpxmotion',
  ),
  'mysql.utf8mb4' => true,
  'data-fingerprint' => '######',
  'updater.secret' => '######',

Maintenance mode enabled so phone clients are not constantly trying to upload files

The output of your Apache/nginx/system log in /var/log/____:
Unavailable

I have found the solution on my own, and has nothing to do with NextCloud itself. After doing some searching, found a solution was to disable ModSecurity within cPanel.

Submitted a ticket to webhost to see if nextcloud exclusion rules can be added, avalable here:

1 Like