Nextcloud version 27.0.0.8
Operating system and version: Ubuntu Server 22.04 LTS
Apache or nginx version: Apache 2.4.52
PHP version: 8.2.7
Plesk version: Obsidian 18.0.53
The issue you are facing:
I moved dedicated servers and tried moving the .nextcloud
folder and it failed and I saw the version was old so I took out the Files
folder and deleted it and installed a fresh copy via Plesk. I have Nextcloud installed in the default location.
My goal here is to use my secondary drive to host the files as they aren’t taking up space on the nvme.
Plesk install path: /var/www/vhosts/example.com/.nextcloud
Plesk public path: /var/www/vhosts/example.com/nextcloud
Plesk data path: /mnt/md0/nextcloud/
I first tried making a symlink and enabling symlinks in Plesk and it couldn’t find it. Looking over Plesk docs, I saw I could edit config.php to point to a new data folder so I deleted the files symlink and pointed to the new data path. I chowned to the www-data username and chmod 0770 and ran Reindex files and it found all my files. YAY. I then went to the web instance and it said the .ocdata folder might be missing.
I checked and it’s there. I’m not sure what to do at this point.
Is this the first time you’ve seen this error? Y
Steps to replicate it:
- Install Nextcloud via Plesk.
- Edit config.php to point to a new data directory.
- Apply chmod and chown commands to new data directory.
- Reboot server.
- Reindex files within Plesk.
- Load web dashboard.
- Get error
Your data directory is invalid. Ensure there is a file called ".ocdata" in the root of the data directory.
The output of your Nextcloud log in Admin > Logging: Can’t get to web dashboard.
The output of your config.php file in /path/to/nextcloud
(make sure you remove any identifiable information!):
<?php
$CONFIG = array (
'passwordsalt' => 'merp',
'secret' => 'derp',
'trusted_domains' =>
array (
0 => 'localhost',
1 => 'example.com',
2 => 'www.example.com',
),
'datadirectory' => '/mnt/md0/nextcloud/',
'dbtype' => 'mysql',
'version' => '27.0.0.8',
'overwrite.cli.url' => 'http://localhost',
'dbname' => 'nextcloud',
'dbhost' => 'localhost:3306',
'dbport' => '',
'dbtableprefix' => 'oc_',
'mysql.utf8mb4' => true,
'dbuser' => 'ncuserf',
'dbpassword' => 'merp',
'installed' => true,
'instanceid' => 'xxx',
'maintenance' => false,
);
The output of your Apache/nginx/system log in /var/log/____
:
AH01071: Got error '; PHP message: PHP Warning: is_file(): open_basedir restriction in effect. File(/mnt/md0/nextcloud//nextcloud.log) is not within the allowed path(s): (/var/www/vhosts/example.com/:/tmp/) in /var/www/vhosts/example.com/nextcloud/lib/private/Log/File.php on line 85
WELP! There it is haha. I added /mnt/md0/nextcloud under open_basedir in PHP settings within Plesk, restarted Apache service, and then success! Pretty much instantly.
I’m still posting this for others to keep in mind that if your Nextcloud data folder is outside of your web directory, you’ll need to add it to your PHP settings under open_basedir. For example, here is what mine is set to: {WEBSPACEROOT}{/}{:}{TMP}{/}{:}/mnt/md0/nextcloud/
I hope this helps people in the future <3