Improve error reporting to give clearer messages and context
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Netplan |
Fix Released
|
Undecided
|
Unassigned | ||
netplan.io (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Cosmic |
Fix Released
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[Impact]
All users of netplan.
[Test case]
1) Write an invalid netplan yaml (for each of the examples below)
2) Validate the error is as expected.
3) Verify that the error matches refers to a meaningful place in file (check line and column values).
== Error due to missing fields ==
network:
version: 2
ethernets:
engreen:
routing-
- table: 50
addresses:
- 192.168.14.2/24
- 2001:FFfe::1/64
Expected error:
"""
/etc/netplan/
- table: 50
^
"""
== Syntax error: unsupported features ==
network:
version: 2
ethernets:
engreen:
dhcp4: *yes
Expected error:
"""
/etc/netplan/
dhcp4: *yes
^
"""
== Syntax error: use of tabs in config ==
network:
<tab>version: 2
<tab>renderer: NetworkManager
Expected error:
"""
/etc/netplan/
version: 2
^
"""
== Unsupported mix of features ==
network:
version: 2
renderer: networkd
tunnels:
tun0:
mode: isatap
local: 1.1.1.1
remote: 2.2.2.2
addresses: [ 15.15.15.15/24 ]
gateway4: 20.20.20.21
Expected error:
"""
/etc/netplan/
mode: isatap
^
"""
[Regression potential]
Minimal. Supported configurations remain unchanged. Users relying on automated parsing of netplan error messages (would that be a thing?) will find the messages have vastly changed. None of the strings are currently translatable/
---
Give more information about the error, including its exact location in the code.
Make the error messages shorter but still understandable.
Present clear context so people understand what we found was wrong, if not from line/column number, then from the extract from their file, with a marker to the error.
description: | updated |
Changed in netplan: | |
status: | New → Fix Released |
This bug was fixed in the package netplan.io - 0.90
---------------
netplan.io (0.90) disco; urgency=medium
* New upstream release:
- build: fixes for building on RPM-based distros
- build: code prettiness changes (make indentation consistent)
- Fix device name-changes detection (LP: #1770082)
- Add support for IPv6 Privacy Extensions (LP: #1750392)
- Add dhcp{4,6}-overrides to control DNS, NTP, hostname updates via DHCP
(LP: #1759014)
- Clarify MAC and MTU setting requirements (LP: #1800668)
- Various documentation fixes (LP: #1800669)
- Improve error reporting to give clearer messages and context
(LP: #1800670)
- Skip non-physical/bond interfaces when applying renames (LP: #1802322)
-- Mathieu Trudel-Lapierre <email address hidden> Wed, 21 Nov 2018 14:06:13 -0500