Issue backing up OSMC

Hello,

Backup is not finishing correctly " shutil.copyfile" cannot move the backup archive from local temp directory to the remote smb directory.

The remote directory seems reachable since I’m able to configure it from the backup interface configuration page. And from CLI :

~/.kodi/userdata$ ping ds.lan
PING ds.lan (192.168.0.18): 56 data bytes
64 bytes from 192.168.0.18: seq=0 ttl=64 time=1.848 ms
64 bytes from 192.168.0.18: seq=1 ttl=64 time=2.060 ms

The kodi.log :

2024-06-02 11:44:25.446 T:6228    debug <general>: script.module.osmcsetting.updates[service_entry] : update_args - {'percent': 100, 'heading': 'OSMC Backup', 'message': 'Transferring backup file'}
2024-06-02 11:44:25.447 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball name: /tmp/osmc_backup/OSMCBACKUP_2024_06_02_11_40_49.tar.gz
2024-06-02 11:44:25.447 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball exists: True
2024-06-02 11:44:25.448 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball name: smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_11_40_49.tar.gz
2024-06-02 11:44:25.449 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball exists: False
2024-06-02 11:44:25.449 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Copying /tmp/osmc_backup/OSMCBACKUP_2024_06_02_11_40_49.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_11_40_49.tar.gz using shutil.copyfile
2024-06-02 11:44:25.452 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Creating tarball failed
2024-06-02 11:44:25.452 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : FileNotFoundError
2024-06-02 11:44:25.453 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : (2, 'No such file or directory')
2024-06-02 11:44:25.457 T:6228    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Traceback (most recent call last):
                                                     File "/usr/share/kodi/addons/script.module.osmcsetting.updates/resources/lib/osmcupdates/osmc_backups.py", line 531, in create_tarball
                                                       shutil.copyfile(local_tarball_name, remote_tarball_name)
                                                     File "/usr/lib/python3.9/shutil.py", line 264, in copyfile
                                                       with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
                                                   FileNotFoundError: [Errno 2] No such file or directory: 'smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_11_40_49.tar.gz'

Thank you for your help

The issue is not on your end. I was able to reproduce the same issue and have reported it to the development team that maintains that add-on.

In the meantime it should work using locally attached storage (if you plug in a drive it should show up in Kodi browsing root filesystem>media), a system mount pointing to your network location [more information], or using the “Backup” add-on found in Kodi’s repository as an alternative to OSMC bespoke utility.

Thank you @darwindesign for your quick answer. Can you share with me the ticket/issue where you reported this issue to the maintainer team of the addon?

There is no ticket. I directly reported it backchannel.

A fix for this issue has been submitted here…

Wow everything is so fast around.

Thank you @darwindesign (autofs and path translation are good option that might be usefull in the future).
Thank you @anxdpanic for your fix I’ve manually updated the script, rebooted and backed up successfully my Vero4k. I hope it will soon end up in the next OSMC updates.

@anxdpanic the backup is successufully uplodaded but a popup show up saying the copy failed here is the log:

2024-06-02 16:47:07.473 T:3020    debug <general>: script.module.osmcsetting.updates[service_entry] : update_args - {'percent': 100, 'heading': 'OSMC Backup', 'message': 'Transferring backup file'}
2024-06-02 16:47:07.473 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball name: /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz
2024-06-02 16:47:07.473 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : local tarball exists: True
2024-06-02 16:47:07.474 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball name: smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz
2024-06-02 16:47:07.475 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : remote tarball exists: False
2024-06-02 16:47:07.476 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Copying /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using shutil.copyfile
2024-06-02 16:47:07.477 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Failed to copy /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using shutil.copyfile
2024-06-02 16:47:07.478 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Copying /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using xbmcvfs.copy
2024-06-02 16:47:07.486 T:3020  warning <general>: SMBFile::OpenForWrite() called with overwriting enabled! - smb://USERNAME:PASSWORD@192.168.0.18/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz
2024-06-02 16:48:08.575 T:3020    debug <general>: CSMBFile::Close closing fd 10000
2024-06-02 16:48:08.880 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Failed to copy /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using xbmcvfs.copy
2024-06-02 16:48:08.881 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Copying /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using subprocess.Popen
2024-06-02 16:48:09.242 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Failed to copy /tmp/osmc_backup/OSMCBACKUP_2024_06_02_16_43_35.tar.gz to smb://osmc:<password>@ds.lan/video/OSMCBACKUP_2024_06_02_16_43_35.tar.gz using subprocess.Popen
2024-06-02 16:48:09.242 T:3020    debug <general>: script.module.osmcsetting.updates[osmc_backups] : Transfer of backup file not successful: False

Normally not quite this fast. I guess you just caught us in a particularly choice moment.

It should be in the next test build update. Changes get merged rather fast there. Assuming all is good it will be part of the Omega stable release.

I’ll make a note in backchannel where he will see it. I don’t think he spends too much time in this forum. Thanks for the feedback.

1 Like

Don’t say that :laughing:

1 Like