"osmc backup failed to copy the tar file" since June 2023

Hello experts,

I am running OSMC on a Rasberry Pi 4, connected to a Synology NAS.
Since last June, the backup option is not working anymore (automatically & manually), giving the error:
“osmc backup failed to copy the tar file”
I’m pretty sure it stopped working after an update.

I’ve seen many post on this subject from 2021, saying it’ll be fixed with next release. We are now 3 months later but I still have the issue.
I’m running on version 2023.08-1
See complete log here: https://paste.osmc.tv/navocajoso.xml

Any idea what could cause this?

Thanks a lot in advance!

g4x

Please post full logs. Perhaps you don’t have enough free space.

Hi Sam, this is the full log when I trigger manually the backup in debug mode. There is plenty of space but that’s just it.

Please upload the full log via My OSMC

I would try the following commands with an SSH connection.

rm -r ~/.kodi/temp
systemctl restart mediacenter

Hi Sam, here is the full log uploaded from MyOSMC:
https://paste.osmc.tv/ixejupokim

hi, i tried this but it didn’t solve the issue unfortunately

Sep 18 04:30:35 osmc mediacenter[1214]: cp: cannot create regular file '/mnt/backup/OSMCBACKUP_2023_09_18_04_29_22.tar.gz': Permission denied
2023-09-18 08:52:15.380 T:1419    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball name: /home/osmc/.kodi/temp/OSMCBACKUP_2023_09_18_08_51_14.tar.gz 
2023-09-18 08:52:15.380 T:1419    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball exists: True 
2023-09-18 08:52:15.380 T:1419    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball name: /mnt/backup/OSMCBACKUP_2023_09_18_08_51_14.tar.gz 
2023-09-18 08:52:15.381 T:1419    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball exists: False 
2023-09-18 08:52:15.712 T:1419    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Transfer of backup file not successful: False 

It looks like you have a permissions issue to where your trying to create the backup. I would suggest to look over the following post and tweak your mount point…

thanks a lot for pointing me in the right direction, I will have a look at it. It’s really weird as this has been working for more than 6 months without any change in configuration.
I’ll keep you posted!

could you change your existing fstab entry to make the mount /mnt/backup2 leaving the rest the same and see if your able to backup successfully there. Just wondering if this is related to a separate issue we just became aware of.

/etc/fstab was updated with /mnt/backup2 but now in MyOSMC i can’t define this folder for backup, I keep getting a message saying to make sure I have write rights in the folder and that is has a valid name (i checked my NAS config, the user has write rights).
While browsing for a folder I still see the old /mnt/backup as well, which is weird as it’s not in fstab anymore.
Any thoughts?

Did you reboot after modifying fstab? If it is refusing to let you delete the folder it may still be a mount point so…

sudo umount -f /mnt/backup
sudo mkdir /mnt/backup2
sudo nano /etc/fstab

And the line for this mount should look like this…

//192.168.1.70/backup/OSMC /mnt/backup2 cifs username=piosmc,password=**masked*by*grab-logs**

ie, only changing the name of the mount point, not modifying anything to do with the share.

And then…

sudo mount -a
sudo systemctl daemon-reload
sudo systemctl restart remote-fs.target

yes I did reboot
/mnt/backup is unmounted, i now also deleted it
/mnt/backup2 is mounted to my NAS backup folder

in /etc/fstab i replaced:
192.168.1.70/backup/OSMC /mnt/backup cifs username=piosmc,password=**masked*by*grab-logs**
with
192.168.1.70/backup/OSMC /mnt/backup2 cifs username=piosmc,password=**masked*by*grab-logs**

I ran the 3 last command lines and tried again but always that same error when I try to define the target folder of a backup in MyOSMC (make sure you have write rights in the folder and that is has a valid name).
Same thing after another reboot.

Looking at your last log I see your mount as you created it…

//192.168.1.70/backup/OSMC /mnt/backup cifs rw,relatime,vers=3.1.1,cache=strict,username=piosmc,uid=0,noforceuid,gid=0,noforcegid,addr=192.168.1.70,file_mode=0755,dir_mode=0755,soft,nounix,serverino,mapposix,rsize=4194304,wsize=4194304,bsize=1048576,echo_interval=60,actimeo=1 0 0

Note the permissions being set as 755 which translates to rwx-rx-rx so you have permissions on that mount for reading and executing but not writing. This would be due to not specifying different parameters like what is suggested in that howto I linked earlier which suggests to set file_mode=0770,dir_mode=0770 which gives rwx for both owner and group.

When I udate my mount like this:
//192.168.1.70/backup/OSMC /mnt/backup cifs username=piosmc,password=?,x-systemd.automount,file_mode=0770,dir_mode=0770 0 0
i can’t even access the mount folder from the terminal:
osmc@osmc:/mnt$ cd /mnt/backup/
-bash: cd: /mnt/backup/: Permission denied

I tried with the following:
//192.168.1.70/backup/OSMC /mnt/backup cifs username=piosmc,password=?,x-systemd.automount,file_mode=0777,dir_mode=0777 0 0
And now i’m finally able to perform a backup!

Thanks a lot for your support!
Is it a consequence of an update that I had to adapt the fstab file which worked fine previously?

Aren’t permissions fun :grin:

Your welcome.

I don’t know. I could be that an update changed the default mount options. Since you now have defined these parameters it should stay working nonetheless.

Indeed really fun :joy:
I’m glad it’s now working again!
Thanks again!

1 Like