After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676340 - Make gnome-boxes storage pool handling more robust
Make gnome-boxes storage pool handling more robust
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2012-05-18 19:18 UTC by Ray Strode [halfline]
Modified: 2016-03-31 13:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Trivial indentation fix (887 bytes, patch)
2012-10-18 09:25 UTC, Christophe Fergeau
committed Details | Review
VMCreator: Use the Util::get_storage_pool() helper (1.64 KB, patch)
2012-10-18 09:25 UTC, Christophe Fergeau
committed Details | Review
Add storage pool test to --checks (2.94 KB, patch)
2012-10-18 09:25 UTC, Christophe Fergeau
reviewed Details | Review
Add storage pool test to --checks (3.97 KB, patch)
2012-10-18 12:03 UTC, Christophe Fergeau
committed Details | Review
Attempt to start Boxes pool if it's inactive (1.15 KB, patch)
2012-10-18 14:46 UTC, Christophe Fergeau
committed Details | Review
Add missing {} around multi-line 'if' (1.13 KB, patch)
2012-10-23 14:31 UTC, Christophe Fergeau
committed Details | Review

Description Ray Strode [halfline] 2012-05-18 19:18:37 UTC
I did a gnome livecd here:

http://ftp.gnome.org/pub/gnome/misc/testing/GNOME-3.5.1-LiveUSB.iso

which gnome-boxes (understandably) can't recognize.  It says "Analyzing installer media" then errors with "Box creation failed".  This is live media, so there's no installer.

It should just boot it up.
Comment 1 Marc-Andre Lureau 2012-05-18 19:30:20 UTC
(In reply to comment #0)
> I did a gnome livecd here:
> 
> http://ftp.gnome.org/pub/gnome/misc/testing/GNOME-3.5.1-LiveUSB.iso

/me downloading
 
> which gnome-boxes (understandably) can't recognize.  It says "Analyzing
> installer media" then errors with "Box creation failed".  This is live media,
> so there's no installer.

"Box creation fail" can be many reason. We could use your help to debug that. To start with the boxes log could be helpful.
Comment 2 Christophe Fergeau 2012-05-18 19:39:47 UTC
Is it the only ISO with which it happens? Or is it happening with any box you try to create?
Comment 3 Ray Strode [halfline] 2012-05-21 16:10:18 UTC
Good call, about trying other ISOs.  A fedora live image iso doesn't work either.

These are the messages printed to stderr: 

$ gnome-boxes

Boxes-WARNING **: app.vala:183: Unable to refresh storage pool: Requested operation is not valid: storage pool is not active

Boxes-CRITICAL **: boxes_fetch_os_logo: assertion `os != NULL' failed

GLib-CRITICAL **: g_hash_table_lookup: assertion `hash_table != NULL' failed

Boxes-WARNING **: wizard.vala:154: Failed to create volume: Requested operation is not valid: storage pool is not active

Is there a place to get more verbose logging information?

I also tried:

$ virsh pool-list
Name                 State      Autostart 
-----------------------------------------

and 

$ sudo virsh pool-list
Name                 State      Autostart 
-----------------------------------------
default              active     yes       
gnome-boxes          active     no        

and

$ sudo gnome-boxes

(gnome-boxes:17282): Boxes-WARNING **: fedora-installer.vala:179: Failed to fetch prefered keyboard layout from user settings, falling back to 'us'..

(gnome-boxes:17282): Boxes-WARNING **: wizard.vala:154: Unable to start domain: internal error Process exited while reading console log output: char device redirected to /dev/pts/17
qemu-kvm: -drive file=/root/.local/share/gnome-boxes/images/Fedora 16,if=none,id=drive-virtio-disk0,format=qcow2,cache=none: could not open disk image /root/.local/share/gnome-boxes/images/Fedora 16: Permission denied


(gnome-boxes:17282): GLib-GObject-CRITICAL **: g_signal_handler_disconnect: assertion `handler_id > 0' failed

(gnome-boxes:17282): Gtk-CRITICAL **: gtk_widget_event: assertion `WIDGET_REALIZED_FOR_EVENT (widget, event)' failed
Comment 4 Ray Strode [halfline] 2012-05-21 16:12:37 UTC
nevermind, this was a PEBKAC.

My drive doesn't have much space, so I had a symlink from ~/.local/share/gnome-boxes/images to /srv/images but then through a series of unfortunate events I accidentally blew away my /srv a few days ago so /srv/images didn't exist anymore.  Recreating the directory fixed everything.  I'm going to assume this symlinking-internal-directories-to-other-directories is off label use and NOTABUG this.
Comment 5 Christophe Fergeau 2012-05-21 16:31:52 UTC
This is similar to https://bugzilla.redhat.com/show_bug.cgi?id=819911 and we should definitely try harder when this happens, or return a better error.
Comment 6 Ray Strode [halfline] 2012-05-21 16:59:35 UTC
okay reopening then.
Comment 7 Zeeshan Ali 2012-05-23 14:56:11 UTC
I think this is the same as bug#676216.

*** This bug has been marked as a duplicate of bug 676216 ***
Comment 8 Christophe Fergeau 2012-05-23 15:18:51 UTC
I don't think so, this one is not about a crash, but a failure when the directory backing the 'gnome-boxes' libvirt storage pool does not exist.
Comment 9 Zeeshan Ali 2012-05-23 18:57:27 UTC
(In reply to comment #8)
> I don't think so, this one is not about a crash, but a failure when the
> directory backing the 'gnome-boxes' libvirt storage pool does not exist.

True but re-reading comment#3, I see that the series of events that lead to this were nothing boxes has any control on. We can't fix every issue..
Comment 10 Christophe Fergeau 2012-05-23 19:25:47 UTC
We can give a clue as to what's going on, even if only in --checks. In the RH bugzilla bug linked from there, trying to recreate the pool when it looks invalid would fix the issue (not here because there's a dangling symlink preventing that)
Comment 11 Zeeshan Ali 2012-10-16 01:52:43 UTC
(In reply to comment #10)
> We can give a clue as to what's going on, even if only in --checks. In the RH
> bugzilla bug linked from there, trying to recreate the pool when it looks
> invalid would fix the issue (not here because there's a dangling symlink
> preventing that)

Since you feel very strongly that this needs some fixing boxes side, could you please provide patches so this could be resolved?
Comment 12 Christophe Fergeau 2012-10-18 09:25:50 UTC
Created attachment 226715 [details] [review]
Trivial indentation fix
Comment 13 Christophe Fergeau 2012-10-18 09:25:53 UTC
Created attachment 226716 [details] [review]
VMCreator: Use the Util::get_storage_pool() helper
Comment 14 Christophe Fergeau 2012-10-18 09:25:56 UTC
Created attachment 226717 [details] [review]
Add storage pool test to --checks

When trying to move the Boxes libvirt storage pool to another place,
Boxes will get non-functional if after the move libvirt configuration
points to an invalid path for the storage pool.
This commit gets the path to Boxes storage pool through 'virsh
pool-dumpxml' and then makes sure the storage pool path is a
user-writable directory.
Comment 15 Marc-Andre Lureau 2012-10-18 09:36:57 UTC
Review of attachment 226717 [details] [review]:

::: src/util-app.vala
@@ +306,3 @@
+            critical ("libvirt is not installed correctly");
+        } catch (GLib.Error error) {
+            warning (error.message);

SELinux check provide some hints to the user, in regular stdout. Can we return something more specific/helping than a g_warning of the GError message?
Comment 16 Christophe Fergeau 2012-10-18 12:03:27 UTC
Created attachment 226733 [details] [review]
Add storage pool test to --checks

When trying to move the Boxes libvirt storage pool to another place,
Boxes will get non-functional if after the move libvirt configuration
points to an invalid path for the storage pool.
This commit gets the path to Boxes storage pool through 'virsh
pool-dumpxml' and then makes sure the storage pool path is a
user-writable directory.
Comment 17 Marc-Andre Lureau 2012-10-18 12:18:23 UTC
Review of attachment 226733 [details] [review]:

nice thanks
Comment 18 Christophe Fergeau 2012-10-18 14:32:48 UTC
Comment on attachment 226733 [details] [review]
Add storage pool test to --checks

I've committed this and then realized it breaks string freeze... I've mailed gnome-i18n about that.
Keeping this bug open as I'd like to do some more work on making storage pool handling more robust.
Comment 19 Christophe Fergeau 2012-10-18 14:46:54 UTC
Created attachment 226745 [details] [review]
Attempt to start Boxes pool if it's inactive

At startup, we try to refresh Boxes storage pool, but this will
fail if it's inactive. This can happen if the user fiddled with
libvirt storage pool outside of Boxes. It's easy to start it so
let's do it if needed.
Comment 20 Zeeshan Ali 2012-10-18 22:48:55 UTC
Review of attachment 226745 [details] [review]:

Good otherwise.

::: src/app.vala
@@ -261,3 +261,3 @@
             var pool = Boxes.get_storage_pool (connection);
             if (pool != null)
                 // If default storage pool exists, we should refresh it already

You want to move this comment above the 'refresh call.
Comment 21 Christophe Fergeau 2012-10-19 10:00:16 UTC
Comment on attachment 226745 [details] [review]
Attempt to start Boxes pool if it's inactive

Attachment 226745 [details] pushed as 759bda1 - Attempt to start Boxes pool if it's inactive
Comment 22 Christophe Fergeau 2012-10-19 10:00:43 UTC
Review of attachment 226745 [details] [review]:

::: src/app.vala
@@ -261,3 +261,3 @@
             var pool = Boxes.get_storage_pool (connection);
             if (pool != null)
                 // If default storage pool exists, we should refresh it already

It probably could even be killed as it doesn't add a lot to the function call. I've moved it and pushed the patch.
Comment 23 Christophe Fergeau 2012-10-23 14:31:04 UTC
Created attachment 227066 [details] [review]
Add missing {} around multi-line 'if'
Comment 24 Zeeshan Ali 2012-10-23 16:59:09 UTC
Review of attachment 227066 [details] [review]:

ACK. We should also follow trival rule?
Comment 25 Zeeshan Ali 2013-03-01 01:08:08 UTC
AFAICT all patches are in and this has been fixed for months now.