bless fails to handle user config

Bug #1622951 reported by Armin Preiml
32
This bug affects 6 people
Affects Status Importance Assigned to Milestone
bless (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I can't save any configuration.

If I provide default configuration, bless reads it and fails to update it properly. The xml structure is cut off afterwards.

Here is the output I get when I start bless:

Directory '/home/$USER/.config/bless/plugins' not found.
Directory '/home/$USER/.config/bless/plugins' not found.
Directory '/home/$USER/.config/bless/plugins' not found.
Could not find file "/home/$USER/.config/bless/export_patterns".
Could not find file "/home/$USER/.config/bless/history.xml".
Document does not have a root element.
Sharing violation on path /home/$USER/.config/bless/preferences.xml
Sharing violation on path /home/$USER/.config/bless/preferences.xml
Sharing violation on path /home/$USER/.config/bless/preferences.xml

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in bless (Ubuntu):
status: New → Confirmed
Revision history for this message
Andy Lee (nlimbo76) wrote :

In my case, "/home/$USER/.config/bless/preferences.xml" file truncated by 1024 bytes.

Revision history for this message
Mauro Scomparin (scompo) wrote :

Same error for me too.
Here's my resulting preferences.xml

Revision history for this message
Erik Hagelberg (erik-hagelberg) wrote :

Launching Bless from terminal gives a fault, like the one below. I launched bless like this "sudo bless /dev/sda1". Additionally, just launching "bless" gives the same fault even if preferences.xml is deleted prior to launching. The preferences.xml doesn't seem complete?! Device is not read and bless is just displaying zeros. Any clues?

Unexpected end of file has occurred. The following elements are not closed: pref, preferences. Line 22, position 36.
Directory '/home/user/.config/bless/plugins' not found.
Directory '/home/user/.config/bless/plugins' not found.
Directory '/home/user/.config/bless/plugins' not found.
Could not find file "/home/user/.config/bless/export_patterns".
Could not find file "/home/user/.config/bless/history.xml".
Document does not have a root element.
Sharing violation on path /home/user/.config/bless/preferences.xml
Sharing violation on path /home/user/.config/bless/preferences.xml
Sharing violation on path /home/user/.config/bless/preferences.xml

Revision history for this message
Tomas Oliver Ramilison (tordoc) wrote :

Same for me every time I launch bless;

Unexpected end of file has occurred. The following elements are not closed: pref, preferences. Line 22, position 36.
Directory '/home/$USER/.config/bless/plugins' not found.
Directory '/home/$USER/.config/bless/plugins' not found.
Directory '/home/$USER/.config/bless/plugins' not found.
Could not find file "/home/$USER/.config/bless/export_patterns".
Could not find file "/home/$USER/.config/bless/history.xml".
Root element is missing.
Document does not have a root element.
Sharing violation on path /home/$USER/.config/bless/preferences.xml
Sharing violation on path /home/$USER/.config/bless/preferences.xml
Sharing violation on path /home/$USER/.config/bless/preferences.xml

Revision history for this message
V F (trivia21) wrote :

For some reason preferences.xml is truncated to 1024 bytes, so among others the closing </preferences> is missing.

Revision history for this message
V F (trivia21) wrote :

As a workaround I created my own preferences.xml file and made it read-only for bless.

Revision history for this message
V F (trivia21) wrote :

Ok, I decided to dig deeper into this. This is the first time I'm doing something like this, so feel free to correct me where needed. Here is what I've found:

(1) This bug report was not associated with the intended bless package. This one is the console version of bless (binary called cbless). The GUI bless can be found here: https://github.com/bwrsandman/Bless

(2) There is a bug in the code that saves the options. An exception is thrown, and the preferences.xml is not closed properly and ends up being written partially. The same bug is present in the code that saves the last session. I've created a patch that fixes both. Maybe I'll send it to the Bless GitHub page too. However the last change was made three years ago, so no high hopes.

(3) To fix the problem manually:
    - Download the source: git clone https://github.com/bwrsandman/Bless.git
    - Apply my patch.
    - Follow the readme:
        - Install the needed packages. For me the following were missing: nuget mono-complete gtk-sharp2.
        - nuget restore Bless.sln
        - xbuild /p:Configuration=Release Bless.sln
    - If it succeeds, you can run the patched bless with "mono src/bin/Release/bless.exe"
    - No help in the readme about installation... If you're radical, like me, just overwrite the installed version. This may cause problems, like you'll have to remember to manually delete these two directories if you uninstall Bless through the package manager.
    sudo rm /usr/share/bless/*
    sudo cp data/* /usr/share/bless
    sudo rm /usr/lib/bless/*
    sudo cp src/bin/Release/* /usr/lib/bless

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "fixxmltextwriter.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
V F (trivia21) wrote :

Someone has already reported this a year ago. Almost the same patch :)
https://github.com/bwrsandman/Bless/pull/4

tags: removed: patch
Revision history for this message
V F (trivia21) wrote :

Sorry I was wrong, this one is indeed the correct package for Ubuntu. I've attached a patch for bzr. I couldn't find the Xenial version, so I did it for Wily.

Manual fix is similar except for a few things:
- Download the source code with bzr: "bzr branch lp:ubuntu/wily/bless".
- Patch with "bzr merge fix_preferences_session_save.patch".
- As written in readme, use ./configure, make and sudo make install. That probably won't even mess up the package manager.
- You need to create a symlink for the deprecated gmcs the package relies on. I did "sudo ln /usr/bin/mcs /usr/bin/gmcs".

tags: added: patch
Revision history for this message
V F (trivia21) wrote :

Edit.
If you want to overwrite the existing installation, use ./configure --prefix=/usr

Revision history for this message
Jg-jguk (jg-jguk) wrote :

Sorry, I can't be re-compiling any software. Please supply an official updated package.

Revision history for this message
Mikko Rantalainen (mira) wrote :

I'm confirming that the patch in #11 fixes the problem. Could this be included in the official package?

Revision history for this message
Ploni Almoni (ploni-deactivatedaccount) wrote :

https://afrantzis.com/posts/bless-0-6-1/ Bless has moved to a new home, https://github.com/afrantzis/bless, and a new release has been made.

1) Does this fix the issue?

2) Will the official packages be updated?

Revision history for this message
Ploni Almoni (ploni-deactivatedaccount) wrote :

Also, this bug has also been reported on debian (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850627), with a patch, which has currently been released to testing/buster (https://tracker.debian.org/news/999768/bless-060-51-migrated-to-testing/).

Revision history for this message
Alexandros Frantzis (afrantzis) wrote :

> https://afrantzis.com/posts/bless-0-6-1/ Bless has moved to a new home,
> https://github.com/afrantzis/bless, and a new release has been made.
>
> 1) Does this fix the issue?

Yes (along with many other issues).

> 2) Will the official packages be updated?

I filed an update request for the Debian repo some time ago here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=914217, but there hasn't been any response yet.

Note that 0.6.2 was released today with more improvements.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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