Bug 2056446

Summary: In cockpit, unable to down the network connection via NIC's ON/OFF button
Product: Red Hat Enterprise Linux 8 Reporter: peyu
Component: cockpitAssignee: Marius Vollmer <mvollmer>
Status: CLOSED DUPLICATE QA Contact: peyu
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.6CC: arachman, cshao, lsvaty, lveyde, mavital, mpitt, peyu, qiyuan, sanja, sbonazzo, weiwang, yaniwang
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-02-24 08:56:22 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
screenshot of “Unexpected error” page none

Description peyu 2022-02-21 09:30:42 UTC
Created attachment 1862344 [details]
screenshot of “Unexpected error” page

Description of problem:
Login cockpit, click to enter the page of a NIC, click the "ON/OFF" button(the switch-toggle), the "up" state can not be switched to the inactive state

Version-Release number of selected component (if applicable):
RHVH: rhvh-4.5.0.2-0.20220216.0+1

subscription-manager-cockpit-1.28.25-1.el8.noarch
cockpit-bridge-261-1.el8.x86_64
cockpit-system-261-1.el8.noarch
cockpit-storaged-261-1.el8.noarch
cockpit-ws-261-1.el8.x86_64
cockpit-261-1.el8.x86_64
cockpit-ovirt-dashboard-0.15.1-2.el8ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install redhat-virtualization-host-4.5.0-202202161646_8.6
2. Login cockpit in Firefox browser
3. Go to "Networking" -> "Interfaces"
4. Click a NIC to enter its configuration page
5. Click the "ON/OFF" button(the switch-toggle) to up the connection
6. Then click the "ON/OFF" button again to down the connection
7. Click the "Switch off xx" button in the "Connection will be lost" page that pops up


Actual results:
An "Unexpected error" page will pop up, and down the NIC's connection failed 


Expected results:
Down the connection of NIC via "ON/OFF" button successfully 

Additional info:

Comment 1 Martin Pitt 2022-02-22 08:34:52 UTC
This reproduces straight away. Marius, I did that in a standard bots `./vm-run -s cockpit.socket rhel-8-6` with trying to disable virbr0.

Thanks for the report!

Comment 2 Marius Vollmer 2022-02-22 13:33:59 UTC
(In reply to Martin Pitt from comment #1)
> I did that in a standard bots
> `./vm-run -s cockpit.socket rhel-8-6` with trying to disable virbr0.

Disabling virbr0 should not trigger the "Connection will be lost" dialog.  I also get that dialog when _enabling_ eth1. This is clearly a bug, but maybe unrelated to this report here.

Comment 3 Marius Vollmer 2022-02-22 13:46:12 UTC
I can also reproduce this with virbr0 in our standard bots machine.

Disconnecting virbr0 does bring up the "Connection will be lost" dialog immediately (without visibly going through the expected "Testing connection" and "Restoring connection" phases), and before the checkpoint has been rolled back. The connection is not actually lost at any point.  Virbr0 is disabled at this point, and clicking "Switch off virb0" in the dialog will produce the unexpected error.

If you wait a couple of seconds with the dialog open, the checkpoint _will_ be rolled back and virbr0 will be reconnected.  Clicking "Switch off virbr0" at this point will work as expected.

So the bug is that Cockpit does not realize that switching off virbr0 has worked and has not affected the connection.

And, this actually fits this bug report here where a interface is first switched on and then switched off.  It is very unlikely that switching off an interface that you have just switched on will disconnect Cockpit. It is more likely that the "Connection will be lost" dialog is entirely bogus, just as with our virbr0.

Disabling selinux makes not difference.

Comment 4 Marius Vollmer 2022-02-22 13:56:26 UTC
Ohh, and the same behavior on my Fedora 35 development machine... (Switching _on_ a spare interface brings up the Connection will be lost dialog.) There must indeed be a giant hole in our tests.

Comment 5 Marius Vollmer 2022-02-23 12:40:32 UTC
Fix and new test is here: https://github.com/cockpit-project/cockpit/pull/17036

Comment 7 Martin Pitt 2022-02-24 08:56:22 UTC

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