[NextcloudPi] ERROR Your data directory is invalid Ensure there is a file called ".ocdata" in the root of the data directory

ls -l /media

and

systemctl status nc-automount-links

total 16
drwxr-xr-x 1 root root 270 Mar 14 11:13 myCloudDrive

systemctl status nc-automount-links

● nc-automount-links.service - Monitor /media for mountpoints and create USBdrive* symlinks
Loaded: loaded (/usr/lib/systemd/system/nc-automount-links.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2018-03-14 11:41:38 UTC; 12h ago
Main PID: 402 (nc-automount-li)
CGroup: /system.slice/nc-automount-links.service
├─402 /bin/bash /usr/local/etc/nc-automount-links-mon
├─417 inotifywait --monitor --event create --event delete --format %f %e /media/
├─418 grep --line-buffered ISDIR
└─419 /bin/bash /usr/local/etc/nc-automount-links-mon

Mar 14 11:41:38 nextcloudpi systemd[1]: Started Monitor /media for mountpoints and create USBdrive* symli
Mar 14 11:41:38 nextcloudpi nc-automount-links-mon[402]: Setting up watches.
Mar 14 11:41:38 nextcloudpi nc-automount-links-mon[402]: Watches established.
Mar 14 11:41:41 nextcloudpi nc-automount-links-mon[402]: myCloudDrive DELETE,ISDIR
Mar 14 11:41:41 nextcloudpi nc-automount-links-mon[402]: myCloudDrive CREATE,ISDIR

I’m having issues with the Data directory as well. I’m running on an Odroid HC-1. I’ve tried the fsck command but it tells me /dev/sda1 is in use.

Any thoughts?
Here is nc-report

NextCloudPi diagnostics

NextCloudPi version  v0.47.1
NextCloudPi image    NextCloudPi_11-22-17
distribution         Debian GNU/Linux 9 \n \l
automount            yes
USB devices          sda
datadir              /media/myCloudDrive/ncdata (doesn't exist)
rootfs usage         1.8G/7.1G
swapfile             /var/swap
Nextcloud check      error
HTTPD service        up
PHP service          up
MariaDB service      up
Redis service        up
Postfix service      up
internet check       ok
port check 80        open
port check 443       open
IP                   192.168.1.102
gateway              192.168.1.1
interface            enx001e0630ca1a
certificates         none
certs due            none
NAT loopback         no
uptime               3min

Nextcloud configuration

Your data directory is invalid
Ensure there is a file called ".ocdata" in the root of the data directory.

Cannot create "data" directory
This can usually be fixed by giving the webserver write access to the root directory. See https://docs.nextcloud.com/server/13/go.php?to=admin-dir_permissions

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /var/www/nextcloud/lib/private/Console/Application.php:148
Stack trace:
#0 /var/www/nextcloud/console.php(89): OC\Console\Application->loadCommands(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/nextcloud/occ(11): require_once('/var/www/nextcl...')
#2 {main}
HTTPd logs

[Sat Mar 03 06:25:07.000434 2018] [core:notice] [pid 3942:tid 3070013440] AH00094: Command line: '/usr/sbin/apache2'
[Sat Mar 03 14:10:16.452323 2018] [log_config:warn] [pid 14605:tid 2699031600] (28)No space left on device: [client 73.176.95.6:54338] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:12:20.319521 2018] [log_config:warn] [pid 14605:tid 2673865776] (28)No space left on device: [client 73.176.95.6:54383] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:14:22.605201 2018] [log_config:warn] [pid 14605:tid 2841637936] (28)No space left on device: [client 73.176.95.6:54433] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:16:24.235928 2018] [log_config:warn] [pid 14605:tid 2791306288] (28)No space left on device: [client 73.176.95.6:54469] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:18:25.472811 2018] [log_config:warn] [pid 14605:tid 2799694896] (28)No space left on device: [client 73.176.95.6:54492] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:20:26.930225 2018] [log_config:warn] [pid 14605:tid 2757751856] (28)No space left on device: [client 73.176.95.6:54508] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:22:27.872345 2018] [log_config:warn] [pid 14605:tid 2740974640] (28)No space left on device: [client 73.176.95.6:54539] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:24:30.303743 2018] [log_config:warn] [pid 14605:tid 2715808816] (28)No space left on device: [client 73.176.95.6:54580] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:26:33.079268 2018] [log_config:warn] [pid 14605:tid 2690642992] (28)No space left on device: [client 73.176.95.6:54595] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:28:35.583215 2018] [log_config:warn] [pid 14605:tid 2648699952] (28)No space left on device: [client 73.176.95.6:54617] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:30:37.628115 2018] [log_config:warn] [pid 14605:tid 2816472112] (28)No space left on device: [client 73.176.95.6:54663] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:32:38.969159 2018] [log_config:warn] [pid 14605:tid 2782917680] (28)No space left on device: [client 73.176.95.6:54685] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:34:41.255853 2018] [log_config:warn] [pid 14605:tid 2766140464] (28)No space left on device: [client 73.176.95.6:54703] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:36:43.137842 2018] [log_config:warn] [pid 14605:tid 2724197424] (28)No space left on device: [client 73.176.95.6:54718] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:38:46.383287 2018] [log_config:warn] [pid 14605:tid 2690642992] (28)No space left on device: [client 73.176.95.6:54744] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:40:49.193276 2018] [log_config:warn] [pid 14605:tid 2665477168] (28)No space left on device: [client 73.176.95.6:54762] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:42:52.259785 2018] [log_config:warn] [pid 14605:tid 2640311344] (28)No space left on device: [client 73.176.95.6:54777] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Mar 03 14:44:54.058460 2018] [log_config:warn] [pid 14605:tid 2816472112] (28)No space left on device: [client 73.176.95.6:54795] AH00646: Error writing to /var/log/apache2/other_vhosts_access.log
[Sat Ma
Database logs


Nextcloud logs

tail: cannot open '/media/myCloudDrive/ncdata/nextcloud.log' for reading: No such file or directory

it happened to me as well. I remove everything. want to buy pi 3 + and try again.

your case is different. What is the output of lsblk -f?

Ok, the links part is not working for you. We have two options

  • make it work for you as soon as possible -> edit the file /var/www/nextcloud/config/config.php and fix the line datadir to point to /media/myCloudDrive/ncdata

  • help me see if I can reproduce the error on my pi and fix it for everybody

NAME FSTYPE LABEL UUID MOUNTPOINT
sda
└─sda1 btrfs myCloudDrive cd58e1a1-1f8f-4884-abf3-7eb59a2c45bc /media/myCloudDrive1
mmcblk1
└─mmcblk1p1 ext4 9c3994d1-1158-45c6-8ea4-271afd4ecf64 /

Seems somehow automount got mixed up and mounted a second data drive. I disable Automount in Webui, then rebooted and then re-enable automount. All is working again.

Sorry to have bothered you.
Robert

Thank you Robert.
I will try what you did.

Nacho, if you want my help in anyway please let me know.

Turns out Roberts method did not work for me unfortunately.

Nacho,
I havent changed my config yet so let me know what I can do to help you.

I think I was able to reproduce, so I am working on this now.

You can change your config to have your instance working again. In any case, it is recommended to use the labels but USBdrive should also work

Thanks for the help

1 Like

Hi Nacho,

Im glad to hear that.
I tried to change the config a little earlier but it says I dont have the permissions to change the config and when I try to change the permissions in the panel it wont work.

Do have any suggestions?

Thanks for all of your help by the way!

that’s ok then, let me push the fix, and we can try it see if it solves your issue.

stay tuned, I’ll write you in a couple hours

ok, I provided a fix for the issue that I could reproduce. Please upgrade to v0.47.3 with sudo ncp-update or similar, and reboot

if still doesn’t work, please output of ls -l /media

1 Like

It is back up and running!
Thank you very much sir!

What was the solution, if you dont mind me asking?

nice!

well, it seems that if the mounting is “slow” enough, the USBdrive links generated didn’t pass the check that it has to be a mountpoint because it is not fully mounted yet at the time of generation.

you can mark as solved

Very interesting!

Cool, thanks again!!!

Hi guys, first thank you for the Nextcloudpi, it really is great way help people control their data… Sorry, I write first time in forum. I used to find all info I needed for solving my issue. Not anymore. Issue in this thread seems to be the same I have, I went through the steps, but I have BTRFS file system… I tried to run check command (sorry still quite newby) and it gave me all OK response… I am afraid my disk is gone with the data… It is actually few weeks old disk and I have older which I wanted to use for snapshots, but did not set up that yet… :-/ any help much appreciated…

This commend helped me check the owner and group settings for the /media folder where my data was moved to. Permissions on the root folder of /media/ was not accessible by the group of www user. Updating this with a chmod for group and other users was the key. The /media/ became visible to the user group of the www user, fixing the problem.

Will crosspost it in the how-to as well. Thanks @nachoparker !