netplan fails through to generic error handler when specifying bridge

Bug #1804721 reported by Peter Goodall
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
netplan.io (Ubuntu)
Fix Released
Undecided
Unassigned
Xenial
New
Undecided
Unassigned
Bionic
New
Undecided
Unassigned
Cosmic
New
Undecided
Unassigned

Bug Description

Ubuntu 18.04.1 LTS, Release: 18.04

adding a specification for a bridge to /etc/netplan/01-my_network.yaml causes a fail-over to a catch-all exception handler. No useful debugging information is given. ( i wish you had markdown )

$ sudo netplan try -debug
Error while loading /etc/netplan/01-my_network.yaml, aborting.

the source file has contents:

"
# Let netplan manage all devices on this system
network:
  version: 2
  renderer: networkd
  ethernets:
    enp5s0:
      dhcp4: yes
      dhcp6: no

   bridges:
    lxdbr0:
      dhcp4: yes
      interfaces:
        - enp5s0
"

It loads without error if the bridges section is removed. The file is a simple example from https://netplan.io/examples#bridging
I have tried several other configurations, all fail when bridging is attempted.

I believe the netplan source is at: https://github.com/CanonicalLtd/netplan/blob/master/netplan/configmanager.py

I'm guessing the handler should not be activated.

        except (IOError, yaml.YAMLError): # pragma: nocover (filesystem failures/invalid YAML)
            logging.error('Error while loading {}, aborting.'.format(yaml_file))
            sys.exit(1)

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: netplan.io 0.40.1~18.04.2
ProcVersionSignature: Ubuntu 4.15.0-42.45-generic 4.15.18
Uname: Linux 4.15.0-42-generic x86_64
NonfreeKernelModules: zfs zunicode zavl icp zcommon znvpair nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7.5
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Nov 23 11:34:52 2018
InstallationDate: Installed on 2018-11-08 (14 days ago)
InstallationMedia: Ubuntu 18.04.1 LTS "Bionic Beaver" - Release amd64 (20181107)
ProcEnviron:
 LANGUAGE=en_AU:en
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_AU.UTF-8
 SHELL=/usr/bin/zsh
SourcePackage: netplan.io
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Peter Goodall (pjgoodall) wrote :
Revision history for this message
Peter Goodall (pjgoodall) wrote :

I'm not asserting that my .yaml source is correct, just that a more specific/informative error handler should have been invoked.

summary: - netplan try fails through to generic error handler when specifying
- bridge
+ netplan fails through to generic error handler when specifying bridge
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Yes, absolutely. In fact, I fixed this already:

$ ~/bin/netplan --root-dir=scratch/ --debug generate
DEBUG:command generate: running ['/lib/netplan/generate', '--root-dir', 'scratch/']
** (generate:18683): DEBUG: 16:41:58.422: Processing input file scratch//etc/netplan/01-my_network.yaml..
scratch//etc/netplan/01-my_network.yaml:9:4: Invalid YAML: inconsistent indentation:
   bridges:
   ^

The changes are available in Ubuntu 19.04 already; will be made available to other releases soon as stable updates.

FWIW, the issue is one space too much before "bridges:". Sorry I couldn't get to respond to this sooner!

Changed in netplan.io (Ubuntu):
status: New → Fix Released
Revision history for this message
Peter Goodall (pjgoodall) wrote :

Thanks Mathieu. Looking forward to the fix being released into Bionic.

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.