An unknown error has occurred

Hello !

this error has been driving me crazy since a week.

I have this error when I upload a file exactly named ‘readme.txt’ in Nextcloud (‘readme 2.txt’ upload fine).
I didn’t see anything in nextcloud.log and apache log.

I’m not sure this error is due to nextcloud, but if anyone has an idea…
Nextcloud version 19.0.3:
Operating system and version Ubuntu:
Apache or nginx version Apache 2.4.29 Nginx 1.18.0:
PHP version 7.3.22:

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

$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => '',
    2 => '',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  'datadirectory' => '/var/www/vhosts/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud_075209c5',
  'dbhost' => 'localhost:3306',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'xxx',
  'dbpassword' => 'xxx',
  'installed' => true,
  'instanceid' => 'ocatmf6l879y',
  'app_install_overwrite' => 
  array (
    0 => 'joplin',
    1 => 'bookmarks_fulltextsearch',
  'maintenance' => false,
  'mail_domain' => 'xxx',
  'mail_from_address' => 'xxx',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtphost' => '',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '465',
  'mail_smtpname' => 'xxx',
  'mail_smtppassword' => 'xxx',
  'mail_smtpsecure' => 'ssl',
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
  'twofactor_enforced_excluded_groups' => 
  array (
  'loglevel' => 0,
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'logdateformat' => 'F d, Y H:i:s',

do you have ransomware-protection app enabled? would you like to check if uploading of readme is allowed?

Thanks for your suggestion.

I don’t have ransomware-protection app:

Collaborative tags
Contacts interaction
Deleted files
File sharing
First run wizard
Log Reader
Markdown Editor
Nextcloud announcements
Password policy
PDF viewer
Right click
Share by mail
Two-Factor Admin Support
Two-Factor TOTP Proivider
Update notification
Usage survey
Video player

Try a clean install: same error.

Finally I find an error in Plesk:

2020-09-19 15:04:51 Error 403 PUT [/nextcloud/remote.php/webdav/Documents/readme.txt]( 146 Accès SSL/TLS Nginx

I found

location ~* "(?:wp-config\.bak|\.wp-config\.php\.swp|(?:readme|license|changelog|-config|-sample)\.(?:php|md|txt|htm|html))" {
        return 403;

in /var/www/vhosts/system/

How to exclude readme from this rule ?

Maybe this links are interesting:

Was Wordpress installed before?

I would try to simply remove “readme|” or the whole rule… But on your own risk :slight_smile:

1 Like

Many thanks zentrix !!

I had to uncheck Block access to sensitive files in Plesk Wordpress Toolkit security

Yes Wordpress was installed before.
I try to remove "readme|” from the rule, but the rule is recreated automatically.

Finally I add the Block access to sensitive files rules (but without "readme|”) in Apache/nginx settings in Plesk.

1 Like