Preferences.xml file recovery

Bug #911700 reported by John M.K.
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Wishlist
Unassigned

Bug Description

I recently ran out of system memory (hard drives full), while using Inkscape. Inkscape gracefully failed writing data to ./config/preferences.xml, and prompted a pertinent error.

The problem is that, ever since, although the hard drive is no longer full, whenever I open Inkscape I get an error

"The preferences file /home/sinjoune/.config/inkscape/preferences.xml is not a valid XML document."
"Inkscape will run with default settings, and new settings will not be saved. "

I checked the xml file, and it was empty (reasonable), but inkscape offers no options to resolve this problem.

Tags: preferences
Revision history for this message
su_v (suv-lp) wrote :

> but inkscape offers no options to resolve this problem.

Delete the empty file and Inkscape will recreate it with default settings.

tags: added: preferences
Revision history for this message
su_v (suv-lp) wrote :

Related to pr duplicate of
 Bug #500961 “Preferences dialog / location of preferences.xml”
 <https://bugs.launchpad.net/inkscape/+bug/500961>
(a mechanism to reset all the preferences from within the user interface)

Revision history for this message
John M.K. (jconni) wrote :

@ suv: Thank you, deleted the file works as you mention.

I had already done that before filling the bug though. My point is that it would be nice if I was given the choice to fix this automatically...

You could just cache the old preferences.xml file and replace it with the factory settings. And then simply pop up a message that informs the user about the error...??? After all, inkscape messed the file up when trying to rewrite it, because my system was running out of memory...

Revision history for this message
florin (florin-arjocu) wrote :

@Joh M.K. is right with the solution.
It makes no sense to get these errors, I did not know how to fix it for a while, until I found this bug report.

PS: @~suv solution does fix the problem.

Revision history for this message
jazzynico (jazzynico) wrote :

Marking as duplicate of Bug #170572 "Revert to default settings". Don't hesitate to revert and comment if you think it's a different request.

Revision history for this message
jazzynico (jazzynico) wrote :

Reverting the duplicate status, and turning the report into a wishlist to manage corrupted preference.xml files.

Changed in inkscape:
status: New → Triaged
importance: Undecided → Wishlist
summary: - Preferences.xml error when system running out of memory
+ Preferences.xml file recovery
Revision history for this message
jazzynico (jazzynico) wrote :

Related:
* Bug #513185: Check for emergency saved files on startup
* Bug #492606: Automatic Autosave Recovery
* Bug #171424: crash recovery

We could use the revert button from Bug #170572 "Revert to default settings" to force the creation of a new preferences.xml file, or a dedicated dialog as suggested in the related reports listed above.

Revision history for this message
Magnes (magnesus2) wrote :

Inkscape still corrupts the file from time time - probably related to WACOM because it has a bug in very long lines like that:

 <group
     id="devices">

    <group
       keys="&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;&lt;Mod2&gt;&lt;Mod3&gt;&lt;Mod4&gt;&lt;Mod5&gt;;&lt;Primary&gt;&lt;Shift&gt;&lt;Alt&gt;&lt;Mod2&gt;&lt;Mod3&gt;&lt;Mod4&gt;&lt;Mod5&gt;;&lt;Primary&gt;&lt;Sh

...

Also it sometimes puts </group> or </inkscape></group> at the end of the file.
Resetting preferences is not a solution - because we put time into making our own preferences. Right now I fix the XML by editing it and deleting the line that is corrupt.

Revision history for this message
arjordan (jorsuscrip) wrote :

Same problem here on Windows version. Thanks to @Magnes (magnesus2) I opened the preferences.xml and I realized that the xls was abnormally finished

</inkscape>
scape>

Problem solved by deleting the last line containing "scape>"

Revision history for this message
Maxi Franke (drachenbauer) wrote :

i saved a copy of my preferences.xml at another spot of my file-system, where i can get it back, if i have this error.

So my special preferences-vaules are save

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

Related blueprints

Remote bug watches

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