Problems with ncp-snapshots

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): v.1.54.3
Operating system and version (eg, Ubuntu 24.04): Debian 11 (bullseye)
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 8.3): replace me

The issue you are facing:

I just realized ncp-snapshots are not being created. My ncp-snapshots folder is empty. I get an error reported when the cron script is run (see the logs at the end of the message) saying that my ncp-snapshots is not in a btrfs filesystem. I am quite sure my /media/myCloudDrive is a btrfs filesystem, so I am not sure what is going on.

Is this the first time you’ve seen this error? (Y/N): Y

Steps to replicate it:

  1. Activate nc-snapshots
  2. Check messages under /var/mail/root
  3. You’ll see error message:
    ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
    run-parts: /etc/cron.hourly/btrfs-snp exited with return code 1
    

The output of your Nextcloud log in Admin > Logging:

I don’t think this is relevant because it is not a problem of Nextcloud itself but of the snapshots NCP does.

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

I don’t think this is relevant because it is not a problem of Nextcloud itself but of the snapshots NCP does.

The output of your Apache/nginx/system log in /var/log/____:

I don’t think this is relevant because it is not a problem of Nextcloud itself but of the snapshots NCP does.

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

I don’t think this is relevant because it is not a problem of Nextcloud itself but of the snapshots NCP does.

Errors in /var/mail/root:


/etc/cron.hourly/btrfs-snp:
Cannot load Zend OPcache - it was already loaded
Cannot load Zend OPcache - it was already loaded
ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
ERROR: not a btrfs filesystem: /media/myCloudDrive/../ncp-snapshots
run-parts: /etc/cron.hourly/btrfs-snp exited with return code 1

What does your datadirectory layout look like?
On my site /media/myCloudDrive is a btrfs partition. It contains directory ncdata which itself contains data and ncp-snapshots.
I’d check the value of datadirectoy, either by means of webui or the following commands in a shell:

source /usr/local/etc/library.sh
get_nc_config_value datadirectory

Those 2 lines are more or less part of the btrfs-snp script.

I have just realized that ncp-snaphsots is not in /media/myCloudDrive but in /media/. I guess that is my problem. How should I create ncp-snapshots in /media/myCloudDrive? A subvolume? I would be helpful for me to know the exact command.

I guess btrfs subvolume create /media/myCloudDrive/ncp-snapshots ?

Thank you in advance,
Javier

As far as I remember I just created a regular directory. The snapshots are created within this directory. But it should be on the same directory level as your data directory.

ls -al /media/myCloudDrive1/ncdata/
total 16
drwxr-xr-x 1 root root 34 Apr 2 20:08 .
drwxr-xr-x 1 root root 12 May 4 2023 …
drwxr-x— 1 www-data www-data 442 Aug 26 15:05 data
drwxr-xr-x 1 www-data www-data 2266 Aug 28 00:17 ncp-snapshots

Thank you. I removed ncp-snapshots and created a new one under /media/myCloudDrive/. But it still was trying to put it in /media/ncp-snapshots. So I look at the cron script and it was like this:


#!/bin/bash

source /usr/local/etc/library.sh

DATADIR="$(get_nc_config_value datadirectory)" || {
  echo -e "Error reading data directory. Is NextCloud running and configured?";
  exit 1;
}

# file system check
MOUNTPOINT="$(stat -c "%m" "$DATADIR")" || return 1
[[ "$( stat -fc%T "$MOUNTPOINT" )" != "btrfs" ]] && {
  echo "$MOUNTPOINT is not in a BTRFS filesystem"
  exit 1
}

/usr/local/bin/btrfs-snp $MOUNTPOINT hourly  24 3600    ../ncp-snapshots
/usr/local/bin/btrfs-snp $MOUNTPOINT daily    7 86400   ../ncp-snapshots
/usr/local/bin/btrfs-snp $MOUNTPOINT weekly   4 604800  ../ncp-snapshots
/usr/local/bin/btrfs-snp $MOUNTPOINT monthly 12 2592000 ../ncp-snapshots

so I changed the last four lines removing the ../ in ../ncp-snapshots. Now it seems to be working!

I wonder how those dots ended there :thinking:.

Thank you for your help!

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.