Cannot upload binary files <8KB - 'Target folder "<dir>" does not exist any more'

Nextcloud version (eg, 20.0.5): 27.1.3
Operating system and version (eg, Ubuntu 20.04): Linux 2.6.32-954.3.5.lve1.4.92.el6.x86_64 x86_64
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.58
PHP version (eg, 7.4): 8.1.25
Windows 10 Pro / Google Chrome 119.0.6045.160
Nextcloud Android app version: 3.26.0

Uploads of binary files (PNG, DOCX, etc…) less than 8192 bytes fail with UI error message Target folder "<dir>" does not exist any more. This occurs using both drag-and-drop and + New → Upload File buttons through chrome web browser. Using the android app, failure also occurs with the notification “Server not found”.

Binary files (PNG, DOCX, etc…) succeed if >= 8192 bytes in size.
UTF encoded files (TXT, etc…) succeed regardless of size.

Nextcloud is running on a shared webhost and was freshly installed using cpanel/softalicious. Hosting support has confirmed the problem, but does not have a solution.

Anecdotally, similar failures occur with Dokuwiki file uploads, but not with phpbb on the same server. This wreaks of a server problem, but I must explore all avenues if I’m to figure this out and fix it.

Thank you.

Steps to replicate it:

  1. Attempt to upload a binary (PNG, DOCX, etc…) file smaller than 8192B in size.
  2. ??
  3. Profit

The output of your Nextcloud log in Admin > Logging:
No log file output is created when this problem occurs.

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

$CONFIG = array (
  'instanceid' => 'REMOVED',
  'passwordsalt' => 'REMOVED',
  'secret' => 'REMOVED',
  'trusted_domains' => 
  array (
    0 => 'REMOVED',
  'datadirectory' => '/home/REMOVED/nextclouddata',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://REMOVED/nextcloud',
  'dbname' => 'REMOVED',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'REMOVED',
  'dbpassword' => 'REMOVED',
  'installed' => true,
  'mysql.utf8mb4' => true,
  'mail_from_address' => 'admin',
  'mail_smtpmode' => 'sendmail',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'REMOVED',

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



Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.


Update- hosting support has identified the issue is caused by their server’s ModSecurity settings. They whitelisted something for me, and the issue appears to be solved. The host would not tell me what rules were triggered:

“Unfortunately, we cannot share any information about the triggered rules. You can consider it as blocked uploading to the server due to a false-positive rule.”

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