Ncp-backup with data fails with I/O error

NextCloudPi version v1.17.1
NextCloudPi image NextCloudPi_07-21-19
distribution Raspbian GNU/Linux 9
Nextcloud version 16.0.5.1

runs on a Raspberry Pi 4 (4GB)

there are two USB Sticks connected to the raspberry Pi.
-first one as Data directory
-second for Backups
when i do a backup with “Include data” = deactivated everything is fine and i can find the *.tar file on the second USB-Stick. But with “Include data” = enabled it fails with Input/output error. No matter whether it’s a manual or automatic Backup

[ nc-backup ]
Cannot load Zend OPcache - it was already loaded
check free space...
clean up old backup /media/backup/nextcloud-bkp_20191002_1570041391.tar
Cannot load Zend OPcache - it was already loaded
Maintenance mode enabled
backup database...
backup files...
tar: /media/backup/nextcloud-bkp_20191002_1570042980.tar: Cannot write: Input/output error
tar: Error is not recoverable: exiting now
error generating backup
Cannot load Zend OPcache - it was already loaded
Maintenance mode disabled

I’d look at output of:

df -h

To check usage of drives.

Does not affect anything, can be disregarded.
It Is a reoccurring bug with debian php updates. it creates a second link to opcache.ini.
Github Ref

I/O errors can be indicator of failing drive, just after trying and failing the backup, check output of:

sudo dmesg | tail

output of “df -h”:

pi@nextcloudpi:~ $ df -h
Dateisystem    Gr▒▒e Benutzt Verf. Verw% Eingeh▒ngt auf
/dev/root        59G    6,3G   50G   12% /
devtmpfs        1,8G       0  1,8G    0% /dev
tmpfs           2,0G       0  2,0G    0% /dev/shm
tmpfs           2,0G    8,5M  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     40M  213M   16% /boot
/dev/sdb1       115G     15G   99G   13% /media/data
tmpfs           391M       0  391M    0% /run/user/1000
/dev/sda1       115G    8,5G  105G    8% /media/backup

output of “sudo dmesg | tail”:

pi@nextcloudpi:~ $ sudo dmesg | tail
[157750.429439] scsi 0:0:0:0: Direct-Access     SanDisk  Ultra Fit        1.00 PQ: 0 ANSI: 6
[157750.430337] sd 0:0:0:0: [sda] 240254976 512-byte logical blocks: (123 GB/115 GiB)
[157750.430341] sd 0:0:0:0: Attached scsi generic sg0 type 0
[157750.431541] sd 0:0:0:0: [sda] Write Protect is off
[157750.431557] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00
[157750.432262] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[157750.456203]  sda: sda1
[157750.459615] sd 0:0:0:0: [sda] Attached SCSI removable disk
[157750.711620] BTRFS info (device sda1): disk space caching is enabled
[157750.711627] BTRFS info (device sda1): has skinny extents

i have formatted the “Backup”-stick again.
Now there’s no more I/O error. The function takes longer now, but there is still an error.
Also i can find the backup-file on the USB-Stick, wich is as big as i would expect it (~20GB). I suppose the error appears at the very end of the backup.

[ nc-backup ]
Cannot load Zend OPcache - it was already loaded
check free space...
Cannot load Zend OPcache - it was already loaded
Maintenance mode enabled
backup database...
backup files...
tar: data/nextcloud.log: file changed as we read it
error generating backup
Cannot load Zend OPcache - it was already loaded
Maintenance mode disabled

again, here the outputs:

pi@nextcloudpi:~ $ df -h
Dateisystem    Gr▒▒e Benutzt Verf. Verw% Eingeh▒ngt auf
/dev/root        59G    6,3G   50G   12% /
devtmpfs        1,8G       0  1,8G    0% /dev
tmpfs           2,0G       0  2,0G    0% /dev/shm
tmpfs           2,0G    8,5M  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     40M  213M   16% /boot
/dev/sdb1       115G     56G   58G   50% /media/ncp_backup
/dev/sda1       115G     15G   99G   13% /media/data
tmpfs           391M       0  391M    0% /run/user/1000

i tried a few times but this time it alwas shows some information about Bluetooth:

pi@nextcloudpi:~ $ sudo dmesg | tail
[   15.440920] Bluetooth: L2CAP socket layer initialized
[   15.440966] Bluetooth: SCO socket layer initialized
[   15.455851] Bluetooth: HCI UART driver ver 2.3
[   15.455866] Bluetooth: HCI UART protocol H4 registered
[   15.455984] Bluetooth: HCI UART protocol Three-wire (H5) registered
[   15.456241] Bluetooth: HCI UART protocol Broadcom registered
[   15.585721] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[   15.585727] Bluetooth: BNEP filters: protocol multicast
[   15.585737] Bluetooth: BNEP socket layer initialized
[   39.243713] Adding 102396k swap on /var/swap.  Priority:-2 extents:1 across:102396k SSFS