robweber / xbmcbackup

Backup Addon for Kodi
MIT License
107 stars 48 forks source link

Several Matrix-related issues #182

Closed CiNcH83 closed 1 year ago

CiNcH83 commented 3 years ago

I am currently experiencing several issues with Backup on Matrix.

(1) SMB warning for every file to restore I store my Backups on SMB. For every file to restore, I see the following warning inside the log:

2021-02-15 08:19:47.269 T:9658  WARNING <general>: CreateLoader - unsupported protocol(-smb) in -smb://192.168.233.4:445/Kodi/Backup/Matrix/202102121358/addons/metadata.common.imdb.com

The restore still goes through properly. So maybe this warning can be ignored!?

(2) Crash on starting Kodi after restoring Netflix addon data Some Netflix addon data leads to a Kodi crash on startup when being restored from an "older" backup (dunno how old). I then have to delete the COOKIES and msl_data.json files from the backup.

Addon data is disabled by default to be backed up/restored. So it is probably not a good idea to do so?

(3) Dialog UI glitch There is a GUI glitch with Backup dialogs. The question is part of the button text: image

(4) Restore error An error is thrown in the end of a restore:

2021-02-17 17:27:27.242 T:5283    ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'pvrmanager.usebackendchannelnumbers'
                                                   Traceback (most recent call last):
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/default.py", line 91, in <module>
                                                       backup.restore()
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/backup.py", line 332, in restore
                                                       gui_settings.restore(valFile['system_settings'])
                                                     File "/storage/emulated/0/Android/data/org.xbmc.kodi/files/.kodi/addons/script.xbmcbackup/resources/lib/guisettings.py", line 37, in restore
                                                       if(aSetting['type'] != 'action' and settingsDict[aSetting['id']] != aSetting['value']):
                                                   KeyError: 'pvrmanager.usebackendchannelnumbers'
                                                   -->End of Python script error report<--

The restore still seems to go through properly though. Don't know yet whether some GuiSettings got lost as a consequence.

May this be due to a version mismatch? pvrmanager.usebackendchannelnumbers is still a thing in new versions though.

Platform and Kodi version

HW/OS: Sony BRAVIA/Android TV 9
Kodi: 20210214-a877cc22-master
robweber commented 3 years ago

Thanks for testing stuff out. Hopefully these answers help a bit:

1) I agree, it's a Kodi warning (not thrown by addon) so if things are working just ignore it. 2) Data from an old restore could mess up an addon, especially if it's trying to load an old auth token or something. Addon Data isn't on by default as it can cause people issues if they're not careful. I encourage people to use the Advanced Editor and backup specific addons only within the data folder that they actually need. 3) Good catch, there were some changes to the Kodi Python libs, I'll fix this and tag this issue when I do. 4) What version of the addon made the backup causing this issue? There is a change to how GuiSettings restores are handled in the Matrix versions of this addon and older backups don't have the meta data required. You can turn off the "Restore UI settings" when you using an older backup. It won't restore any UI settings but you won't get an error. This describes it more: https://github.com/robweber/xbmcbackup/wiki/Restoring-Files#ui-system-settings

CiNcH83 commented 3 years ago

(4)

What version of the addon made the backup causing this issue?

19.0-RC1 (18.9.910) Git:20210119-8c761c4708

I however don't think that this is the version where this issue originates from as backups are cumulative. It also happens when I take a backup from current version (also cumulative) and restore from this. So I would probably have to start from scratch to fix it? That's not really an option since not having to start from scratch is what backups are for. The restore still seems to go through properly though. So...

robweber commented 3 years ago

I agree, however the version of the addon you used when making the backup does matter in this case. There was a change in how Kodi stores UI related settings in the guisettings.xml flat file; I believe in v18. Because of this there was a change in this addon to how those settings are restored. Because of this using Kodi V18 or above but any Backup version prior to 1.5.4 will result backups working but restores not working for UI settings regardless of the Backup version used.

To properly troubleshoot this I'll need to know the exact Kodi and Addon version used to both create and restore the backups.

CiNcH83 commented 3 years ago

The above backup of 19.0-RC1 (18.9.910) Git:20210119-8c761c4708 has been created with Backup 1.6.4.

I remeber having upgraded to some version 1.5 when transitioning from Krypton to Leia for compatibility reason. We have been in touch back then too. Guess 1.5 is the origin of a series of backups.

CiNcH83 commented 3 years ago

I believe the origin to be Leia+1.5.3.

robweber commented 3 years ago

Ok, based on all of this the error makes more sense. The Leia version would not have been storing the guisettings data in the right format for the Matrix version to restore properly - hence the reason for the wrong version mismatch error you get when restoring versions that are different.

Going back to your original list I fixed number 3 as part of #183

robweber commented 3 years ago

Going back through this I think all these issues are either answered or fixed at this point. Please reopen if I'm wrong.

CiNcH83 commented 3 years ago

I found another UI dialog glitch. It is in the "Copy Simple Config" one where the button contains text...

robweber commented 3 years ago

Line related to this should be here (for reference when I fix): https://github.com/robweber/xbmcbackup/blob/matrix/resources/lib/advanced_editor.py#L226