-
Notifications
You must be signed in to change notification settings - Fork 908
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Top-level 'network' key results in error using v2 config #3815
Comments
Launchpad user Christian Dohm(chris1294832) wrote on 2020-11-29T22:09:12.179620+00:00 Should be yamlencode(), it also happens with ubuntu-20.10-preinstalled-server-arm64+raspi.img.xz |
Launchpad user Ryan Harper(raharper) wrote on 2020-11-30T15:37:16+00:00
Thank you for filing a bug.
This happens due to the _maybe_remove_top_network method which only Then this network config is passed to cloudinit.net which expects We should fix _maybe_remove_top_network to handle either v1 or v2; As a workaround, if you specify your network config version 2 with the
set-name: eth0 This should let you progress. |
Launchpad user Launchpad Janitor(janitor) wrote on 2021-04-19T23:03:48.964839+00:00 Status changed to 'Confirmed' because the bug affects multiple users. |
Launchpad user James Falcon(falcojr) wrote on 2022-05-17T19:02:25.158035+00:00 Fix committed at #1417 |
Launchpad user Brett Holman(holmanb) wrote on 2022-05-18T16:51:36.518080+00:00 This bug is believed to be fixed in cloud-init in version 22.2. If this is still a problem for you, please make a comment and set the state back to New Thank you. |
Launchpad user Launchpad Janitor(janitor) wrote on 2022-05-19T06:25:47.811570+00:00 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
-- Brett Holman brett.holman@canonical.com Wed, 18 May 2022 11:23:42 -0600 |
This bug was originally filed in Launchpad as LP: #1906187
Launchpad details
Launchpad user Christian Dohm(chris1294832) wrote on 2020-11-29T21:45:28.567511+00:00
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:
The text was updated successfully, but these errors were encountered: