nextcloud / nextcloudpi

📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, curl installer...
https://nextcloudpi.com
2.49k stars 295 forks source link

Fix "No snapshots found" in WEBUI and fix restore-snapshot #1842

Open martinwilco opened 10 months ago

martinwilco commented 10 months ago

Issue nextcloud#1573: No snapshots found on WEBUI backups page When creating BTRFS snapshots, either manually or automatically, the snapshots are stored in /media/myCloudDrive/ncp-snapshots. The snapshots should be displayed on WEBUI Backups page but there is an error "No snapshots found". The reason is that backups.php looks for snapshots in /media/myCloudDrive/ncdata/ncp-snapshots which is the wrong path. Solution: Fix the path in backups.php, now the snapshots are displayed correctly on WEBUI Backups page.

Issue nextcloud#1830: Restore BTRFS snapshot fails Restoring a BTRFS snapshot fails with "ERROR: Not a Btrfs subvolume: Invalid argument". That is because nc-restore-snapshot.sh tries to delete /media/myCloudDrive/ncdata/data instead of /media/myCloudDrive/ncdata. Thanks to @Dimitar-Boychev for pointing out the issue and providing the solution.

theCalcaholic commented 10 months ago

Hi, thank you for the PR! Unfortunately this can't be fixed so easily, because the data directory location is either in /ncdata or in/ncdata/data, depending on whether you are using nc-encrypt or not. I'll have a look at this after the next update (that's shortly going to be released).

Dimitar-Boychev commented 10 months ago

@theCalcaholic how can I get to the situation where the data directory is /ncdata ?

I just enabled nc-encrypt -> rebooted -> unlocked via the web interface and I get /ncdata/data as data dir.

root@nextcloudpi:/home/ncpssh# df -h
Filesystem                             Size  Used Avail Use% Mounted on
/dev/root                               15G  2.6G   12G  19% /
devtmpfs                               3.7G     0  3.7G   0% /dev
tmpfs                                  3.9G     0  3.9G   0% /dev/shm
tmpfs                                  1.6G  9.2M  1.6G   1% /run
tmpfs                                  5.0M  4.0K  5.0M   1% /run/lock
/dev/mmcblk0p1                         255M   31M  225M  12% /boot
/dev/sda1                               58G  1.1G   55G   2% /media/myCloudDrive
tmpfs                                  782M     0  782M   0% /run/user/1002
/media/myCloudDrive/ncdata/ncdata_enc   58G  1.1G   55G   2% /media/myCloudDrive/ncdata/data
root@nextcloudpi:/home/ncpssh# ncc config:system:get datadirectory
/media/myCloudDrive/ncdata/data
root@nextcloudpi:/home/ncpssh# sudo -u www-data php -r 'include("/var/www/nextcloud/config/config.php"); echo($CONFIG["datadirectory"]);'
/media/myCloudDrive/ncdata/data

Then I disabled nc-crypt and rebooted. The data dir ramained in /ncdata/data.

root@nextcloudpi:/home/ncpssh# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        15G  2.6G   12G  19% /
devtmpfs        3.7G     0  3.7G   0% /dev
tmpfs           3.9G     0  3.9G   0% /dev/shm
tmpfs           1.6G  1.2M  1.6G   1% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
/dev/mmcblk0p1  255M   31M  225M  12% /boot
/dev/sda1        58G  1.1G   55G   2% /media/myCloudDrive
tmpfs           782M     0  782M   0% /run/user/1002
root@nextcloudpi:/home/ncpssh# ncc config:system:get datadirectory
/media/myCloudDrive/ncdata/data
root@nextcloudpi:/home/ncpssh# sudo -u www-data php -r 'include("/var/www/nextcloud/config/config.php"); echo($CONFIG["datadirectory"]);'
/media/myCloudDrive/ncdata/data
JSchoeck commented 5 months ago

Any more work being done regarding this fix?

m-breitbach commented 4 months ago

I am also very interested in the current status, as the standard recovery routine involving snapshots seems to be broken.