[Bug 1800670] Re: Improve error reporting to give clearer messages and context
Mathieu Trudel-Lapierre
mathieu.tl at gmail.com
Mon Mar 11 20:27:05 UTC 2019
** Description changed:
+ [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-policy:
+ - table: 50
+ addresses:
+ - 192.168.14.2/24
+ - 2001:FFfe::1/64
+
+ Expected error:
+ """
+ /etc/netplan/01-network-manager-all.yaml:10:9: Error in network definition: IP routing policy must include either a 'from' or 'to' IP
+ - table: 50
+ ^
+ """
+
+ == Syntax error: unsupported features ==
+
+ network:
+ version: 2
+ ethernets:
+ engreen:
+ dhcp4: *yes
+
+ Expected error:
+ """
+ /etc/netplan/01-network-manager-all.yaml:9:14: Invalid YAML: aliases are not supported:
+ dhcp4: *yes
+ ^
+ """
+
+ == Syntax error: use of tabs in config ==
+
+ network:
+ <tab>version: 2
+ <tab>renderer: NetworkManager
+
+ Expected error:
+ """
+ /etc/netplan/01-network-manager-all.yaml:3:1: Invalid YAML: tabs are not allowed for indent:
+ 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/01-network-manager-all.yaml:10:7: Error in network definition: tun0: ISATAP tunnel mode is not supported by networkd
+ 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/translated.
+
+ ---
+
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.
** Changed in: netplan
Status: New => 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/1800670
Title:
Improve error reporting to give clearer messages and context
Status in netplan:
Fix Released
Status in netplan.io package in Ubuntu:
Fix Released
Status in netplan.io source package in Bionic:
New
Status in netplan.io source package in Cosmic:
New
Status in netplan.io source package in Disco:
Fix Released
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-policy:
- table: 50
addresses:
- 192.168.14.2/24
- 2001:FFfe::1/64
Expected error:
"""
/etc/netplan/01-network-manager-all.yaml:10:9: Error in network definition: IP routing policy must include either a 'from' or 'to' IP
- table: 50
^
"""
== Syntax error: unsupported features ==
network:
version: 2
ethernets:
engreen:
dhcp4: *yes
Expected error:
"""
/etc/netplan/01-network-manager-all.yaml:9:14: Invalid YAML: aliases are not supported:
dhcp4: *yes
^
"""
== Syntax error: use of tabs in config ==
network:
<tab>version: 2
<tab>renderer: NetworkManager
Expected error:
"""
/etc/netplan/01-network-manager-all.yaml:3:1: Invalid YAML: tabs are not allowed for indent:
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/01-network-manager-all.yaml:10:7: Error in network definition: tun0: ISATAP tunnel mode is not supported by networkd
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/translated.
---
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.
To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1800670/+subscriptions
More information about the foundations-bugs
mailing list