Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

[Bug] cannot backup build because some addon.xml doesnt have proper xml decleration #134

Closed
tstrul1 opened this issue Jun 12, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@tstrul1
Copy link

tstrul1 commented Jun 12, 2021

Describe the bug
when trying to backup build it fails because some addons doesnt have proper xml deceleration

2021-06-11 19:36:14.108 T:15432 ERROR : EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'xml.etree.ElementTree.ParseError'>
Error Contents: XML or text declaration not at start of entity: line 2, column 0
Traceback (most recent call last):
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\default.py", line 29, in
dispatcher.dispatch(_handle, _params)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\common\router.py", line 289, in dispatch
backup.backup(action)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\backup.py", line 838, in backup
cls.backup_build(name)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\backup.py", line 274, in backup_build
binaryid, binaryname = db.find_binary_addons(addon=foldername)
File "C:\Users\home\AppData\Roaming\Kodi\addons\plugin.program.openwizard\resources\libs\db.py", line 517, in find_binary_addons
root = ElementTree.parse(xml).getroot()
File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py", line 1202, in parse
tree.parse(source, parser)
File "C:\Program Files (x86)\Kodi\system\python\Lib\xml\etree\ElementTree.py", line 595, in parse
self._root = parser._parse_whole(source)
File "", line None
xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 2, column 0
-->End of Python script error report<--

example for addons: elementum repository, script.module.pytz, script.module.xbmcswift2

if this exeption cannot be handled it would be great to just skip the problematic addons and get a report afterwards

To Reproduce
Steps to reproduce the behavior:

  1. Go to maintenance
  2. Click on backup/restore
  3. Scroll down to backup build
  4. include addon data
  5. See error

Platform
Kodi 19.1 on windows 10

@tstrul1 tstrul1 added the bug Something isn't working label Jun 12, 2021
@tstrul1
Copy link
Author

tstrul1 commented Jun 12, 2021

Sorry my mistake,
it happened due to empty first line in some addon.xml files.
I contact developer but i think it still worth not failing the whole process because of that

@SerpentDrago
Copy link
Contributor

SerpentDrago commented Jun 12, 2021

  1. Elementum doesn't have a repo any repo hosting it is unofficial
  2. script.module.xbmcswift2 and pytz are offical addons from kodi offical repo. It's absolutely not messed up.

So you apparently are using versions of addons from crappy 3rd party repos that clearly don't know what they are doing.

Unless you can provide links to where you show malformed addon. Xml in these addons repos. Or links to how this can be replicated

Sounds to me you installed some repo you probably shouldn't have and now have broken addons updated from them

No one else is reporting any issues backing up

@tstrul1
Copy link
Author

tstrul1 commented Jun 12, 2021

  1. Elementum doesn't have a repo any repo hosting it is unofficial
  2. script.module.xbmcswift2 and pytz are offical addons from kodi offical repo. It's absolutely not messed up.

So you apparently are using versions of addons from crappy 3rd party repos that clearly don't know what they are doing.

Unless you can provide links to where you show malformed addon. Xml in these addons repos. Or links to how this can be replicated

Sounds to me you installed some repo you probably shouldn't have and now have broken addons updated from them

No one else is reporting any issues backing up

Hey,
Sorry, as I mentioned that was wrong diagnostic. problem was an addon with an empty line at the beginning of addon.xml file.
After I fixed that, backup proceeded until it got to the part where I was asked about backing up the skin, when I pressed yes I got an error which I was able to fix and created a PR: #135

@tstrul1 tstrul1 closed this as completed Jun 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants