Graceful exit on XML SyntaxError

Bug #245617 reported by Rehan Khan
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Smart Package Manager
New
Medium
Unassigned

Bug Description

Imported: http://tracker.labix.org/issue223

Reason: Review Issue

further details: https://blueprints.launchpad.net/smart/+spec/bug-reporting-migration

msg781 (view) Author: netmask Date: 2006-10-16.17:01:50

Another error mesage:

error: Invalid XML file:
error:
/var/lib/smart/channels/server:search%%http:__software.opensuse.org_download_server:_search_SUSE_Linux_10.1_repodata_repomd.xml
error:
/http://software.opensuse.org/download/server:/search/SUSE_Linux_10.1/repodata/repomd.xml
error: mismatched tag: line 11, column 2

msg758 (view) Author: netmask Date: 2006-10-08.17:19:30

(This is a followup ticket for future reference. i.e. TODO)

On channels based on XML files, when there is a syntax error or corrupted file,
Smart exists with the following error:

  File "/usr/lib/python2.4/site-packages/smart/backends/rpm/metadata.py", line
346, in parseFilesList
    for event, elem in cElementTree.iterparse(file, ("start", "end")):
  File "<string>", line 64, in __iter__
SyntaxError: not well-formed (invalid token): line 479344, column 58

We need to find a better way of exiting with a more descriptive error message.

The first proposed solution is to catch the error on a try statement, erase the
erroneous metadata and rebuild the cache without it.

Other suggestions, or patches, are welcome.

Rehan Khan (rasker)
Changed in smart:
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.