I searched around the data directory for anything not normal and found that I have that directory on another physical disk in the system as the www, which was just a symlink to the mountpoint of the real disk. So I set the path to data directory in all config-files (php, nginx and NC) to the real path (/mnt/md0/nextcloud_data).
Now I get the maintenance-mode-message in browser, however when I try to disable maintenance mode by occ command, I get this response:
PHP Warning: file_exists(): open_basedir restriction in effect. File(/mnt/md0/nextcloud_data/nextcloud.log) is not within the allowed path(s): (/var/www/:/tmp/:/etc/md0/nextcloud_data:) in /var/www/lib/private/Log/File.php on line 57
PHP Warning: is_writable(): open_basedir restriction in effect. File(/mnt/md0/nextcloud_data) is not within the allowed path(s): (/var/www/:/tmp/:/etc/md0/nextcloud_data:) in /var/www/lib/private/Log/File.php on line 58
{"reqId":"N5LvDYNyzwGXwz1iDkUl","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APCu not available for local cache","level":1,"time":"2018-01-04T04:20:13+00:00","method":"--","url":"--","user":"--","version":"11.0.3.2"}
{"reqId":"N5LvDYNyzwGXwz1iDkUl","remoteAddr":"","app":"cli","message":"Memcache \\OC\\Memcache\\APCu not available for distributed cache","level":1,"time":"2018-01-04T04:20:13+00:00","method":"--","url":"--","user":"--","version":"11.0.3.2"}
Nextcloud is in maintenance mode - no apps have been loaded
{"reqId":"N5LvDYNyzwGXwz1iDkUl","remoteAddr":"","app":"PHP","message":"file_exists(): open_basedir restriction in effect. File(\/mnt\/md0\/nextcloud_data\/.ocdata) is not within the allowed path(s): (\/var\/www\/:\/tmp\/:\/etc\/md0\/nextcloud_data:) at \/var\/www\/lib\/private\/legacy\/util.php#956","level":3,"time":"2018-01-04T04:20:13+00:00","method":"--","url":"--","user":"--","version":"11.0.3.2"}
{"reqId":"N5LvDYNyzwGXwz1iDkUl","remoteAddr":"","app":"PHP","message":"is_dir(): open_basedir restriction in effect. File(\/mnt\/md0\/nextcloud_data) is not within the allowed path(s): (\/var\/www\/:\/tmp\/:\/etc\/md0\/nextcloud_data:) at \/var\/www\/lib\/private\/legacy\/util.php#696","level":3,"time":"2018-01-04T04:20:13+00:00","method":"--","url":"--","user":"--","version":"11.0.3.2"}
Data directory (/mnt/md0/nextcloud_data) is invalid
Please check that the data directory contains a file ".ocdata" in its root.
Cannot create "data" directory (/mnt/md0/nextcloud_data)
This can usually be fixed by <a href="https://docs.nextcloud.com/server/11/go.php?to=admin-dir_permissions" target="_blank" rel="noreferrer">giving the webserver write access to the root directory</a>.
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/lib/private/Console/Application.php:144
Stack trace:
#0 /var/www/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/occ(11): require_once('/var/www/consol...')
#2 {main}{"reqId":"N5LvDYNyzwGXwz1iDkUl","remoteAddr":"","app":"PHP","message":"chmod(): open_basedir restriction in effect. File(\/mnt\/md0\/nextcloud_data\/nextcloud.log) is not within the allowed path(s): (\/var\/www\/:\/tmp\/:\/etc\/md0\/nextcloud_data:) at \/var\/www\/lib\/private\/Log\/File.php#119","level":3,"time":"2018-01-04T04:20:13+00:00","method":"--","url":"--","user":"--","version":"11.0.3.2"}
So there’s several errors around path:
- no access to data directory. Which is not true. User www-data owns that directory with 750 permissions.
- It claims nextcloud.log is not within allowed path > not true too, that path is allowed in all config files
- It claims theres no .ocdata file in that directory > but it is