Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

martinwilco
Copy link

Issue #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 #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.

@martinwilco martinwilco changed the title Fix nextcloud#1573 "No snapshots found" in WEBUI and fix nextcloud#1830 restore-snapshot Fix "No snapshots found" in WEBUI and fix restore-snapshot Oct 20, 2023
@theCalcaholic
Copy link
Collaborator

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
Copy link

Dimitar-Boychev commented Oct 21, 2023

@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
Copy link

Any more work being done regarding this fix?

@m-breitbach
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants