← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1906187] Re: Top-level 'network' key results in error using v2 config

 

This bug was fixed in the package cloud-init - 22.2-0ubuntu1~22.10.1

---------------
cloud-init (22.2-0ubuntu1~22.10.1) kinetic; urgency=medium

  * d/control:
    - Build-Depends: add python3-responses and python3-pytest-mock for unittests
    - Suggests: add openssh-server and ssh-import-id
  * d/cloud-init.postinst:
    - remove deprecated emit_upstart from cloud.cfg on upgrade
  * New upstream release.
    - Release 22.2 (LP: #1960939)
    - Fix test due to caplog incompatibility (#1461) [Alberto Contreras]
    - Align rhel custom files with upstream (#1431)
      [Emanuele Giuseppe Esposito]
    - cc_write_files: Improve schema. (#1460) [Alberto Contreras]
    - cli: Redact files with permission errors in commands (#1440)
      [Alberto Contreras] (LP: #1953430)
    - Improve cc_set_passwords. (#1456) [Alberto Contreras]
    - testing: make fake cloud-init wait actually wait (#1459)
    - Scaleway: Fix network configuration for netplan 0.102 and later (#1455)
      [Maxime Corbin]
    - Fix 'ephmeral' typos in disk names(#1452) [Mike Hucka]
    - schema: version schema-cloud-config-v1.json (#1424)
    - cc_modules: set default meta frequency value when no config available
      (#1457)
    - Log generic warning on non-systemd systems. (#1450) [Alberto Contreras]
    - cc_snap.maybe_install_squashfuse no longer needed in Bionic++. (#1448)
      [Alberto Contreras]
    - Drop support of *-sk keys in cc_ssh (#1451) [Alberto Contreras]
    - testing: Fix console_log tests (#1437)
    - tests: cc_set_passoword update for systemd, non-systemd distros  (#1449)
    - Fix bug in url_helper/dual_stack() logging (#1426)
    - schema: render schema paths from _CustomSafeLoaderWithMarks (#1391)
    - testing: Make integration tests kinetic friendly (#1441)
    - Handle error if SSH service no present. (#1422)
      [Alberto Contreras] (LP: #1969526)
    - Fix network-manager activator availability and order (#1438)
    - sources/azure: remove reprovisioning marker (#1414) [Chris Patterson]
    - upstart: drop vestigial support for upstart (#1421)
    - testing: Ensure NoCloud detected in test (#1439)
    - Update .github-cla-signers kallioli [Kevin Allioli]
    - Consistently strip top-level network key (#1417) (LP: #1906187)
    - testing: Fix LXD VM metadata test (#1430)
    - testing: Add NoCloud setup for NoCloud test (#1425)
    - Update linters and adapt code for compatibility (#1434) [Paride Legovini]
    - run-container: add support for LXD VMs (#1428) [Paride Legovini]
    - integration-reqs: bump pycloudlib pinned commit (#1427) [Paride Legovini]
    - Fix NoCloud docs (#1423)
    - Docs fixes (#1406)
    - docs: Add docs for module creation (#1415)
    - Remove cheetah from templater (#1416)
    - tests: verify_ordered_items fallback to re.escape if needed (#1420)
    - Misc module cleanup (#1418)
    - docs: Fix doc warnings and enable errors (#1419)
      [Alberto Contreras] (LP: #1876341)
    - Refactor cloudinit.sources.NetworkConfigSource to enum (#1413)
      [Alberto Contreras] (LP: #1874875)
    - Don't fail if IB and Ethernet devices 'collide' (#1411)
    - Use cc_* module meta defintion over hardcoded vars (SC-888) (#1385)
    - Fix cc_rsyslog.py initialization (#1404) [Alberto Contreras]
    - Promote cloud-init schema from devel to top level subcommand (#1402)
    - mypy: disable missing imports warning for httpretty (#1412)
      [Chris Patterson]
    - users: error when home should not be created AND ssh keys provided
      [Jeffrey 'jf' Lim]
    - Allow growpart to resize encrypted partitions (#1316)
    - Fix typo in integration_test.rst (#1405) [Alberto Contreras]
    - cloudinit.net refactor: apply_network_config_names (#1388)
      [Alberto Contreras] (LP: #1884602)
    - tests/azure: add fixtures for hardcoded paths (markers and data_dir)
      (#1399) [Chris Patterson]
    - testing: Add responses workaround for focal/impish (#1403)
    - cc_ssh_import_id: fix is_key_in_nested_dict to avoid early False
    - Fix ds-identify not detecting NoCloud seed in config (#1381)
      (LP: #1876375)
    - sources/azure: retry dhcp for failed processes (#1401) [Chris Patterson]
    - Move notes about refactorization out of CONTRIBUTING.rst (#1389)
    - Shave ~8ms off generator runtime (#1387)
    - Fix provisioning dhcp timeout to 20 minutes (#1394) [Chris Patterson]
    - schema: module example strict testing fix seed_random
    - cc_set_hostname: examples small typo (perserve vs preserve)
      [Wouter Schoot]
    - sources/azure: refactor http_with_retries to remove **kwargs (#1392)
      [Chris Patterson]
    - declare dependency on ssh-import-id (#1334)
    - drop references to old dependencies and old centos script
    - sources/azure: only wait for primary nic to be attached during restore
      (#1378) [Anh Vo]
    - cc_ntp: migrated legacy schema to cloud-init-schema.json (#1384)
    - Network functions refactor and bugfixes (#1383)
    - schema: add JSON defs for modules cc_users_groups (#1379) (LP: #1858930)
    - Fix doc typo (#1382) [Alberto Contreras]
    - Add support for dual stack IPv6/IPv4 IMDS to Ec2 (#1160)
    - Fix KeyError when rendering sysconfig IPv6 routes (#1380) (LP: #1958506)
    - Return a namedtuple from subp() (#1376)
    - Mypy stubs and other tox maintenance (SC-920) (#1374)
    - Distro Compatibility Fixes (#1375)
    - Pull in Gentoo patches (#1372)
    - schema: add json defs for modules U-Z (#1360)
      (LP: #1858928, #1858929, #1858931, #1858932)
    - util: atomically update sym links to avoid Suppress FileNotFoundError
      when reading status (#1298) [Adam Collard] (LP: LP:1962150)
    - schema: add json defs for modules scripts-timezone (SC-801) (#1365)
    - docs: Add first tutorial (SC-900) (#1368)
    - BUG 1473527: module ssh-authkey-fingerprints fails Input/output error…
      (#1340) [Andrew Lee] (LP: #1473527)
    - add arch hosts template (#1371)
    - ds-identify: detect LXD for VMs launched from host with > 5.10 kernel
      (#1370) (LP: #1968085)
    - Support EC2 tags in instance metadata (#1309) [Eduardo Dobay]
    - schema: add json defs for modules e-install (SC-651) (#1366)
    - Improve "(no_create_home|system): true" test (#1367) [Jeffrey 'jf' Lim]
    - Expose https_proxy env variable to ssh-import-id cmd (#1333)
      [Michael Rommel]
    - sources/azure: remove bind/unbind logic for hot attached nic (#1332)
      [Chris Patterson]
    - tox: add types-* packages to check_format env (#1362)
    - tests: python 3.10 is showing up in cloudimages (#1364)
    - testing: add additional mocks to test_net tests (#1356) [yangzz-97]
    - schema: add JSON schema for mcollective, migrator and mounts modules
      (#1358)
    - Honor system locale for RHEL (#1355) [Wei Shi]
    - doc: Fix typo in cloud-config-run-cmds.txt example (#1359) [Ali Shirvani]
    - ds-identify: also discover LXD by presence from DMI board_name = LXD
      (#1311)
    - black: bump pinned version to 22.3.0 to avoid click dependency issues
      (#1357)
    - Various doc fixes (#1330)
    - testing: Add missing is_FreeBSD mock to networking test (#1353)
    - Add --no-update to add-apt-repostory call (SC-880) (#1337)
    - schema: add json defs for modules K-L (#1321)
      (LP: #1858899, #1858900, #1858901, #1858902)
    - docs: Re-order readthedocs install (#1354)
    - Stop cc_ssh_authkey_fingerprints from ALWAYS creating home (#1343)
      [Jeffrey 'jf' Lim]
    - docs: add jinja2 pin (#1352)
    - Vultr: Use find_candidate_nics, use ipv6 dns (#1344) [eb3095]
    - sources/azure: move get_ip_from_lease_value out of shim (#1324)
      [Chris Patterson]
    - Fix cloud-init status --wait when no datasource found (#1349)
      (LP: #1966085)
    - schema: add JSON defs for modules resize-salt (SC-654) (#1341)
    - Add myself as a future contributor (#1345) [Neal Gompa (ニール・ゴンパ)]
    - Update .github-cla-signers (#1342) [Jeffrey 'jf' Lim]
    - add Requires=cloud-init-hotplugd.socket in cloud-init-hotplugd.service
      file (#1335) [yangzz-97]
    - Fix sysconfig render when set-name is missing (#1327)
      [Andrew Kutz] (LP: #1855945)
    - Refactoring helper funcs out of NetworkState (#1336) [Andrew Kutz]
    - url_helper: add tuple support for readurl timeout (#1328)
      [Chris Patterson]
    - Make fs labels match for ds-identify and docs (#1329)
    - Work around bug in LXD VM detection (#1325)
    - Remove redundant generator logs (#1318)
    - tox: set verbose flags for integration tests (#1323) [Chris Patterson]
    - net: introduce find_candidate_nics() (#1313) [Chris Patterson]
    - Revert "Ensure system_cfg read before ds net config on Oracle (#1174)"
      (#1326)
    - Add vendor_data2 support for ConfigDrive source (#1307) [cvstealth]
    - Make VMWare data source test host independent and expand testing (#1308)
      [Robert Schweikert]
    - Add json schemas for modules starting with P
    - sources/azure: remove lease file parsing (#1302) [Chris Patterson]
    - remove flaky test from ci (#1322)
    - ci: Switch to python 3.10 in Travis CI (#1320)
    - Better interface handling for Vultr, expect unexpected DHCP servers
      (#1297) [eb3095]
    - Remove unused init local artifact (#1315)
    - Doc cleanups (#1317)
    - docs improvements (#1312)
    - add support for jinja do statements, add unit test (#1314)
      [Paul Bruno] (LP: #1962759)
    - sources/azure: prevent tight loops for DHCP retries (#1285)
      [Chris Patterson]
    - net/dhcp: surface type of DHCP lease failure to caller (#1276)
      [Chris Patterson]
    - Stop hardcoding systemctl location (#1278) [Robert Schweikert]
    - Remove python2 syntax from docs (#1310)
    - [tools/migrate-lp-user-to-github] Rename master branch to main (#1301)
      [Adam Collard]
    - redhat: Depend on "hostname" package (#1288) [Lubomir Rintel]
    - Add native NetworkManager support (#1224) [Lubomir Rintel]
    - Fix link in CLA check to point to contribution guide. (#1299)
      [Adam Collard]

 -- Brett Holman <brett.holman@xxxxxxxxxxxxx>  Wed, 18 May 2022 11:23:42
-0600

** Changed in: cloud-init (Ubuntu)
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1906187

Title:
  Top-level 'network' key results in error using v2 config

Status in cloud-init:
  Fix Released
Status in cloud-init package in Ubuntu:
  Fix Released
Status in netplan.io package in Ubuntu:
  Invalid

Bug description:
  I've created a 'network-config' file with Terraform's yamldecode() function that contains (btw. I've tried with the version being a Number w/o quotes and as well as a String as shown here):
  ---
  "network":
    "ethernets":
      "eth0":
        "gateway4": "192.168.1.1"
        "nameservers":
          "addresses":
          - "192.168.1.74"
          - "192.168.1.104"
          "search":
          - "fritz.box"
        "set-name": "eth0"
    "version": "2"
  ---
  After running on Raspberry Pi 4B with 4 GB, created with ubuntu-20.04.1-preinstalled-server-arm64+raspi.img.xz, the machine's setup fails and /var/log/cloud-init.log reveals that:
  ---
  2020-04-01 17:23:48,649 - util.py[DEBUG]: Reading from /boot/firmware//network-config (quiet=False)
  2020-04-01 17:23:48,649 - util.py[DEBUG]: Read 245 bytes from /boot/firmware//network-config
  2020-04-01 17:23:48,650 - util.py[DEBUG]: Attempting to load yaml from string of length 240 with allowed root types (<class 'dict'>,)
  2020-04-01 17:23:48,652 - util.py[DEBUG]: Attempting to load yaml from string of length 245 with allowed root types (<class 'dict'>,)
  2020-04-01 17:23:48,656 - DataSourceNoCloud.py[DEBUG]: Top level network key in network-config but missing 'config' or 'version': {'network': {'ethernets': {'eth0': {'gateway4': '192.168.1.1', 'nameservers': {'addresses': ['192.168.1.74', '192.168.1.104'], 'search': ['fritz.box']}, 'set-name': 'eth0'}}, 'version': '2'}}
  ---
  The corresponding /var/log/clout-init-output.log reveals the trace and that Network won't come up.
  ---
  Cloud-init v. 20.2-45-g5f7825e2-0ubuntu1~20.04.1 running 'init-local' at Wed, 01 Apr 2020 17:23:48 +0000. Up 21.71 seconds.
  2020-04-01 17:23:48,796 - util.py[WARNING]: failed stage init-local
  failed run of stage init-local
  ------------------------------------------------------------
  Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 653, in status_wrapper
      ret = functor(name, args)
    File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 362, in main_init
      init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
    File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 699, in apply_network_config
      net.wait_for_physdevs(netcfg)
    File "/usr/lib/python3/dist-packages/cloudinit/net/__init__.py", line 523, in wait_for_physdevs
      physdevs = extract_physdevs(netcfg)
    File "/usr/lib/python3/dist-packages/cloudinit/net/__init__.py", line 519, in extract_physdevs
      raise RuntimeError('Unknown network config version: %s' % version)
  RuntimeError: Unknown network config version: None
  ------------------------------------------------------------
  Cloud-init v. 20.2-45-g5f7825e2-0ubuntu1~20.04.1 running 'init' at Wed, 01 Apr 2020 17:23:50 +0000. Up 23.69 seconds.
  ci-info: +++++++++++++++++++++++++++Net device info++++++++++++++++++++++++++++
  ci-info: +--------+-------+-----------+-----------+-------+-------------------+
  ci-info: | Device |   Up  |  Address  |    Mask   | Scope |     Hw-Address    |
  ci-info: +--------+-------+-----------+-----------+-------+-------------------+
  ci-info: |  eth0  | False |     .     |     .     |   .   | dc:a6:32:b1:78:8e |
  ci-info: |   lo   |  True | 127.0.0.1 | 255.0.0.0 |  host |         .         |
  ci-info: |   lo   |  True |  ::1/128  |     .     |  host |         .         |
  ci-info: | wlan0  | False |     .     |     .     |   .   | dc:a6:32:b1:78:8f |
  ci-info: +--------+-------+-----------+-----------+-------+-------------------+
  ci-info: +++++++++++++++++++Route IPv6 info+++++++++++++++++++
  ci-info: +-------+-------------+---------+-----------+-------+
  ci-info: | Route | Destination | Gateway | Interface | Flags |
  ci-info: +-------+-------------+---------+-----------+-------+
  ci-info: +-------+-------------+---------+-----------+-------+
  2020-04-01 17:23:50,653 - stages.py[WARNING]: Failed to rename devices: Failed to apply network config names: Unknown network config version: None

  
  Related bugs:
   * bug 1798117: juju sends "network" top level key to user.network-config in lxd containers

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1906187/+subscriptions