Bug 1912384

Summary: [machines] The VM detail page will turn white if deleting a VM in a environment which is without storage pools
Product: Red Hat Enterprise Linux 8 Reporter: YunmingYang <yunyang>
Component: cockpit-appstreamAssignee: Simon Kobyda <skobyda>
Status: CLOSED ERRATA QA Contact: YunmingYang <yunyang>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.4CC: kkoukiou, leiwang, mpitt, skobyda, wshi, xchen, ymao
Target Milestone: rc   
Target Release: 8.4   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 15:53:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
a gif for step 3 and step 4. Hope it is helpful none

Description YunmingYang 2021-01-04 10:38:02 UTC
Description of problem:
In a environment without storage pools, create a VM by "virsh define $xml_path && virsh start $vm_name", then go to the detail page of the VM, and delete it with checking disks, there will be an error, which is "no storage vol with matching path $disk_path". Then, uncheck disks, and re-click the "Delete" button, the VM detail page will turn white

Version-Release number of selected components (if applicable):
cockpit-machines-234-1.el8.noarch
cockpit-234-1.el8.x86_64
libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.x86_64

How reproducible:
100%

Steps to Reproduce:
1 Prepare an environment which has no storage pool
2 Create a VM by "virsh define $xml_path && virsh start $vm_name"
3 Go to the VM detail page, then delete it with checking disks
4 Delete the VM without checking disks

Actual results:
1 After step 3, there will be an error, which is "no storage vol with matching path $disk_path".
2 After step 4, the VM detail page turns white

Expected results: 
1 The VM can be deleted without error after step 3.
2 The VM can be deleted, and redirected to the VM list page after step 4.

Additional info:

Comment 1 Simon Kobyda 2021-01-05 13:16:39 UTC
I cannot reproduce step 4. After step 4, do you get redirected to the page [HOSTNAME]:9090/machines or do you stay in page [HOSTNAME]:9090/machines#vm?name=[VM_NAME]&connection=[CONNECTION] ? 
Also is there any warning in browser's developer console after step 4?

Comment 2 YunmingYang 2021-01-05 23:42:23 UTC
Hi simon, after step 4, I stayed in page [HOSTNAME]:9090/machines#vm?name=[VM_NAME]&connection=[CONNECTION].I think I miss one point. It is that I didn't close the dialog whose name is "Confirm deletion of $vm_name" after step 3, I just unchecked the disks and re-clicked the "Delete" button on the "Confirm deletion of $vm_name" dialog.

Comment 3 Simon Kobyda 2021-01-05 23:56:27 UTC
There is a part of code which redirects you to a VM list page after successful deletion of a VM. When I reproduce your step 4 and delete the VM without deleting the disks, I get redirected to vm list page. I wonder what's different for me and you. Was the deletion a VM successful for you? Was there no warning in developer console? What browser are you using?

Comment 4 YunmingYang 2021-01-06 01:20:37 UTC
I checked the developer console, there is an error which seems new, it is "Tried changing state of a disconnected RFB object".And the deletion in step 3 is not successful, it just change the VM status to "shut off". The deletion in step 4 is successful, I checked it by "virsh list --all". My browser is "Chrome 87.0.4280.88".

Comment 5 YunmingYang 2021-01-06 01:22:35 UTC
Created attachment 1744740 [details]
a gif for step 3 and step 4. Hope it is helpful

Comment 6 Martin Pitt 2021-01-07 05:58:04 UTC
Simon is working on a fix in https://github.com/cockpit-project/cockpit/pull/15102

Comment 7 Martin Pitt 2021-01-20 04:31:39 UTC
*** Bug 1918103 has been marked as a duplicate of this bug. ***

Comment 11 YunmingYang 2021-02-07 07:09:19 UTC
Test Versions:
cockpit-machines-237-1.el8.noarch
cockpit-236-1.el8.x86_64
libvirt-dbus-1.3.0-2.module+el8.3.0+6423+e4cb6418.x86_64


Test Steps:
1 Prepare an environment which has no storage pool
2 Create a VM by "virsh define $xml_path && virsh start $vm_name"
3 Go to the VM detail page, then delete it with checking disks
4 Repeat step 2 to step 3,then delete the VM withouting checking disks

Test Results:
1 After step 3, the VM can be deleted without error, and then redirect to VM list page.
2 After step 4, the VM can be deleted without error, and then redirected to the VM list page.

According to the results, move the status to VERIFIED.

Comment 13 errata-xmlrpc 2021-05-18 15:53:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (cockpit-appstream bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:1875