RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1850698 - [Regression] Cannot remove static DNS configure
Summary: [Regression] Cannot remove static DNS configure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nmstate
Version: 8.4
Hardware: x86_64
OS: Linux
urgent
urgent
Target Milestone: rc
: 8.3
Assignee: Gris Ge
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-24 18:12 UTC by Gris Ge
Modified: 2021-01-14 06:07 UTC (History)
8 users (show)

Fixed In Version: nmstate-0.3.2-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:08:54 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 1164 0 None closed dns: Fix remove dns config 2021-02-12 08:41:39 UTC
Github nmstate nmstate pull 1188 0 None closed dns: fix remove dns config 2021-02-12 08:41:39 UTC
Red Hat Product Errata RHBA-2020:4696 0 None None None 2020-11-04 03:09:08 UTC

Description Gris Ge 2020-06-24 18:12:01 UTC
Description of problem:

Cannot apply this state:

---
dns-resolver:
  config:
    server: []



Version-Release number of selected component (if applicable):
nmstate-0.3.2-1.el8

How reproducible:
100%

Steps to Reproduce:
echo '---
dns-resolver:
  config:
    server: []' | sudo nmstatectl set

Actual results:

libnmstate.error.NmstateVerificationError:

Expected results:

No error

Additional info:

Workaround would be using

---
dns-resolver:
  config:
    search: []
    server: []

Comment 2 Mingyu Shi 2020-06-28 07:23:57 UTC
ACKed

Comment 5 Mingyu Shi 2020-07-06 11:11:15 UTC
Hi Gris, I got this error, can you have a look?

[19:02:52@ibm-x3650m4-01-vm-05 ~]0# echo '---
> dns-resolver:
>   config:
>     server: []' | sudo nmstatectl set
2020-07-06 19:07:33,603 root         DEBUG    Async action: Create checkpoint started
2020-07-06 19:07:33,607 root         DEBUG    Checkpoint None created for all devices
2020-07-06 19:07:33,607 root         DEBUG    Async action: Create checkpoint finished
2020-07-06 19:07:38,834 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/1 rollback executed
2020-07-06 19:07:38,834 root         DEBUG    Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/1 started
2020-07-06 19:07:38,837 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/1 rollback executed
2020-07-06 19:07:38,837 root         DEBUG    Interface lo rollback succeeded
2020-07-06 19:07:38,838 root         DEBUG    Interface ens3 rollback succeeded
2020-07-06 19:07:38,838 root         DEBUG    Async action: Rollback to checkpoint /org/freedesktop/NetworkManager/Checkpoint/1 finished
Traceback (most recent call last):
  File "/bin/nmstatectl", line 11, in <module>
    load_entry_point('nmstate==0.3.2', 'console_scripts', 'nmstatectl')()
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 67, in main
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 265, in apply
    args.save_to_disk,
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 287, in apply_state
    save_to_disk=save_to_disk,
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 71, in apply
    _apply_ifaces_state(plugins, net_state, verify_change, save_to_disk)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 115, in _apply_ifaces_state
    _verify_change(plugins, net_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 120, in _verify_change
    net_state.verify(current_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/net_state.py", line 64, in verify
    self._dns.verify(current_state.get(DNS.KEY))
  File "/usr/lib/python3.6/site-packages/libnmstate/dns.py", line 189, in verify
    {DNS.KEY: self.config}, {DNS.KEY: cur_dns.config},
libnmstate.error.NmstateVerificationError: 
desired
=======
---
dns-resolver:
  server: []

current
=======
---
dns-resolver:
  search: []
  server: []

difference
==========
--- desired
+++ current
@@ -1,3 +1,4 @@
 ---
 dns-resolver:
+  search: []
   server: []


Versions:
nmstate-0.3.2-6.el8.noarch
NetworkManager-1.26.0-0.2.el8.x86_64

Comment 6 Gris Ge 2020-07-06 11:56:06 UTC
Thanks. I will work on a new patch.

Comment 8 Mingyu Shi 2020-07-17 07:09:11 UTC
Verified with versions:
nmstate-0.3.3-2.el8.noarch
NetworkManager-1.26.0-1.el8.x86_64
DISTRO=RHEL-8.3.0-20200716.n.0
Linux hp-dl388g8-04.rhts.eng.pek2.redhat.com 4.18.0-226.el8.x86_64 #1 SMP Wed Jul 15 07:40:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

An RFE is opened for this result: #bz1858187

[15:05:36@hp-dl388g8-04 ~]0# cat temp.yaml 
---
dns-resolver:
  config:
    search:
    - veth0.lan
    - veth0.lan0
    server:
    - 10.68.5.26
    - 10.72.17.5
    - 8.8.8.8
    - 8.8.8.9
interfaces:
- name: veth0
  state: up
  ipv4:
    address:
    - ip: 1.0.0.1
      prefix-length: 24
    enabled: true
routes:
  config:
  - destination: 0.0.0.0/0
    next-hop-address: 1.0.0.254
    next-hop-interface: veth0
[15:05:38@hp-dl388g8-04 ~]0# nmstatectl set temp.yaml 
2020-07-17 15:05:51,595 root         DEBUG    Async action: Create checkpoint started
2020-07-17 15:05:51,598 root         DEBUG    Checkpoint None created for all devices
2020-07-17 15:05:51,598 root         DEBUG    Async action: Create checkpoint finished
2020-07-17 15:05:51,600 root         DEBUG    Async action: Add profile: veth0 started
2020-07-17 15:05:51,605 root         DEBUG    Async action: Add profile: veth0 finished
2020-07-17 15:05:51,607 root         DEBUG    Async action: Activate profile: veth0 started
2020-07-17 15:05:51,609 root         DEBUG    Connection activation initiated: dev=veth0, con-state=<enum NM_ACTIVE_CONNECTION_STATE_ACTIVATING of type NM.ActiveConnectionState>
2020-07-17 15:05:51,630 root         DEBUG    Connection activation succeeded: dev=veth0, con-state=<enum NM_ACTIVE_CONNECTION_STATE_ACTIVATED of type NM.ActiveConnectionState>, dev-state=<enum NM_DEVICE_STATE_ACTIVATED of type NM.DeviceState>, state-flags=<flags NM_ACTIVATION_STATE_FLAG_LAYER2_READY | NM_ACTIVATION_STATE_FLAG_IP4_READY | NM_ACTIVATION_STATE_FLAG_IP6_READY of type NM.ActivationStateFlags>
2020-07-17 15:05:51,630 root         DEBUG    Async action: Activate profile: veth0 finished
2020-07-17 15:05:51,670 root         DEBUG    Async action: Destroy checkpoint /org/freedesktop/NetworkManager/Checkpoint/45 started
2020-07-17 15:05:51,673 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/45 destroyed
2020-07-17 15:05:51,673 root         DEBUG    Async action: Destroy checkpoint /org/freedesktop/NetworkManager/Checkpoint/45 finished
Desired state applied: 
---
dns-resolver:
  config:
    search:
    - veth0.lan
    - veth0.lan0
    server:
    - 10.68.5.26
    - 10.72.17.5
    - 8.8.8.8
    - 8.8.8.9
routes:
  config:
  - destination: 0.0.0.0/0
    next-hop-address: 1.0.0.254
    next-hop-interface: veth0
interfaces:
- name: veth0
  state: up
  ipv4:
    enabled: true
    address:
    - ip: 1.0.0.1
      prefix-length: 24
[15:05:51@hp-dl388g8-04 ~]0# cat no-server.yaml 
---
dns-resolver:
  config:
    server: []
[15:06:07@hp-dl388g8-04 ~]0# nmstatectl set no-server.yaml 
2020-07-17 15:06:12,491 root         DEBUG    Async action: Create checkpoint started
2020-07-17 15:06:12,495 root         DEBUG    Checkpoint None created for all devices
2020-07-17 15:06:12,495 root         DEBUG    Async action: Create checkpoint finished
2020-07-17 15:06:12,498 root         DEBUG    Async action: Update profile: veth0 started
2020-07-17 15:06:12,502 root         DEBUG    Async action: Update profile: veth0 finished
2020-07-17 15:06:12,503 root         DEBUG    Async action: Reapply device config: veth0 started
2020-07-17 15:06:12,507 root         DEBUG    Async action: Reapply device config: veth0 finished
2020-07-17 15:06:12,544 root         DEBUG    Async action: Destroy checkpoint /org/freedesktop/NetworkManager/Checkpoint/46 started
2020-07-17 15:06:12,547 root         DEBUG    Checkpoint /org/freedesktop/NetworkManager/Checkpoint/46 destroyed
2020-07-17 15:06:12,547 root         DEBUG    Async action: Destroy checkpoint /org/freedesktop/NetworkManager/Checkpoint/46 finished
Desired state applied: 
---
dns-resolver:
  config:
    server: []

# all the static dns configs were removed:
[15:06:12@hp-dl388g8-04 ~]0# nmstatectl show | head -30
---
dns-resolver:
  config:
    search: []
    server: []
  running:
    search:
    - rhts.eng.pek2.redhat.com
    server:
    - 10.73.2.107
    - 10.73.2.108
    - 10.66.127.10
route-rules:
  config: []
routes:
  config:
  - destination: 0.0.0.0/0
    metric: -1
    next-hop-address: 1.0.0.254
    next-hop-interface: veth0
    table-id: 0
  running:
  - destination: 0.0.0.0/0
    metric: 100
    next-hop-address: 10.73.131.254
    next-hop-interface: eno1
    table-id: 254
  - destination: 10.73.130.0/23
    metric: 100
    next-hop-address: ''
[15:06:25@hp-dl388g8-04 ~]0# cat /etc/resolv.conf 
# Generated by NetworkManager
search rhts.eng.pek2.redhat.com
nameserver 10.73.2.107
nameserver 10.73.2.108
nameserver 10.66.127.10

Comment 11 errata-xmlrpc 2020-11-04 03:08:54 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 (nmstate 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-2020:4696


Note You need to log in before you can comment on or make changes to this bug.