I was running nextcloud on Raspberry Pi and data was on NAS.
Recently my NAS was crashed and I couldnât rescue the data.
The problem is once I replaced NAS to new one, Nextcloud failed to do anything.
From browser access, it said âinternal server errorâ.
Then OCC said âyou data directory is invalidâ.
So I copied /var/www/html/nextcloud/data to the new NAS and found that it lacks â.ocdataâ, which I cannot find it the original nextcloud data folder.
Is there anyway to recreate ocdata or entire data directory?
Vincent, thank you about your help.
Now I can run occ, and occ check does not return anything.
However, Internal Sever Error persists while accessing from browser.
It looks some connection there through desktop app, and a few folders were created. Server returns 403 forbidden when a new file was added.
Server is /var/www/html/nextcloud/
and data was on NAS.
As NAS is mounted as /media/pi/nas/
in the /media/pi/nas, I can find:
.htaccess
.ocdata
index/html
nextcloud.log
and some user related folders created once nextcloud somehow started yesterday.
Right, I understand that I cannot recover the files. But all users have their own, so it should be fine once nextcloud resumed running.
I run
sudo -u www-data php /var/www/html/nextcloud/occ files:scan
I got
Starting scan for user 1 out of 8 (USER)
Home storage for user USER not writable
Although the data folder is:
drwxrwxâ 2 www-data www-data
which I believe www-data has the correct permission.
(I just double-checked www-data is owner of apache)
files:cleanup or maintenance:repair
Didnât help either.
you may need to create the username folders manually
Iâm not in a state to test this but if you create a username folder USER and scan only for that user does it return a error.
When users connected to Nextcloud with desktop app, the username folders are created with only cache folder exist in it.
With information on other threads, I created files folder in the username folders.
Now at least files:scan works, but internal server error persists and no login page shows up.
While I checked /var/log/apache2/error.log, I found that there is error on finding avatar.
stat: cannot stat â/media/pi/nas/appdata_ocf6796ow8ds/avatar/USER/avatar.128.pngâ: No such file or directory
I created /media/pi/nas/appdata_ocf6796ow8ds/avatar/USER/ and run occ files:scan-app-data.
Then, nextcloud finally start working partiallyâ
(1) browser works and I can login,
(2) files can be synced, if it is newly added. The files supposed to be on the data folder donât sync.
It sounds like I need to clear what nextcloud think it has on the data folder.