NCP crashes when using nc-backup-auto

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, 12.0.2): 17.0.3
Operating system and version (eg, Ubuntu 17.04): NCP v1.20.7
Apache or nginx version (eg, Apache 2.4.25): N/A
PHP version (eg, 7.1): N/A
System: RasPi 4 (4GB RAM), 6TB WD HDD, 6TB Seagate HDD

The issue you are facing:
Hello!

I’m quite new to NC/NCP and don’t have much knowledge yet, so please be gentle if I don’t understand basic things. :innocent:

I am trying to run a homeserver using a RasPi4 with 4GB RAM with a WD Elements Desktop (6TB) as a data drive and a Seagate Expansion (6TB) as a backup drive. Thanks to the excellent NCP image and Youtube videos I was able to get the server up and running quite easily. So after a few weeks of using it I bought the second drive (Seagate) and wanted to perform a backup of my data. I was able to do this using the NCP Panels nc-backup and had a working backup. Now I wanted to automate this using the NCP Panels nc-backup-auto but as I applied it (incl. data: yes, periodicity: 1, backups to keep: 2) at night and went to sleep, my NC was showing the following error message the next morning (system language is german):


Translation: It seems that you want to reinstall Nextcloud. But the file CAN_INSTALL is missing from your configurations directory. Please create the file CAN_INSTALL in your configurations directory to proceed.

Now I was able to restore the my system thanks to the manual backup but I could reproduce the exact same error when trying to enable nc-backup-auto again.

Sadly I was not able to download the log data as I couldn’t access the admin account during the error. And also I did not manage to download the config.php file via Terminal to my Mac, so I can only copy the output of /?app=config after restoring the backup.

Currently I can’t really use my server as I don’t have a sufficent backup solution established.

I am happy if anybody has any help or advice!

Thanks
imp4ct

PS: I’m sorry if I did not paste the config correctly, feel free to offer advice on this as well.

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

Steps to replicate it:

  1. apply ‘Set periodic backups’

The output of your Nextcloud log in Admin > Logging:

N/A (Logging not accessible during error)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):
Couldnt copy config.php, output of /?app=config after restoration of backup instead:

passwordsalt
(sensitive)
secret
(sensitive)
trusted_domains
0
localhost
5
nextcloudpi.local
7
nextcloudpi
8
nextcloudpi.lan
11
(sensitive)
1
(sensitive)
20
(sensitive)
21
(sensitive)
12
(sensitive)
datadirectory
/media/myCloudDrive/ncdata
dbtype
mysql
version
17.0.3.1
overwrite.cli.url
(sensitive)
dbname
nextcloud
dbhost
localhost
dbport

dbtableprefix
oc_
mysql.utf8mb4
1
dbuser
ncadmin
dbpassword
(sensitive)
installed
1
instanceid
(sensitive)
memcache.local
\OC\Memcache\Redis
memcache.locking
\OC\Memcache\Redis
redis
host
/var/run/redis/redis.sock
port
0
timeout
0
password
(sensitive)
tempdirectory
/media/myCloudDrive/ncdata/tmp
mail_smtpmode
smtp
mail_from_address
(sensitive)
mail_domain
gmail.com
preview_max_x
2048
preview_max_y
2048
jpeg_quality
60
overwriteprotocol
https
maintenance

logfile
/media/myCloudDrive/ncdata/nextcloud.log
loglevel
2
log_type
file
mail_sendmailmode
smtp
mail_smtphost
smtp.gmail.com
mail_smtpport
465
mail_smtpsecure
ssl
mail_smtpauth
1
mail_smtpname
(sensitive)
mail_smtppassword
(sensitive)
mail_smtpauthtype
LOGIN
theme

data-fingerprint
(sensitive)

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

N/A

This still works fine for me, although slightly outdated.

I use btrfs for ncdata, so I exclude data, so only Nextcloud files and DB are backed-up by nc-backup-auto. But with ncdata it should work also, it just takes longer, depending size and nr of files.

Then you can set nc-rsync and nc-rsync-auto to sync to drive nr2. Or use nc-snapshot and nc-snapshot-sync if using btrfs.

How did you mount the second drive? When nc-automount is enabled, NC can sometimes no longer find the original mount point.

Check output of

ls -lh /media/

and

df -h

To view state of things :wink:

Thanks for your answer. I used nc-automount for both drives, but as I was able to manually (nc-backup) backup to the second drive I’m not sure if this was the problem with the automated backup. Also I can see the sda and sdb device in my web interface so I guess it’s connected properly.

ls -lh /media/ displays the following:

total 32K
drwx------ 1 pi   pi   174 Feb 17 22:08 Backup
drwxr-xr-x 1 root root  62 Feb 16 21:04 myCloudDrive
lrwxrwxrwx 1 root root  13 Feb 16 12:31 USBdrive -> /media/Backup
lrwxrwxrwx 1 root root  19 Feb 16 12:31 USBdrive1 -> /media/myCloudDrive

and for df -h

> Filesystem      Size  Used Avail Use% Mounted on
> /dev/root        15G  2.0G   12G  15% /
> devtmpfs        1.8G     0  1.8G   0% /dev
> tmpfs           2.0G     0  2.0G   0% /dev/shm
> tmpfs           2.0G   17M  1.9G   1% /run
> tmpfs           5.0M  4.0K  5.0M   1% /run/lock
> tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
> /dev/mmcblk0p1  253M   53M  200M  22% /boot
> /dev/sdb1       5.5T  136G  5.4T   3% /media/myCloudDrive
> /dev/sda1       5.5T  405G  5.1T   8% /media/Backup
> tmpfs           391M     0  391M   0% /run/user/1000

By the way, you are touching an unasked question that has been on my mind for some time:
Using nc-backup always creates an entirely new backup which takes quite a lot of time with the amount of data I have on my NC. During this the cloud is in maintenance mode and cannot be accessed, that is not optimal for me as the users of my NC will be spread across different timezones with no overlapping “nighttime” to use for backups.

Now as far as I understand the method using nc-snapshot-auto in combination with dataless nc-backup is more efficent (less time in maintenance mode, less space used) but also more complex. Is the following step-by-step approach correct?

To create this kind of backups I would proceed as follows:

  1. Set nc-backup-auto to active with the following settings:

  2. Export the configuration to the Backup drive using nc-export-ncp

  3. Create Snapshots via nc-snapshot. I’m unsure what Limit means, suggetions? Also I don’t know wether this step is needed or if I can directly proceed to #4.

  4. Automate Snapshots using nc-snapshot-auto

  5. Sync the snapshots to the Backup drive using nc-snapshot-sync. Sync periodicity meaning how often the snapshots are synched to the Backup drive, so preferably a low number like 1 for daily sync? (The path on the data drive will be created after step #3 I assume)

Now to restore it:

  1. Import NCP-Configuration using nc-import-ncp
  2. Restore the dataless backup using nc-restore
  3. Restore the latest snapshot using nc-restore-snapshot

After this, NC should be restored and fully functional, right?

Thanks again for your help :relieved:

Yes, that is the way to save a lot of time and space.

Note: You need to adjust your Snapshot directory’s PATH to
/media/myCloudDrive/ncp-snapshots
and Destination PATH to
/media/Backup/ncp-snapshots