dns search domain gets duplicated

Bug #1998920 reported by XSpielinbox
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
subiquity
Confirmed
Medium
Unassigned
subiquity (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

When configuring the network on Ubuntu Server 22.04.1 Installer with Subiquity 22.10.1 entering the same search domain in both IPv4 and IPv6 makes it appear twice in the generated netplan config.
Editing the search domain in either IPv4 or IPv6 seems to duplicate them even further.

e.g.:
network:
  ethernets:
    enp1s0:
      addresses:
      - [IPv4]/24
      - [IPv6]/64
      nameservers:
        addresses:
        - [IPv4]
        - [IPv4]
        - [IPv6]
        - [IPv6]
        search:
        - example.com
        - example.com
      routes:
      - to: default
       via: [IPv6]
  version: 2

For that the default route gets only generated once see Bug #1993792.

description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in subiquity (Ubuntu):
status: New → Confirmed
Revision history for this message
Olivier Gayot (ogayot) wrote :

I'm observing the same behavior. Furthermore, applying the IPv4 settings multiple times already produces duplicates (the specified search domains get appended each time the form is submitted).

The "guilty" code is in NetworkController.set_static_config where we extend the list of search domains (and also DNS addresses) without clearing the existing values first.

https://github.com/canonical/subiquity/blob/69264ad7f2d3308a7e744331af51d394590fb862/subiquitycore/controllers/network.py#L357

    ns = dev.config.setdefault('nameservers', {})
    ns.setdefault('addresses', []).extend(static_config.nameservers)
    ns.setdefault('search', []).extend(static_config.searchdomains)
    self.update_link(dev)

Also relates to https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1993193

Clearing the values first might be an option but we need to be extra careful since since this code is shared between the subiquity client, the subiquity server and console_conf.

Dan Bungert (dbungert)
Changed in subiquity:
status: New → Confirmed
importance: Undecided → Medium
Changed in subiquity (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.