[Bug 1795343] Re: netplan backported on bionic (0.40~18.04.1) crash when there is an empty YAML configuration file

Adam Conrad adconrad at 0c3.net
Mon Nov 26 19:25:59 UTC 2018


Hello EOLE, or anyone else affected,

Accepted netplan.io into bionic-proposed. The package will build now and
be available at
https://launchpad.net/ubuntu/+source/netplan.io/0.40.1~18.04.3 in a few
hours, and then in the -proposed repository.

Please help us by testing this new package.  See
https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how
to enable and use -proposed.  Your feedback will aid us getting this
update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug,
mentioning the version of the package you tested and change the tag from
verification-needed-bionic to verification-done-bionic. If it does not
fix the bug for you, please add a comment stating that, and change the
tag to verification-failed-bionic. In either case, without details of
your testing we will not be able to proceed.

Further information regarding the verification process can be found at
https://wiki.ubuntu.com/QATeam/PerformingSRUVerification .  Thank you in
advance for helping!

N.B. The updated package will be released to -updates after the bug(s)
fixed by this package have been verified and the package has been in
-proposed for a minimum of 7 days.

** Changed in: netplan.io (Ubuntu Bionic)
       Status: Fix Released => Fix Committed

** Tags removed: verification-done-bionic
** Tags added: verification-needed verification-needed-bionic

-- 
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/1795343

Title:
  netplan backported on bionic (0.40~18.04.1) crash when there is an
  empty YAML configuration file

Status in netplan:
  Confirmed
Status in netplan.io package in Ubuntu:
  Fix Released
Status in netplan.io source package in Bionic:
  Fix Committed

Bug description:
  [Impact]
  Any Netplan user leaving empty files in /etc/netplan.

  [Test case]

  1) put a valid configuration under /etc/netplan/
  2) create an empty YAML file /etc/netplan/99-empty.yaml
  3) execute netplan apply

  Validate that 'netplan apply' does not crash, and correctly applies
  the configuration.

  
  [Regression potential]
  Watch out for issues in merging netplan configuration or evaluating the parts of configuration that can't be reverted safely, for the use of 'netplan try'.

  ---

  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/apply.py", line 43, 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/apply.py", line 83, in command_apply
      config_manager.parse()
    File "/usr/share/netplan/netplan/configmanager.py", line 111, in parse
      self._merge_yaml_config(yaml_file)
    File "/usr/share/netplan/netplan/configmanager.py", line 197, in _merge_yaml_config
      network = yaml_data.get('network')
  AttributeError: 'NoneType' object has no attribute 'get'
  Error in sys.excepthook:
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 145, in apport_excepthook
      os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:
  FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_netplan_netplan.script.0.crash'

  Original exception was:
  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/apply.py", line 43, 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/apply.py", line 83, in command_apply
      config_manager.parse()
    File "/usr/share/netplan/netplan/configmanager.py", line 111, in parse
      self._merge_yaml_config(yaml_file)
    File "/usr/share/netplan/netplan/configmanager.py", line 197, in _merge_yaml_config
      network = yaml_data.get('network')
  AttributeError: 'NoneType' object has no attribute 'get'

  This is a regression with the previous version.

  apt policy netplan.io
  netplan.io:
    Installé : 0.40~18.04.1
    Candidat : 0.40~18.04.1
   Table de version :
   *** 0.40~18.04.1 500
          500 http://fr.archive.ubuntu.com/ubuntu bionic-proposed/main amd64 Packages
          100 /var/lib/dpkg/status
       0.36.3 500
          500 http://fr.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
       0.36.1 500
          500 http://fr.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

  Distributor ID:	Ubuntu
  Description:	Ubuntu 18.04.1 LTS
  Release:	18.04
  Codename:	bionic

To manage notifications about this bug go to:
https://bugs.launchpad.net/netplan/+bug/1795343/+subscriptions



More information about the foundations-bugs mailing list