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

Hi There I am getting this error message.
Running the nexcloudpi image on the nexcloud WD box set up with raspbery 2

anyone can help ??

thank yoy

2 Likes

@nachoparker

Any idea?

Thanx

Hi,

Didnā€™t see because it wasnā€™t in the ā€˜apliacesā€™ category

Was it working fine for you before? were you doing anything when this happened?

ā€¦movedā€¦

thanks Jimmy!

1 Like

it worked very good actually and then one morning it stopped no idea why the pi was running

ok, letā€™s see

Whatā€™s the output of

sudo grep datadirectory /var/www/nextcloud/config/config.php

And

sudo ls -ld $( sudo grep datadirectory /var/www/nextcloud/config/config.php | awk '{ print $3 }' | grep -oP "[^']*[^']" | head -1 )

And

ls -l /media/

And

systemctl status nc-automount-links

after the first command

I got this

after ls -l /media/
I get
ā€œtotal 0ā€

and after the last one
systemctl status nc-automount-links

I get
"Unit nc-automount-links could not be found "

you misstyped this one

systemctl status nc-automount-links

in any case, if you have automount on, which I assume you have, it seems like you have no USB drive present.

Output of

lsblk -f

?

ohh I see tou are right
now i got this

btw I got this error when trying to access it from outside of LAN

well, at some point you USB drive was extracted or umounted (DELETE,ISDIR line).

have you tried rebooting?

yes ā€¦ it didnā€™t help
It could be there was a power outage last week

That can easily cause SD card corruption. Maybe we can try to rule that option out.

Maybe you can try to check for SD card integrity

Also, even after reboot the output of systemctl status nc-automount-links is the same?

yep still the same

how about the SD card? is it fine? did you check for errors? (link)

SD card is okā€¦ did move the image out and copy back to the cardā€¦ and all goodā€¦ no errors and the pi booted ā€¦

ok, what happens if you unplug it and plug it again, is the folder in

ls -l /media

?

Maybe some systemd update broke the thing again? in that case Iā€™ll have to retest it