netplan overwrites yml file

Bug #1998502 reported by r0mulux
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
New
Undecided
Unassigned

Bug Description

Considering these 3 netplan commands:

sudo netplan set ethernets.enp0s8.dhcp4=false
sudo netplan set bridges.mybridge.dhcp4=false
sudo netplan set bridges.mybridge.interfaces=[enp0s8]

With netplan 0.104-0ubuntu2, it creates a file /etc/netplan/70-netplan-set.yaml containing:

network:
  bridges:
    mybridge:
      dhcp4: false
      interfaces:
      - enp0s8
  ethernets:
    enp0s8:
      dhcp4: false
  version: 2

With netplan 0.105-0ubuntu2~22.04.1, it creates a file containing:

network:
  version: 2
  bridges:
    mybridge:
      dhcp4: false

and last command produce output error:

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.738: g_file_new_for_path: assertion 'path != NULL' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.739: g_file_read: assertion 'G_IS_FILE (file)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.739: g_data_input_stream_new: assertion 'G_IS_INPUT_STREAM (base_stream)' failed

(process:1941): GLib-GObject-CRITICAL **: 15:35:18.739: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.740: g_data_input_stream_read_line: assertion 'G_IS_DATA_INPUT_STREAM (stream)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.740: g_data_input_stream_read_line: assertion 'G_IS_DATA_INPUT_STREAM (stream)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.740: g_data_input_stream_read_line: assertion 'G_IS_DATA_INPUT_STREAM (stream)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.740: g_data_input_stream_read_line: assertion 'G_IS_DATA_INPUT_STREAM (stream)' failed

(process:1941): GLib-GIO-CRITICAL **: 15:35:18.741: g_data_input_stream_read_line: assertion 'G_IS_DATA_INPUT_STREAM (stream)' failed

(process:1941): GLib-GObject-CRITICAL **: 15:35:18.741: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

(process:1941): GLib-GObject-CRITICAL **: 15:35:18.741: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Traceback (most recent call last):
  File "/usr/sbin/netplan", line 23, in <module>
    netplan.main()
  File "/usr/share/netplan/netplan/cli/core.py", line 50, in main
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 231, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/set.py", line 50, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 231, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/set.py", line 78, in command_set
    parser.load_yaml(tmp)
  File "/usr/share/netplan/netplan/libnetplan.py", line 115, in load_yaml
    _checked_lib_call(lib.netplan_parser_load_yaml_from_fd, self._ptr, input_file.fileno())
  File "/usr/share/netplan/netplan/libnetplan.py", line 79, in _checked_lib_call
    raise LibNetplanException(err.contents.message.decode('utf-8'))
netplan.libnetplan.LibNetplanException: (null):5:9: Error in network definition: mybridge: interface 'enp0s8' is not defined
(null)

Revision history for this message
Lukas Märdian (slyon) wrote :

Thank you for reporting this! I think this is related to the "netplan set" regression we're seeing in bug #1997467

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.