Netplan throws an error when attempting to load a config file, provides no details about what the error is
netplan is VERY fussy about .yaml file formatting. No tabs, specific indentation, and no extra spaces. Your .yaml looks ok syntactically, but try this variation...
network:
version: 2
renderer: networkd
ethernets:
eno1:
dhcp4: true
sudo netplan generate
# generate config files
sudo netplan apply
# apply config
reboot
# reboot the computer
Related videos on Youtube
user1819128
Updated on September 18, 2022Comments
-
user1819128 over 1 year
Doing a clean install of Ubuntu Server 18.04 on a new machine. Currently attempting to configure my Ethernet network interface to use DHCP using
netplan
.My config file, dynamic.yaml, reads as follows:
network: version: 2 renderer: networkd ethernets: eno1: dhcp4: true
When I attempt to load this configuration with
sudo netplan try
I get an error which reads:
Error while loading /etc/netplan/dynamic.yaml, aborting.
sudo netplan --debug try
merely prints out "ERROR:Error while loading /etc/netplan/dynamic.yaml, aborting."
Any ideas what the error is? Or does anyone have any suggestions for how to get netplan to actually specify what the error is?
-
steeldriver over 4 yearsThe
netplan-try
manual page suggests there's a--debug
switch: have you triedsudo netplan --debug try
? -
user1819128 over 4 yearsMerely says the same thing unfortunately
-
Boris Hamanov over 4 yearsDoes
sudo netplan --debug generate
give any more clues?
-
-
user1819128 over 4 yearsTurns out I was using tabs instead of spaces - switching to spaces fixed the issue, Thanks!
-
Todd Curry about 2 years@heynnema, this answer made me get out my glasses and find the issue in my netplan -- tedious. Is there a YAML parsing utility (any language) that you know of to find issues programmatically?
-
Boris Hamanov about 2 years@ToddCurry Check out
yamllint
. It's in the Ubuntu repos. -
Todd Curry about 2 yearsBrilliant, @heynnema -- thank you! When I googled, I also found yamllint.com, (which may/may not be secure, but) checks your yaml in a web form. You have set me on a path to yaml sanity!