robweber / xbmcbackup

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

Error on GuiSettings Restore #162

Closed robweber closed 3 years ago

robweber commented 4 years ago

Describe the problem From elhifinio on the Kodi Forum:

no matter which version I am using (1.1.3, 1.5.0 or 1.5.2) I do get the following error (see log). Regional settings are German.

Platform and Kodi version I am using Kodi 17.6 x64 on Windows 10.

Link to Debug Log Log 1 Log 2

robweber commented 4 years ago

Log 2 seems to be a different error than the first one (because of the fix I tried earlier). Now the JSON lib is saying the result is not a JSON string that can be decoded.

I added an extra logging line to the branch that will print out the full text string from the GetSettings command. Hopefully that will show where things are going wrong. Also as a plus, once I have the string I can hardcode it into my testing and try things without needing you to constantly download zip files and test them.

Please download the latest zip from the testing branch and try it.

ac-bra commented 4 years ago

I created a new Github account, I am elhifinio from Kodi forum. I do have still the same issue.

robweber commented 4 years ago

On line 10 if you latest log I do see in the debug section that the GetSettings JSON call is going through.

I think you might be on to something with that filterconfig xml error. Do you know what that file does, does it even exist? Maybe try renaming it to filterconfig2.xml and restart Kodi. You can always put it back. I'm wondering if when trying to load the GuiSettings information it's trying to read that file and since it's throwing an error isn't returning the proper JSON response?

ac-bra commented 4 years ago

this file is installed in C:\Program Files\Kodi\system\players\dsplayer containing this https://paste.kodi.tv/iseketahev. After renaming it, backup and restore the error remains the same.

robweber commented 4 years ago

I was taking another look at one of the logs you posted and saw this error:

18:27:45.119 T:12096   DEBUG: Unicode Error

That occurs roughly where I'd expect the log line I was hoping to see should show up. I messed around with the code a bit and think I may have a fix. If you want to download from the guisettings_fix branch again and try it I'm hoping it will get things working for you.

ac-bra commented 4 years ago

Thank you Rob but unfortunately, still do have the same issue: https://paste.kodi.tv/akalumutov.kodi

robweber commented 4 years ago

Thanks for trying that, at least the error is different now:

UnicodeDecodeError: 'utf8' codec can't decode byte 0x92 in position 85758: invalid start byte

I did some digging on that and 0x92 is a Windows specific character that has no utf-8 replacement. I guess at least we're narrowing down the problem. I'll think a bit on what (if anything) can be done about that.

robweber commented 4 years ago

I'm not sure this is the most elegant solution but I pushed another fix to the branch where I'm attempting to just ignore decoding errors. This might get the string to decode and keep things moving. If you're up for it give it another shot.

These issues are always kind of tricky. Here is a link to a good explanation from romanvm on how Kodi does things behind the scenes with character encodings. We might fix this one problem but once Kodi moves to Python3 we'll have a whole other set of encoding issues. Let me know what happens.

ac-bra commented 4 years ago

Just tried to install the new version but while installation I do get the following error:

15:38:51.795 T:3720 ERROR: CAddonInstallJob[script.xbmcbackup]: Die Abhängigkeit auf script.module.dropbox in Version 9.4.0 konnte nicht aufgelöst werden.

Seems to be some Dropbox dependencies cannot be resolved :/

robweber commented 4 years ago

Are you installing from this branch - that branch doesn't use dropbox 9.4.0. In master and matrix (py3 only) that is a new dependency.

https://github.com/robweber/xbmcbackup/tree/krypton_guisettings_fix

ac-bra commented 4 years ago

now it works, thank you :)

robweber commented 4 years ago

That's great. I can merge this fix down into the Krypton branch. I'm unsure how this will play out with the python3 version. Strings are handled differently there. I'll have to see if I can come up with a test for that.

I'll leave this open for a bit until I merge everything so I don't forget.

ac-bra commented 4 years ago

great, thank you Rob