Forum

Full Version: Kodi 18 - 'cannot save setting' for backup location on usb
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
RP1 2B
Kodi 18, latest on stable release

I used to run daily/weekly backups on home folder and system. Place of storage was a plugged in additional USB stick. I had some issues since I converted the OS from SD to a dedicated USB-stick.
Afterwards I also formatted the additional USB-stick from NTFS to exFAT, because during my trials with the 'USB-OS', sometimes the NTFS stick was recognized properly, ther other time it wasn't.

The XBIAN config setting in the GUI allows me to select a folder for backup of home and system. As long as I choose a location in my /home folder, it goes well, but when I select a folder on the mounted additional USB stick, the 'do you want to save' setting results in a notification 'cannot save setting' followed by xbian-worker updated'. The backup location is always renamed back to to previously given /home directory.

Since backing up on the additional USB stick always worked, do I wonder what is going on. The kodi.log doesn't say a thing, unfortunately.
Any tips that I can try? Last time I updated, kodi didn't want to boot. Therefore I rather have a proper backup in place up front.
Terminal
xbian@avr ~ $ ps -aux | grep '[U]SER\|[k]odi.bin'
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 29981 0.0 0.2 4708 2064 ? S Feb10 0:00 sudo -u xbian -g xbian -s /usr/local/lib/kodi/kodi.bin --standalone -fs --lircdev /run/lirc/lircd
xbian 29987 80.6 46.0 1003088 352924 ? Rl Feb10 41376:37 /usr/local/lib/kodi/kodi.bin --standalone -fs --lircdev /run/lirc/lircd

As you can see from above, Kodi is started with the xbian user.
So you have to make sure the xbian user has permissions to write to that backup location.
If you change user to xbian with below one, are you able to create a file with for example the touch command on that backup location ?

Code:
sudo su - xbian
@jakenl Sorry for the late response Blush

I tried to reproduce your issue and the good news is, I can reproduce it Smile. The bad news is, still not knowing what's going on there Sad
Will have to investigate later

Please be patient Cool
(19th Mar, 2019 03:02 AM)Nachteule Wrote: [ -> ]@jakenl Sorry for the late response Blush

I tried to reproduce your issue and the good news is, I can reproduce it Smile. The bad news is, still not knowing what's going on there Sad
Will have to investigate later

Please be patient Cool
Hey, it's free. No excuses needed. Thanks for looking into it!
@jakenl, found my issue, do you have '@' character in your destination file/path? This character is confusing the script
(19th Mar, 2019 03:59 AM)Nachteule Wrote: [ -> ]@jakenl, found my issue, do you have '@' character in your destination file/path? This character is confusing the script
In my case I use the location /media/128gb_ultra/xbmc/backup/
The only special character is the underscore
(19th Mar, 2019 09:35 AM)jakenl Wrote: [ -> ]
(19th Mar, 2019 03:59 AM)Nachteule Wrote: [ -> ]@jakenl, found my issue, do you have '@' character in your destination file/path? This character is confusing the script
In my case I use the location /media/128gb_ultra/xbmc/backup/
The only special character is the underscore

Hmmm, and what's the filename? Are you using the default one, which is $(hostname)_xbian_image_$(date +%F).img

Anyway, you could run following command in ssh session and post output:

Terminal

sudo xbian-config xbiancopy imgdest '/media/128gb_ultra/xbmc/backup/$(hostname)_xbian_image_$(date +%F).img'
(don't forget the ', they are important)

I suppose you get -1 as output, which means no write access or folder structure does not exist
(19th Mar, 2019 09:39 AM)Nachteule Wrote: [ -> ]Hmmm, and what's the filename? Are you using the default one, which is $(hostname)_xbian_image_$(date +%F).img

Anyway, you could run following command in ssh session and post output:

Terminal

sudo xbian-config xbiancopy imgdest '/media/128gb_ultra/xbmc/backup/$(hostname)_xbian_image_$(date +%F).img'
(don't forget the ', they are important)

I suppose you get -1 as output, which means no write access or folder structure does not exist

Yes, I do use the default given file name, no changes there

No, I get a '1' as result of the command line action.
Arrrrghhh Angry

Can you please post your /etc/default/xbian-snap file as next step.

And BTW, there must be something in kodi's log, but you have to enable debug log

You should get something like that after saving setting and running command

Terminal

grep xbian-config.*img /home/xbian/.kodi/temp/kodi.log


Code:
2019-03-19 19:47:23.532 T:1727668976   DEBUG: XBian-config : xbian-config xbiancopy imgdest nfs://kmcubie/media/system/backup/kmxbilr2/$\(hostname\)_xbian_image_$\(date\ +%F\).img : ['1']

The ['1'] is the result code, and if you get an error, a result code 0 or -1 must occur (anything else expect 1 is interpreted as and error)
(20th Mar, 2019 04:55 AM)Nachteule Wrote: [ -> ]Arrrrghhh Angry

Can you please post your /etc/default/xbian-snap file as next step.

And BTW, there must be something in kodi's log, but you have to enable debug log

You should get something like that after saving setting and running command

Terminal

grep xbian-config.*img /home/xbian/.kodi/temp/kodi.log


Code:
2019-03-19 19:47:23.532 T:1727668976   DEBUG: XBian-config : xbian-config xbiancopy imgdest nfs://kmcubie/media/system/backup/kmxbilr2/$\(hostname\)_xbian_image_$\(date\ +%F\).img : ['1']

The ['1'] is the result code, and if you get an error, a result code 0 or -1 must occur (anything else expect 1 is interpreted as and error)
xbian-snap content
Code:
#
# This is controlfile for xbian-config console application and Kodi's
# XBian config GUI. Please do not modify this file manually unless you
# know what you are doing.
#


# enable periodic running (daily / weekly / monthly)
ENABLEDSCHEDULE=yes
KEEPDAYS=3
KEEPWEEKS=2
KEEPMONTHS=0

# enable creating of snapshot before APT operations. if wrong packages installed or something stopped working,
# restoration will take few seconds to state before APT run
ENABLEDAPT=yes
KEEPAPT=3

# exclude those subvolumes by default for btrfs-auto-snapshot operations (comma separated list)
EXCLUDESUB=

# Comma separated mount options for mounting IMGDEST and HOMEDEST shares
NFSOPTS=
CIFSOPTS=
SSHFSOPTS=

# auto clone / image creation should be run: none/daily/weekly/monthly
IMGPLAN=daily

# backup to img file (file) (in case of total SD card corruption, your system can be restored by reflashing this im$
# or directly to block device (block)
IMGTYPE=file

# path to img including file name (/media/my_disk/xbian_backup.img) or block device (/dev/sda1)
IMGDEST="/media/128gb_ultra/xbmc/backup/$(hostname)_xbian_image_$(date +%F).img"

# how many images should be kept (0 means unlimited)
IMGKEEP=1

# auto backup of /home should be run: none/daily/weekly/monthly
HOMEPLAN=daily

# path to img.gz including file name (/media/my_disk/xbian_home_backup.img.gz)
HOMEDEST="/home/xbian/Downloads/$(hostname)_backup_home_$(date +%F).img.gz"

# how many /home images should be kept (0 means unlimited)
HOMEKEEP=5
The funny thing is that the system img location is now accepted as being on the /media/ location. However, when I force a backup, it gives the following error in the debug log:
Code:
2019-03-19 22:41:02.863 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgplan daily : ['1']
2019-03-19 22:41:03.451 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgtype file : ['1']
2019-03-19 22:41:04.201 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgdest /media/128gb_ultra/xbmc/
backup/$\(hostname\)_xbian_image_$\(date\ +%F\).img : ['-1']
2019-03-19 22:41:04.458 T:1560535792   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:41:04.770 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgtype : ['file']
2019-03-19 22:41:05.322 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:41:05.880 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgdest : ['/media/128gb_ultra/x
bmc/backup/$(hostname)_xbian_image_$(date +%F).img']
2019-03-19 22:41:06.455 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy imgkeep : ['1']
2019-03-19 22:41:06.678 T:1560535792   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:42:52.621 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy imgtype : ['file']
2019-03-19 22:42:53.085 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:42:53.553 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy imgdest : ['/media/128gb_ultra/x
bmc/backup/$(hostname)_xbian_image_$(date +%F).img']
2019-03-19 22:42:54.041 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy imgkeep : ['1']
2019-03-19 22:42:54.555 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy imgdest exp : ['/media/128gb_ult
ra/xbmc/backup/xbian_xbian_image_2019-03-19.img']
2019-03-19 22:43:02.402 T:1292890864   DEBUG: XBian-config : xbian-config xbiancopy start /dev/root file:/media/128g
b_ultra/xbmc/backup/$\(hostname\)_xbian_image_$\(date\ +%F\).img : ['30638']
2019-03-19 22:43:08.216 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy doclean file:/media/128gb_ultra/
xbmc/backup/$\(hostname\)_xbian_image_$\(date\ +%F\).img 1 : ['1']

This is the result of the grep command after I try to alter the home backup location:
Code:
xbian@xbian /media/128gb_ultra/xbmc/backup $ grep xbian-config.*img /home/xbian/.kodi/temp/kodi.log
2019-03-19 22:29:52.184 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy homedest : ['/home/xbian/Downloa
ds/$(hostname)_backup_home_$(date +%F).img.gz']
2019-03-19 22:29:53.617 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy homedest : ['/home/xbian/Downloa
ds/$(hostname)_backup_home_$(date +%F).img.gz']
2019-03-19 22:29:54.597 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgtype : ['file']
2019-03-19 22:29:55.071 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:29:55.537 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgdest : ['/media/128gb_ultra/x
bmc/backup/$(hostname)_xbian_image_$(date +%F).img']
2019-03-19 22:29:56.034 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgkeep : ['1']
2019-03-19 22:29:56.501 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgtype : ['file']
2019-03-19 22:29:56.977 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:29:57.448 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgdest : ['/media/128gb_ultra/x
bmc/backup/$(hostname)_xbian_image_$(date +%F).img']
2019-03-19 22:29:57.951 T:1264579312   DEBUG: XBian-config : xbian-config xbiancopy imgkeep : ['1']
2019-03-19 22:35:21.939 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy homedest /media/128gb_ultra/xbmc
/backup/$\(hostname\)_backup_home_$\(date\ +%F\).img.gz : ['-1']
2019-03-19 22:35:22.769 T:1560535792   DEBUG: XBian-config : xbian-config xbiancopy imgplan : ['daily']
2019-03-19 22:35:23.063 T:1503654640   DEBUG: XBian-config : xbian-config xbiancopy homedest : ['/home/xbian/Downloa
ds/$(hostname)_backup_home_$(date +%F).img.gz']
Yeah, no we got it:

Destination (in your case home) on the same device as the source is not allowed

Does not make sense Dodgy
(20th Mar, 2019 08:02 AM)Nachteule Wrote: [ -> ]Yeah, no we got it:

Destination (in your case home) on the same device as the source is not allowed

Does not make sense Dodgy
Yes, I understand. When I tried to point to the /media/128gb.... direction, I got this error. When I tried my 2nd USB-drive which is connected, also on /media, I had the same. Therefore I tried a location the home partition and that was accepted. Not what I wanted ofcourse, so since that didn't thrown an error, I tried the /media locations again, but to no avail. After the error message of not able to save settings, it retuns the backup location back to the previous setting ( in my case the tryout of the thome folder).

I manually updated the backup location, straight in that xbian-snap file and my home folder backup works great now. The system image location sticks as wel in the /media location, however, when I for instance change from 1 file to 2, it 'can't save settings'.
I tried to run a system backup anyway, but that is cancelled within seconds with the on screen message of:
Please wait while creating backup file.
/dev/root /media/128gb_etcetc.img
Sorry, operation failed with error #005!

Can this have to do with my system running on a USB-stick, while booted from an SD-card (RPI 2b)?

My /etc/fstab:
Code:
# Configured /etc/fstab for XBian system
#
/dev/root                       /home                   xbian   subvol=home/@,noatime,nobootwait,rw           0    $
/dev/root                       /lib/modules            xbian   subvol=modules/@,noatime,nobootwait,rw        0    $
/dev/root                       /                       xbian   noatime,nobootwait,rw                         0    $
#UUID=BAA7-A4CB                 /boot                   xbian   noatime,rw,private                            0    $
LABEL=xbianboot                 /boot                   xbian   noatime,rw,private                            0    $
none                            /run/user               tmpfs   noauto                                        0    $
none                            /run/shm                tmpfs   noauto                                        0    $
none                            /run/lock               tmpfs   noauto                                        0    $
/dev/root                       /xbmc-backup            xbian   subvol=data/@,noatime,rw                      0    $
(20th Mar, 2019 09:01 AM)jakenl Wrote: [ -> ]Can this have to do with my system running on a USB-stick, while booted from an SD-card (RPI 2b)?

No!
I have similar configuation, booting from sd-card (PINN) and root partition is on external usb disk

Was reading your first post, your destination is located on exFAT partiton. Maybe this is the culprit for all the strange issues you have.

Would it be possible to reformat this to an ext4 fs?
@jakenl, Update:

Testing with an exFAT partition, and I'm getting same issue. It depends on exFAT but exFAT is not the culprit. The problem is that XBian-config GUI sends wrong filename, no idea why, nothing changed for years [1]

Will have to investigate what's going on, being quite confused

[1] Filename for example is /media/exFAT/$\(hostname\)_xbian_image_$\(date\ +%F\).img for example, '(' and ' ' character is escaped and this is the problem
Pages: 1 2
Reference URL's