netplan set results in error "OSError: [Errno 18] Invalid cross-device link"

Bug #1930675 reported by Mirco Drick
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Fix Committed
Undecided
Unassigned

Bug Description

lsb_release -d
Description: Ubuntu 20.04.2 LTS
dpkg -l|grep netplan.io
ii netplan.io 0.102-0ubuntu1~20.04.2

trying to edit netplan yaml using netplan set, but it looks like netplan is unable to update the config files:

netplan --debug set ethernets.ens192.dhcp6=true
** (process:38433): DEBUG: 08:34:02.326: Processing input file //etc/netplan/00-installer-config.yaml..
** (process:38433): DEBUG: 08:34:02.326: starting new processing pass
** (process:38433): DEBUG: 08:34:02.326: Processing input file //etc/netplan/01-netcfg.yaml..
** (process:38433): DEBUG: 08:34:02.326: starting new processing pass
** (process:38433): DEBUG: 08:34:02.326: Processing input file //etc/netplan/50-cloud-init.yaml..
** (process:38433): DEBUG: 08:34:02.326: starting new processing pass
** (process:38433): DEBUG: 08:34:02.326: Processing input file //etc/netplan/99-netcfg-vmware.yaml..
** (process:38433): DEBUG: 08:34:02.326: starting new processing pass
** (process:38433): DEBUG: 08:34:02.327: We have some netdefs, pass them through a final round of validation
** (process:38433): DEBUG: 08:34:02.327: ens192: setting default backend to 1
** (process:38433): DEBUG: 08:34:02.327: Configuration is valid
** (process:38433): DEBUG: 08:34:02.327: eth0: setting default backend to 1
** (process:38433): DEBUG: 08:34:02.327: Configuration is valid
DEBUG:Writing file 00-installer-config.yaml: {'network': {'ethernets': {'ens192': {'dhcp4': True, 'dhcp6': True}}, 'version': 2}}
** (process:38433): DEBUG: 08:34:02.329: starting new processing pass
** (process:38433): DEBUG: 08:34:02.329: We have some netdefs, pass them through a final round of validation
** (process:38433): DEBUG: 08:34:02.329: ens192: setting default backend to 1
** (process:38433): DEBUG: 08:34:02.329: Configuration is valid
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 264, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/set.py", line 52, in run
    self.run_command()
  File "/usr/share/netplan/netplan/cli/utils.py", line 264, in run_command
    self.func()
  File "/usr/share/netplan/netplan/cli/commands/set.py", line 98, in command_set
    self.write_file(subtree, hint + '.yaml', self.root_dir)
  File "/usr/share/netplan/netplan/cli/commands/set.py", line 162, in write_file
    os.replace(tmpp, absp)
OSError: [Errno 18] Invalid cross-device link: '/tmp/netplan-set_u283unhb/etc/netplan/00-installer-config.yaml' -> '/etc/netplan/00-installer-config.yaml'

Revision history for this message
Mirco Drick (midr-tietoevry) wrote :

found reference at https://github.com/canonical/netplan/pull/207 which might be related to this? same case for me - /etc/netplan and /tmp are on different mountpoints.

Revision history for this message
Mirco Drick (midr-tietoevry) wrote :

any plans on having this backported to ubuntu 20.04?

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

Yes, you spotted the correct PR (fix) there.
This will be fixed and backported to ubuntu 20.04 with the upcoming netplan 0.103 release.

Changed in netplan:
status: New → Triaged
Revision history for this message
Mirco Drick (midr-tietoevry) wrote :

thanks, that sounds great. Is there any release date targeted for 0.103?

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

It was just released today!

https://github.com/canonical/netplan/releases/tag/0.103
https://launchpad.net/ubuntu/+source/netplan.io/0.103-0ubuntu2

And will probably soon (1-2 weeks) be SRUed into Ubuntu 20.04/Focal.

Changed in netplan:
status: Triaged → Fix Committed
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.