Bug 1782680

Summary: Cannot disable IP stack after enabled DHCP
Product: Red Hat Enterprise Linux 8 Reporter: Gris Ge <fge>
Component: nmstateAssignee: Gris Ge <fge>
Status: CLOSED CURRENTRELEASE QA Contact: Mingyu Shi <mshi>
Severity: high Docs Contact:
Priority: high    
Version: 8.2CC: edwardh, jiji, jishi, mshi, network-qe
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.3   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: nmstate-0.2.6-4.8.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-05 05:24:35 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:
Bug Depends On: 1782686, 1789437    
Bug Blocks:    
Attachments:
Description Flags
bug_eth1_dhcp4_without_other.yml
none
bug_eth1_disable_ip.yml
none
verified.log none

Description Gris Ge 2019-12-12 06:22:55 UTC
Description of problem:

When disabling IPv4 from DHCPv4 without DNS/Gateway/Route option, 
nmstate will hang at NM_ACTIVE_CONNECTION_STATE_ACTIVATING or
fail with error:

NM main-loop aborted: Connection activation failed on eth2: reason=<enum NM_ACTIVE_CONNECTION_STATE_REASON_DEVICE_DISCONNECTED of type NM.ActiveConnectionStateReason>

Version-Release number of selected component (if applicable):
NetworkManager-1.22.0-0.2.el8.x86_64
nmstate-0.2.0-2.el8

How reproducible:
100%

Steps to Reproduce:
1. sudo nmstatectl set bug_eth1_dhcp4_without_other.yml
2. sudo nmstatectl set bug_eth1_disable_ip.yml
3.

Actual results:

nmstate failed.

Expected results:
No failure.

Additional info:

This is caused by on-going DHCP client. Not sure it's a NM bug or nmstate bug yet.

Comment 1 Gris Ge 2019-12-12 06:25:19 UTC
Created attachment 1644305 [details]
bug_eth1_dhcp4_without_other.yml

Comment 2 Gris Ge 2019-12-12 06:25:47 UTC
Created attachment 1644306 [details]
bug_eth1_disable_ip.yml

Comment 3 Gris Ge 2019-12-12 06:53:47 UTC
Workaround:

Apply this state before switching away DHCP

```yml
---
interfaces:
  - name: eth1
    type: ethernet
    state: absent
```

Comment 6 Edward Haas 2020-03-17 07:31:48 UTC
@mshi, could you please check this one out?

Comment 7 Mingyu Shi 2020-03-17 08:56:20 UTC
Created attachment 1670758 [details]
verified.log

nmstate-0.2.6-4.8.el8.noarch
NetworkManager-1.22.8-4.el8.x86_64
DISTRO=RHEL-8.2.0-20200316.n.0
Linux kvm-01-guest08.lab.eng.rdu2.redhat.com 4.18.0-187.el8.x86_64 #1 SMP Sat Mar 7 03:42:33 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Verified, check the attachment "verified.log" for the details

Comment 9 Gris Ge 2020-11-05 05:24:35 UTC
Fixed shipped in RHEL 8.2.