Backup Always Fails Due to Errors [Solved]

Nextcloud version (eg, 12.0.2):
Operating system and version (eg, Ubuntu 17.04): Nextcloudpi 1.20.1

The issue you are facing: Every time i try to backup (using ncp) it fails. Output of backup log is below.

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

Steps to replicate it:

  1. Log on to nextcloudpi web interface, run backup (or wait for autoback to run, same result).

Below is the output I see when I try to run a backup (I have removed all the lines that are effectively duplicates, just for different files):

[ nc-backup ]
check free space...
du: cannot access '/media/USBdrive/ncdata/appdata_oclaqn5ofjmm/preview/4661/64-64-crop.jpg': Input/output error
/IMG_20191218_194029.jpg: Cannot stat: Input/output error
tar: ncdata/jing/files/InstantUpload/Camera/2019/12/IMG_20191218_200857.jpg: Cannot stat: Input/output error
tar: Exiting with failure status due to previous errors
error generating backup
Maintenance mode disabled

Appreciate any help I can get!

Could indicate faulty drive, I’d try running nc-hdd-test?

1 Like

Ran the HD test, but passed all tests - health of the HDDs looks good.

Indicates that folder is not writable/owned by www-data, try running:

sudo chown www-data:www-data -R /media/USBdrive/ncdata/appdata_oclaqn5ofjmm

Hey thanks for the suggestion. Well I just tried this and almost get the same error as when making the backup, example below:

chown: cannot access '/media/USBdrive/ncdata/appdata_oclaqn5ofjmm/preview/5652': Input/output error

chown: changing ownership of '/media/USBdrive/ncdata/jing/files/InstantUpload/Camera/2019/12/IMG_20191218_200857.jpg': Input/output error

chown: cannot read directory '/media/USBdrive/ncdata/updater-oclaqn5ofjmm/backups/nextcloud-': Input/output error

So now I am even more confused!

What is output of

df -lh


ls -lh /media/

your drive/card is failing

Managed to solve this, in case anyone else encounters the same issue.

All I did was format the backup drive using the nextcloudpi config (previously I had formatted to ext4 under Kubuntu 18.04). Must have been permissions related, or maybe that nextcloudpi formats using BTRFS, either way solved and was not due to the drive failing (which could have been an expensive assumption to make!).

Cheers for the help.