Internal server error after move of NC onto a new subdomain

Nextcloud version 18.0.4.2
Operating system and version Ubuntu 18.04):
Apache version 2.4.29
PHP version 7.2.24

The issue I am facing:
Internal Server Error

Is this the first time you’ve seen this error? Y

Additional information: On this QA-Server are 2 individual
(independent of each other) instances of Nextcloud. I have tried to moive one of these (as described below) to a subdomain. The issue somehow occurs on both instances. :open_mouth:

Steps to replicate it:
Migrate a nextcloud instance from a domain to a subdomain as follows:

  1. database stays - it is reachable under the same host/db-name/db-user/password
  2. Put Nextcloud Instance into maintenance mode, by amending /config/config.php
  3. Copy former datadirectory into new directory and amend the access rights accordingly (recursivly)
  4. Copy former nextcloud-directory into new directory and amend the access rights accordingly
    (recursivly)
  5. Change the following parameters inside /nextcloud/config/config.php accordingly:
  • trusted_domains (new domain - its a subdomain of the former one)
  • datadirectory (new path)
  • overwrite.cli.url (new url)
  • maintenance (back to “false”)
  1. Try to launch the new URL from the browser

The output of my Nextcloud log in file: datadirectory/nextcloud.log :

/var/www/clients/client4/web10/private/nextcloud-data# cat nextcloud.log | grep 2021
PROVIDES NO RESULT

The output of my config.php file in /path/to/nextcloud

<?php
$CONFIG = array (
  'instanceid' => '############################',
  'passwordsalt' => '############################',
  'secret' => '############################################',
  'trusted_domains' => 
  array (
    0 => 'sub.domain.local',
  ),
  'datadirectory' => '/var/www/clients/client4/web10/private/nextcloud-data',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'https://sub.domain.local/nextcloud',
  'dbname' => 'dbname',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'dbuser',
  'dbpassword' => 'dbpassword',
  'installed' => true,
  'maintenance' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'logtimezone' => 'Europe/Vienna',
  'has_rebuilt_cache' => true,
);

From Nextcloud Instance I tried to move (just a relevant part of it):
The output of root@webqa1:/var/www/clients/client4/web10/log# cat * | grep nextcloud:

[Sun Mar 14 17:35:00.813373 2021] [proxy_fcgi:error] [pid 8141:tid 140649313613568] [client LOCAL-IP:53608] AH01071: Got error 'PHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","ocskxyjkcxpu"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","ocskxyjkcxpu"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1040,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/DB/Connection.php","line":220,"function":"executeUpdate","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":683,"function":"executeUpdate","class":"OC\\\\DB\\\\Connection","type":"->","args":["PRAGMA read_uncommitted ...\n'
[Sun Mar 14 17:35:00.821916 2021] [proxy_fcgi:error] [pid 8141:tid 140649313613568] [client LOCAL-IP:53608] AH01071: Got error 'PHP message: {"reqId":"39U0RCw74n6Wb3K6Ysn5","level":3,"time":"2021-03-14T16:35:00+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.3'
[Sun Mar 14 17:35:11.227471 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","oc6l5780yr9q"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","oc6l5780yr9q"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1040,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/DB/Connection.php","line":220,"function":"executeUpdate","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":683,"function":"executeUpdate","class":"OC\\\\DB\\\\Connection","type":"->","args":["PRAGMA read_uncommitted ...\n'
[Sun Mar 14 17:35:11.227717 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"WjznhpXPCY09oQCqpjFD","level":3,"time":"2021-03-14T16:35:11+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.3'
[Sun Mar 14 17:35:12.342848 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","ocpv0yj7v531"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","ocpv0yj7v531"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1040,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/DB/Connection.php","line":220,"function":"executeUpdate","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":683,"function":"executeUpdate","class":"OC\\\\DB\\\\Connection","type":"->","args":["PRAGMA read_uncommitted ...\n'
[Sun Mar 14 17:35:12.343152 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"6c1KqBxrkKV1sBxpseB4","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.3'
[Sun Mar 14 17:35:12.934683 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","ocxrk17mubna"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","ocxrk17mubna"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1040,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/DB/Connection.php","line":220,"function":"executeUpdate","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":683,"function":"executeUpdate","class":"OC\\\\DB\\\\Connection","type":"->","args":["PRAGMA read_uncommitted ...\n'
[Sun Mar 14 17:35:12.935018 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"iSdzNtdHA0vzOBN1mELL","level":3,"time":"2021-03-14T16:35:12+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.3'
[Sun Mar 14 17:35:14.523304 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","oc0cjxf52g6t"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","oc0cjxf52g6t"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"Doctrine\\\\DBAL\\\\DBALException","Message":"Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [14] unable to open database file","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":1040,"function":"connect","class":"OC\\\\DB\\\\Connection","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/DB/Connection.php","line":220,"function":"executeUpdate","class":"Doctrine\\\\DBAL\\\\Connection","type":"->","args":["PRAGMA read_uncommitted = 1",[],[]]},{"file":"/var/www/clients/client4/web10/web/nextcloud/3rdparty/doctrine/dbal/lib/Doctrine/DBAL/Connection.php","line":683,"function":"executeUpdate","class":"OC\\\\DB\\\\Connection","type":"->","args":["PRAGMA read_uncommitted ...\n'
[Sun Mar 14 17:35:14.523523 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"jL6tjat7AT878ecR5yue","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.3'
[Sun Mar 14 17:35:14.807959 2021] [proxy_fcgi:error] [pid 8141:tid 140649322006272] [client LOCAL-IP:53612] AH01071: Got error 'PHP message: {"reqId":"K6rkDQCm3l4BqQWyYFQE","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"touch(): Utime failed: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#241","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"K6rkDQCm3l4BqQWyYFQE","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"fopen(/var/www/clients/client4/web10/web/nextcloud/config/config.php): failed to open stream: Permission denied at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#242","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"K6rkDQCm3l4BqQWyYFQE","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"PHP","method":"GET","url":"/nextcloud/","message":"chmod(): Operation not permitted at /var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php#245","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36","version":""}\nPHP message: {"reqId":"K6rkDQCm3l4BqQWyYFQE","level":3,"time":"2021-03-14T16:35:14+00:00","remoteAddr":"LOCAL-IP","user":"--","app":"index","method":"GET","url":"/nextcloud/","message":{"Exception":"OC\\\\HintException","Message":"Can't write into config directory!","Code":0,"Trace":[{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/Config.php","line":133,"function":"writeData","class":"OC\\\\Config","type":"->","args":[]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/SystemConfig.php","line":112,"function":"setValue","class":"OC\\\\Config","type":"->","args":["instanceid","occ8c171qtgg"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/private/legacy/util.php","line":1151,"function":"setValue","class":"OC\\\\SystemConfig","type":"->","args":["instanceid","occ8c171qtgg"]},{"file":"/var/www/clients/client4/web10/web/nextcloud/lib/base.php","line":420,"function":"getInstanceId","class":"OC_Util","type":"::","args":[]},{"file":"/var/www/clients/client4/web10/web/nex...\nPHP message: {"reqId":"K6rkDQCm3l4BqQWyYFQE","level":3,"time":"2021-03-14T16:35:14+00:00"

From NextCloud Instance I did not touch at all (independend installation on different vhost):
Output of root@webqa1://var/www/clients/client3/web3/log# cat * | grep nextcloud

similar output

For sure I could roll back the snap i took before and perform a new installation to get this one instance onto the subdomain, but I currently hope that this is maybe just a little step missing to solve this :wink:

Your log states permission denied so I would guess that the file permissions are not set properly. Do make sure the webserver user has access to them.

Thanks, that was it ^^ I have assigned the wrong users within the chown command :roll_eyes:

The following commands solved the issue partly:

chown -R web10:client4 /var/www/clients/client4/web10/web/nextcloud
chown root:root /var/www/clients/client4/web10/web/nextcloud/apc.php

But I now found an issue, that was not given when the instance was at the former domain - by checking the “Security & facility warnings” in the administrative web UI:

Your web server is not set up correctly to resolve “/.well-known/caldav”. For more information, see the documentation.
Your web server is not set up correctly to resolve “/.well-known/carddav”. For more information, see the documentation.

Allthough a cat /var/www/clients/client4/web10/web/nextcloud/.htaccess says:

<IfModule mod_headers.c>
  <IfModule mod_setenvif.c>
    <IfModule mod_fcgid.c>
       SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
       RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
    </IfModule>
    <IfModule mod_proxy_fcgi.c>
       SetEnvIfNoCase Authorization "(.+)" HTTP_AUTHORIZATION=$1
    </IfModule>
  </IfModule>

  <IfModule mod_env.c>
    # Add security and privacy related headers
    Header always set Referrer-Policy "no-referrer"
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Download-Options "noopen"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set X-Permitted-Cross-Domain-Policies "none"
    Header always set X-Robots-Tag "none"
    Header always set X-XSS-Protection "1; mode=block"
    SetEnv modHeadersAvailable true
  </IfModule>

  # Add cache control for static resources
  <FilesMatch "\.(css|js|svg|gif)$">
    Header set Cache-Control "max-age=15778463"
  </FilesMatch>

  # Let browsers cache WOFF files for a week
  <FilesMatch "\.woff2?$">
    Header set Cache-Control "max-age=604800"
  </FilesMatch>
</IfModule>
<IfModule mod_php7.c>
  php_value mbstring.func_overload 0
  php_value default_charset 'UTF-8'
  php_value output_buffering 0
  <IfModule mod_env.c>
    SetEnv htaccessWorking true
  </IfModule>
</IfModule>
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_USER_AGENT} DavClnt
  RewriteRule ^$ /remote.php/webdav/ [L,R=302]
  RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
  RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
  RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
  RewriteRule ^\.well-known/webfinger /public.php?service=webfinger [QSA,L]
  RewriteRule ^\.well-known/nodeinfo /public.php?service=nodeinfo [QSA,L]
  RewriteRule ^\.well-known/carddav /remote.php/dav/ [R=301,L]
  RewriteRule ^\.well-known/caldav /remote.php/dav/ [R=301,L]
  RewriteRule ^remote/(.*) remote.php [QSA,L]
  RewriteRule ^(?:build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
  RewriteCond %{REQUEST_URI} !^/\.well-known/(acme-challenge|pki-validation)/.*
  RewriteRule ^(?:\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
  AddType image/svg+xml svg svgz
  AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
  DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
  ModPagespeed Off
</IfModule>
#### DO NOT CHANGE ANYTHING ABOVE THIS LINE ####

ErrorDocument 403 /nextcloud/
ErrorDocument 404 /nextcloud/

The Admin-Log (NC-WebUI) complains some php openbasedir restrictions, as below:

file_exists(): open_basedir restriction in effect. File(/var/www/clients/client4/web1/web/nextcloud/core/js/merged-template-prepend.json) is not within the allowed path(s): (/var/www/clients/client4/web10/web:/var/www/clients/client4/web10/private:/var/www/clients/client4/web10/tmp:/var/www/sub.domain.local/web:/srv/www/sub.domain.local/web:/usr/share/php5:/usr/share/php:/tmp:dev/random:/dev/urandom:var/www/clients/client4/web10/private/nextcloud-data:/var/www/clients/client4/web10/web/nextcloud) at /var/www/clients/client4/web10/web/nextcloud/lib/private/Template/JSCombiner.php#141

But I have included the following paths inside the open-basedirs:

/var/www/clients/client4/web10/private/nextcloud-data:/var/www/clients/client4/web10/web/nextcloud

I am quite sure that are the only 2 directories, that were also included on the former domain here (path is amended accordingly of yourse).

On the former domain this did not occur… :open_mouth: