GNOME Bugzilla – Bug 676340
Make gnome-boxes storage pool handling more robust
Last modified: 2016-03-31 13:59:22 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.
(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.
Is it the only ISO with which it happens? Or is it happening with any box you try to create?
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
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.
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.
okay reopening then.
I think this is the same as bug#676216. *** This bug has been marked as a duplicate of bug 676216 ***
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.
(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..
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)
(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?
Created attachment 226715 [details] [review] Trivial indentation fix
Created attachment 226716 [details] [review] VMCreator: Use the Util::get_storage_pool() helper
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.
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?
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.
Review of attachment 226733 [details] [review]: nice thanks
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.
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.
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 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
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.
Created attachment 227066 [details] [review] Add missing {} around multi-line 'if'
Review of attachment 227066 [details] [review]: ACK. We should also follow trival rule?
AFAICT all patches are in and this has been fixed for months now.