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 755010 - Box does not get deleted if Boxes is closed soon after deleting the box
Box does not get deleted if Boxes is closed soon after deleting the box
Status: RESOLVED DUPLICATE of bug 761479
Product: gnome-boxes
Classification: Applications
Component: general
3.18.x
Other Linux
: Normal normal
: --
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-09-14 21:06 UTC by Michael Catanzaro
Modified: 2016-09-20 08:16 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Catanzaro 2015-09-14 21:06:58 UTC
Boxes 3.16.2:

 * Create an Ubuntu 14.04 live VM.
 * Immediately use the window menu to delete the box.
 * You're taken back to the overview page. The notification "... has been deleted" appears, but the VM is still displayed in the overview.
 * Try deleting it again. It again is said to be deleted, but it's still there.
 * The "deleted" VM continues to boot. Once it has booted, open it up and shut down using the menu in Ubuntu. Now it really gets deleted.
Comment 1 Zeeshan Ali 2015-09-15 12:46:03 UTC
(In reply to Michael Catanzaro from comment #0)
> Boxes 3.16.2:
> 
>  * Create an Ubuntu 14.04 live VM.
>  * Immediately use the window menu to delete the box.
>  * You're taken back to the overview page. The notification "... has been
> deleted" appears, but the VM is still displayed in the overview.
>  * Try deleting it again. It again is said to be deleted, but it's still
> there.

I assume this time through the context menu in overview? If so, could you see if you can reproduce against 3.17?
Comment 2 Zeeshan Ali 2015-09-15 12:48:20 UTC
(In reply to Zeeshan Ali (Khattak) from comment #1)
> (In reply to Michael Catanzaro from comment #0)
> > Boxes 3.16.2:
> > 
> >  * Create an Ubuntu 14.04 live VM.
> >  * Immediately use the window menu to delete the box.
> >  * You're taken back to the overview page. The notification "... has been
> > deleted" appears, but the VM is still displayed in the overview.
> >  * Try deleting it again. It again is said to be deleted, but it's still
> > there.
> 
> I assume this time through the context menu in overview? If so, could you
> see if you can reproduce against 3.17?

Oh and can you see if what happens if you only try deleting through context menu? FWIW, the Delete option has been removed from the "display mode" menu and I can't reprodce this on git master against context menu in overview.
Comment 3 Michael Catanzaro 2015-09-15 19:15:39 UTC
(In reply to Zeeshan Ali (Khattak) from comment #1)
> I assume this time through the context menu in overview? If so, could you
> see if you can reproduce against 3.17?

The bug occurs with current master as well as 3.16.2. It occurs using the selection pattern (with the Delete button in the bottom right) and also with the context menu. I have actually never managed to get the Delete button to work (for live media).
Comment 4 Zeeshan Ali 2015-09-16 12:22:00 UTC
(In reply to Michael Catanzaro from comment #3)
> (In reply to Zeeshan Ali (Khattak) from comment #1)
> > I assume this time through the context menu in overview? If so, could you
> > see if you can reproduce against 3.17?
> 
> The bug occurs with current master as well as 3.16.2. It occurs using the
> selection pattern (with the Delete button in the bottom right) and also with
> the context menu. I have actually never managed to get the Delete button to
> work (for live media).

That's weird, it works fine here.
Comment 5 Zeeshan Ali 2015-09-24 18:16:26 UTC
I'll need some info since I can't reproduce this. For starters, when you delete the VM, can you check through `virsh list --all` if VM still actually exists on libvirt side? You can simply compare the output of this command before and after deleting.
Comment 6 Michael Catanzaro 2015-09-24 23:50:27 UTC
It's really confusing to say which, because when I create the VM it often "fails" with the warning "Box setup failed". On the command line I see this:

(gnome-boxes:32460): Boxes-WARNING **: wizard.vala:463: Failed to create storage pool: invalid connection pointer in virStoragePoolDefineXML

But sometimes the box is actually created.

Anyway, I tried about five times to create a new Ubuntu VM. I got that error each time, but when I closed and reopened Boxes, it had succeeded twice. (So that seems like a separate bug.) Anyway, I now have this:

 Id    Name                           State
----------------------------------------------------
 -     ubuntu14.04                    shut off
 -     ubuntu14.04-2                  shut off

I delete the second VM using the selection pattern. It appears to succeed; it disappears from the view and I get a notification saying it's been deleted. But the output of virsh is unchanged, so I guess it failed. Then I close Boxes, and reopen it, and the second box is gone (and gone from virsh as well)! So it really did succeed, just... belatedly, I suppose.

 Id    Name                           State
----------------------------------------------------
 -     ubuntu14.04                    shut off

Next, I start the original Ubuntu VM. It boots successfully, then I click the back arrow to return to the overview, and delete it with the selection pattern. Again, it disappears, and Boxes says it has been deleted. Again, virsh says it didn't work:

 Id    Name                           State
----------------------------------------------------
 2     ubuntu14.04                    running

But after doing nothing but waiting a bit, then running virsh again, it has gone away:

 Id    Name                           State
----------------------------------------------------

I thought to try virsh again because my hard drive started spinning when I clicked delete, and I wanted to see if it had different output after it stopped spinning. So I have a guess at what is going on: the deletion operation takes a long time, and if I close Boxes and reopen it again right away, the delete is still in progress, and it shows the boxes even though I've deleted them, because they haven't been completely deleted yet. That seem plausible?
Comment 7 Michael Catanzaro 2015-09-24 23:54:25 UTC
Ah, but if I close Boxes immediately after deleting the box, then the box will never actually be deleted, because Boxes suspends the box when Boxes is closed... which I guess overrides the delete. Or something.
Comment 8 Michael Catanzaro 2015-09-24 23:56:31 UTC
Yes, I think I'm right. Deleting works if and only if I wait roughly five seconds after clicking delete before I close Boxes. :)
Comment 9 Zeeshan Ali 2015-09-25 12:00:25 UTC
(In reply to Michael Catanzaro from comment #8)
> Yes, I think I'm right. Deleting works if and only if I wait roughly five
> seconds after clicking delete before I close Boxes. :)

Reading all the info you provided (thanks for that), I'd think this is caused by very slow disk. Is it some old disk? Deletion has always been pretty quick even on non-SSD drives for me (and I think most users) so I didn't even think about that. Perhaps we should indicate when a box is being deleted or just remove it from the view before actual deletion.
Comment 10 Michael Catanzaro 2015-09-25 18:58:28 UTC
I think it's just a typical spinning disk, but I'm not sure how fast it's supposed to be.

(In reply to Zeeshan Ali (Khattak) from comment #9)
> Perhaps we should indicate when a box is being
> deleted or just remove it from the view before actual deletion.

Well in comment #0, the problem was it wasn't removed from the view. Maybe that was only a problem in 3.16, when I could delete the disk from the hamburger menu? In 3.18, it does get removed from the view before the actual deletion.

I would say: just don't suspend the box on shutdown if it's already being deleted, as that seems to cancel the deletion.
Comment 11 Zeeshan Ali 2015-09-29 18:27:11 UTC
(In reply to Michael Catanzaro from comment #10)
> I think it's just a typical spinning disk, but I'm not sure how fast it's
> supposed to be.
> 
> (In reply to Zeeshan Ali (Khattak) from comment #9)
> > Perhaps we should indicate when a box is being
> > deleted or just remove it from the view before actual deletion.
> 
> Well in comment #0, the problem was it wasn't removed from the view. Maybe
> that was only a problem in 3.16, when I could delete the disk from the
> hamburger menu? In 3.18, it does get removed from the view before the actual
> deletion.

Ah yes, we do that.

> I would say: just don't suspend the box on shutdown if it's already being
> deleted, as that seems to cancel the deletion.

Oh I didn't realize that was the issue.
Comment 12 Michael Catanzaro 2015-09-29 21:54:21 UTC
Well I am not positive that is the issue, but it seems like a pretty good guess to me :)
Comment 13 Zeeshan Ali 2015-10-12 14:19:35 UTC
Not sure this is fixable in 3.18.
Comment 14 Alexandre Franke 2016-02-24 18:35:14 UTC
(In reply to Michael Catanzaro from comment #8)
> Yes, I think I'm right. Deleting works if and only if I wait roughly five
> seconds after clicking delete before I close Boxes. :)

Indeed. FWIW it's not just with VM, but also with remote machines.
Comment 15 Michael Catanzaro 2016-03-14 14:01:33 UTC
This report is a bit cluttered, let's use the newer one for the remaining issue.

*** This bug has been marked as a duplicate of bug 761479 ***