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!):

<?php
$CONFIG = array (
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'xxx.fr',
    2 => 'www.xxx.fr',
  ),
  '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/xxx.fr/.nextcloud/data/9d67e72f9807',
  'dbtype' => 'mysql',
  'version' => '19.0.3.1',
  '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' => 'ssl0.ovh.net',
  '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:

Accessibility
Activity
Calendar
Collaborative tags
Comments
Contacts interaction
Deleted files
File sharing
First run wizard
Log Reader
Markdown Editor
Nextcloud announcements
Notes
Notifications
Password policy
PDF viewer
Photos
Privacy
Recommendations
Right click
Share by mail
Splash
Support
Tasks
Text
Two-Factor Admin Support
Two-Factor TOTP Proivider
Update notification
Usage survey
Versions
Video player

Try a clean install: same error.

Finally I find an error in Plesk:

2020-09-19 15:04:51 Error 86.xxx.yyy.zzz 403 PUT [/nextcloud/remote.php/webdav/Documents/readme.txt](https://212.xxx.yyyy.zzz:8443/smb/file-manager/code-editor?currentDir=%2Fhttpdocs%2Fnextcloud%2Fremote.php%2Fwebdav%2FDocuments&subscriptionId=2&file=readme.txt&redirect=%2Fsmb%2Flog-file%2Fbrowser%2Fid%2F2)HTTP/2.0 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/domain.fr/conf/nginx.conf

How to exclude readme from this rule ?

Maybe this links are interesting:


https://nginx.org/en/docs/http/ngx_http_core_module.html#location

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.

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

1 Like