[Bug 1768823] Re: netplan ip leases <interface> traceback when interface not managed by netplan or set to DHCP
Launchpad Bug Tracker
1768823 at bugs.launchpad.net
Wed Dec 5 18:47:48 UTC 2018
This bug was fixed in the package netplan.io - 0.40.1~18.04.3
---------------
netplan.io (0.40.1~18.04.3) bionic; urgency=medium
* Fix idempotency in renaming: bond members should be exempt from rename, as
they may all share a single MAC for the bond device. (LP: #1802322)
* tests/integration.py: add test designed to catch the above regression.
netplan.io (0.40.1~18.04.2) bionic; urgency=medium
* Fix typo breaking rename on 'netplan apply'. (LP: #1770082)
netplan.io (0.40.1~18.04.1) bionic; urgency=medium
* Backport netplan 0.40.1 to 18.04. (LP: #1793309)
netplan.io (0.40.1) cosmic; urgency=medium
* tests/generate.py: use random.sample() instead of random.choices() to
better support older pythons.
* Deal gracefully with empty files on 'netplan apply' (LP: #1795343)
netplan.io (0.40) cosmic; urgency=medium
* New upstream release:
- networkd: route source is PreferredSource= not From=
- Improve NetworkManager error reporting on unrenderable routes.
- Don't render ipv4 dns-search unless we have an ipv4 address.
(LP: #1786726)
- Set permissive umask on networkd .network, .link and .netdev files
(LP: #1736965, LP: #1768560)
- Fix support for link-scope routes. (LP: #1747455)
- Update man pages for deletion of replug code.
- Spell Gratuitous ARP correctly and make it work. (LP: #1756701)
- Many typo fixes for documentation. (LP: #1783940)
- Various build system fixes.
- Fix integration tests:
- iproute2 output changes for link-scope routes
- fix stability of networkd igmp-resend test
- fix manual_addresses test now that networkd lists ~. domain
- Deduplicate code for parsing interface options
- Add support for optional-addresses.
netplan.io (0.39) cosmic; urgency=medium
* New upstream release:
- Allow link-local addresses to be configured. (LP: #1771704)
- Forces bridges with no addresses to be brought online. (LP: #1736975)
netplan.io (0.38) cosmic; urgency=medium
* New upstream release:
- Write udev .rules files to /run/udev/rules.d to enforce interface
renaming. (LP: #1770082)
- Don't traceback for 'netplan ip leases' when iface is not managed or
doesn't DHCP (LP: #1768823)
- Fix duplicate "/" path separator in error messages (LP: #1771440)
- Fix incorrect terminal reset in 'netplan try' on Ctrl-C. (LP: #1768798)
- Updated doc entries: mtu, fix fwmark->mark, cleanup optional.
(LP: #1768783)
- Added documentation validation at build.
- Added configuration example for multi-ip interfaces.
* tests/integration.py: fix test_eth_and_bridge autopkg test harder.
* debian/control:
- Add iproute2 to Depends.
- Add python3-netifaces to Depends, Build-Depends.
-- Mathieu Trudel-Lapierre <cyphermox at ubuntu.com> Wed, 21 Nov 2018
14:42:59 -0500
** Changed in: netplan.io (Ubuntu Bionic)
Status: Fix Committed => Fix Released
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to netplan.io in Ubuntu.
Matching subscriptions: foundations-bugs
https://bugs.launchpad.net/bugs/1768823
Title:
netplan ip leases <interface> traceback when interface not managed by
netplan or set to DHCP
Status in netplan:
Fix Released
Status in netplan.io package in Ubuntu:
Fix Released
Status in netplan.io source package in Bionic:
Fix Released
Bug description:
[Impact]
"netplan ip leases <interface>" command is failing with a Traceback[1] when specifying an interface non-existing on the system. non-dhcp configured or non configured with netplan.
[1] $ netplan ip leases eth1
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 130, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/ip.py", line 56, in run
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/ip.py", line 75, in run
self.run_command()
File "/usr/share/netplan/netplan/cli/utils.py", line 130, in run_command
self.func()
File "/usr/share/netplan/netplan/cli/commands/ip.py", line 142, in command_ip_leases
out = subprocess.check_output(argv, universal_newlines=True)
File "/usr/lib/python3.6/subprocess.py", line 336, in check_output
**kwargs).stdout
File "/usr/lib/python3.6/subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/lib/netplan/generate', '--mapping', 'eth1']' returned non-zero exit status 1.
[Test Case]
* Performed the command "netplan ip leases <INTERFACE>" on a
Bionic/18.04 LTS system with netplan installed. If interface is non-
existent, not configured in netplan or not set to DHCP, it will
generate a Traceback[1] instead of displaying an error message with
some explanation as of why it fails.
Otherwise it will succeed as follow :
$ netplan ip leases eth0
# This is private data. Do not parse.
ADDRESS=10.104.180.111
NETMASK=255.255.255.0
ROUTER=10.104.180.1
SERVER_ADDRESS=10.104.180.1
NEXT_SERVER=10.104.180.1
BROADCAST=10.104.180.255
T1=1673
T2=3023
LIFETIME=3600
DNS=10.104.180.1
DOMAINNAME=lxd
HOSTNAME=nplan
CLIENTID=ffefc0b3c900020000ab118611d41fefa41121
[Regression Potential]
'netplan ip leases' is used as informational only, so failures with it should be considered a low priority issue. Nevertheless, failures to properly parse the data from the networking backends, experienced as tracebacks (like the one this is supposed to fix) or as invalid data / incomplete data being shown on screen should be investigated as potential regressions.
[Other Info]
* Netplan PR:
- https://github.com/CanonicalLtd/netplan/pull/25
The above PR will output "Interface <INTERFACE> is not managed by
netplan or not configured for DHCP"
Example:
$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
45: eth0 at if46: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 00:16:3e:91:0d:24 brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.104.180.139/24 brd 10.104.180.255 scope global dynamic eth0
valid_lft 3422sec preferred_lft 3422sec
inet6 fd42:ad0:706e:4129:216:3eff:fe91:d24/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 3497sec preferred_lft 3497sec
inet6 fe80::216:3eff:fe91:d24/64 scope link
valid_lft forever preferred_lft forever
$ netplan ip leases eth1
Interface eth1 is not managed by netplan or not configured for DHCP
$ netplan ip leases eth2
Interface eth2 is not managed by netplan or not configured for DHCP
$ netplan ip leases eth0
# This is private data. Do not parse.
ADDRESS=10.104.180.139
NETMASK=255.255.255.0
ROUTER=10.104.180.1
SERVER_ADDRESS=10.104.180.1
NEXT_SERVER=10.104.180.1
BROADCAST=10.104.180.255
T1=1800
T2=3150
LIFETIME=3600
DNS=10.104.180.1
DOMAINNAME=lxd
HOSTNAME=nplan8bionic
CLIENTID=ffb1e17c0e00020000ab11ab1476591f0e77eb
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1768823/+subscriptions
More information about the foundations-bugs
mailing list