For both I get this error: “Your data directory is invalid. Ensure there is a file called “.ncdata” in the root of the data directory. It should have the content: “# Nextcloud data directory””
The .ncdata file along with the rest are located in the new data directory and all the files have root permissions.
So regardless which procedure is used, the path to the data directory must include the complete path including .../data because this is where the required .ocdata file is located.
Common error message for incorrect path in config file
Error
Your data directory is invalid.
Ensure there is a file called ".ocdata" in the root of the data directory.
have you created the admin-user? see
b)Define data directory before installation (admin-user needs to be created) in /var/snap/nextcloud/current/nextcloud/config/autoconfig.php
please be clear, “similar” process?
your step 3 is incorrect, its no use only restarting FPM, you must restart the snap sudo snap restart nextcloud
I have the same problem. Went through the same manual, connected removable media. Got the error "Your data directory is invalid.
Ensure there is a file called “.ncdata” in the root of the data directory. It should have the content: “# Nextcloud data directory”"
I’ve also ran sudo /snap/bin/nextcloud.occ config:list and got this:
Your data directory is invalid.
Ensure there is a file called “.ncdata” in the root of the data directory. It should have the content: “# Nextcloud data directory”
An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /snap/nextcloud/46218/htdocs/lib/private/Console/Application.php:137
Stack trace: #0 /snap/nextcloud/46218/htdocs/console.php(81): OC\Console\Application->loadCommands() #1 /snap/nextcloud/46218/htdocs/occ(11): require_once(‘…’)
Noone could’ve predicted it, but while trying to re-create the problem for the github issue form, I’ve went through all the steps once more and managed to avoid the problem.
I used this manual to change the directory: Change data directory to use another disk partition · nextcloud-snap/nextcloud-snap Wiki · GitHub
I gave nextcloud access to media thingy as the readme suggests.
I’m not sure what I did differently. My only suggestion would be to be extra attentive when copying the data folder. Cause I did this previously: sudo mv /var/snap/nextcloud/common/nextcloud/data /mnt/chest/storage/data
Please show us what’s in that directory… sudo ls -al /media/nextcloud/data
I’m guessing we’ll see data in there… so your path will need to be 'datadirectory' => '/var/snap/nextcloud/common/nextcloud/data/data' where you’ll find .ocdata and not .ncdata…
I’ve never heard on .ncdata but I stand to be corrected
This is most definitely not a snap issue, it’s my inattentiveness.
As having /data at the end of both ends of the paths is kinda intuitive for a noob (and wrong), I’d suggest maybe adding a small warning about that in the doc… But I’m not sure if it’s not just two of us who made this mistake.
In any case, the docs are not wrong and everything works if you follow them precisely.