Bug 1944582 - Cannot set DNS with DHCP on interface
Summary: Cannot set DNS with DHCP on interface
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: nmstate
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: rc
: ---
Assignee: Fernando F. Mancera
QA Contact: Mingyu Shi
URL:
Whiteboard:
Depends On:
Blocks: 1961914
TreeView+ depends on / blocked
 
Reported: 2021-03-30 09:33 UTC by Ales Musil
Modified: 2021-11-09 20:20 UTC (History)
8 users (show)

Fixed In Version: nmstate-1.1.0-0.1.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
: 1961914 (view as bug list)
Environment:
Last Closed: 2021-11-09 17:43:40 UTC
Type: Bug
Target Upstream Version:


Attachments (Terms of Use)
Reproducer (469 bytes, application/x-shellscript)
2021-03-30 09:33 UTC, Ales Musil
no flags Details
pre-tested.log (19.15 KB, text/plain)
2021-05-12 02:07 UTC, Mingyu Shi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github nmstate nmstate pull 1580 0 None closed net_state: mark ifaces as ignored earlier 2021-05-18 12:05:09 UTC
Red Hat Product Errata RHBA-2021:4157 0 None None None 2021-11-09 17:44:01 UTC

Description Ales Musil 2021-03-30 09:33:27 UTC
Created attachment 1767600 [details]
Reproducer

Description of problem:
Setting of static DNS with dynamic IP results in verification error.

Version-Release number of selected component (if applicable):
nmstate-1.1.0-0.20210330.1343gitc4e66f3.el8.noarch
nispor-1.0.1-4.el8.x86_64
NetworkManager-1.30.3-27812.copr.5eadbb29c7.el8.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Have default route with dns on unrelated interface e.g. eth0
2. Run reproducer script


Actual results:
Traceback (most recent call last):
  File "/usr/bin/nmstatectl", line 11, in <module>
    load_entry_point('nmstate==1.1.0', 'console_scripts', 'nmstatectl')()
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 73, in main
    return args.func(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 326, in set
    return apply(args)
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 343, in apply
    args.save_to_disk,
  File "/usr/lib/python3.6/site-packages/nmstatectl/nmstatectl.py", line 407, in apply_state
    save_to_disk=save_to_disk,
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 78, in apply
    _apply_ifaces_state(plugins, net_state, verify_change, save_to_disk)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 134, in _apply_ifaces_state
    _verify_change(plugins, net_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/netapplier.py", line 147, in _verify_change
    net_state.verify(current_state)
  File "/usr/lib/python3.6/site-packages/libnmstate/net_state.py", line 75, in verify
    self._dns.verify(current_state.get(DNS.KEY))
  File "/usr/lib/python3.6/site-packages/libnmstate/dns.py", line 196, in verify
    {DNS.KEY: cur_dns.config},
libnmstate.error.NmstateVerificationError: 
desired
=======
---
dns-resolver:
  server:
  - 1.1.1.1

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

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


Expected results:
Should configure desired state.

Additional info:
The same flow was working with nmstate-0.3.

Comment 4 Fernando F. Mancera 2021-04-29 09:09:14 UTC
Upstream PR: https://github.com/nmstate/nmstate/pull/1580

Comment 5 Fernando F. Mancera 2021-05-11 08:03:38 UTC
Patch merged!

Comment 6 Mingyu Shi 2021-05-12 02:07:43 UTC
Created attachment 1782209 [details]
pre-tested.log

Pretested with versions:
nmstate-1.1.0-0.20210511.1358git3463c8e.el8.noarch
nispor-1.0.1-4.el8.x86_64
NetworkManager-1.32.0-0.2.el8.x86_64
Linux mshi-rhel-850-20210328d2 4.18.0-301.1.el8.x86_64 #1 SMP Mon Mar 29 15:21:06 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

Check the attachment:
veth0 is with a default route and unmanaged, applied DNS 1.1.1.1 and dummy0(DHCP without manual dns), 1.1.1.1 was written into dummy0 profile while veth0 stayed unmanaged

Comment 13 Mingyu Shi 2021-06-02 08:48:53 UTC
Verified with versions:
nmstate-1.1.0-0.1.el8.noarch
nispor-1.1.0-1.el8.x86_64
NetworkManager-1.32.0-0.4.el8.x86_64

Comment 15 errata-xmlrpc 2021-11-09 17:43:40 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-2021:4157


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