KeyError on optional parameters on bridge
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cloud-init |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
I use NoCloud with network-
and the following network config according to
https:/
/var/lib/
version: 2
ethernets:
eth0:
match: {name: "eth0"}
eth1:
match: {name: "eth1"}
bridges:
br0:
interfaces: [eth1]
cloud-init init fails with a Python error:
2020年05月20日 09:53:24,474 - util.py[WARNING]: failed stage init
failed run of stage init
-------
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
init.
File "/usr/lib/
return self.distro.
File "/usr/lib/
dev_names = self._write_
File "/usr/lib/
return self._supported
File "/usr/lib/
renderer.
File "/usr/lib/
network_
File "/usr/lib/
nsi.
File "/usr/lib/
self.
File "/usr/lib/
handler(self, command)
File "/usr/lib/
self.
File "/usr/lib/
params = item_params[
KeyError: 'parameters'
It may be fixed by changing:
https:/
to
params = item_params.
as the parameters key is optional.
The workaround is to add an empty
parameters: {}
mapping to your bridge
Related branches
- cloud-init Commiters: Pending requested
-
Diff: 13 lines (+1/-1) 1 file modifiedapicloudinit/net/network_state.py (+1/-1)
Hello Felix and thanks for your bug report. Could you please run:
cloud-init collect-logs
right after the problem occurs, and attach the generated tarball to this bug report? The context information in those logs will help us to better understand what's going on.
I'm setting the status of this report to Incomplete for the moment, please change it back to New after commenting back. Thanks!
I get the same error. network-config has:
version: 2
ethernets:
ens3:
accept-ra: false
bridges:
br0:
interfaces:
- ens3
forward-delay: 0
stp: false
accept-ra: false
addresses:
- 192.168.122.250/24
- 2001:db8:
gateway4: 192.168.122.1
gateway6: 2001:db8:0:0::254
nameservers:
addresses:
- 192.168.122.1
search:
- ws.nsrc.org
and /var/log/
Cloud-init v. 19.4-33-
2020年06月05日 20:24:42,626 - util.py[WARNING]: failed stage init-local
failed run of stage init-local
-------
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
init.
File "/usr/lib/
return self.distro.
File "/usr/lib/
dev_names = self._write_
File "/usr/lib/
return self._supported
File "/usr/lib/
renderer.
File "/usr/lib/
network_
File "/usr/lib/
nsi.
File "/usr/lib/
self.
File "/usr/lib/
handler(self, command)
File "/usr/lib/
self.
File "/usr/lib/
params = item_params[
KeyError: 'parameters'
I will upload the requested logs bundle from my system.
I'd also add in the documentation at https:/
In other words, it could be that the solution is to change
br0:
interfaces:
- ens3
forward-delay: 0
stp: false
accept-ra: false
...
to
br0:
interfaces:
- ens3
parameters:
forward-
stp: false
accept-ra: false
...
Of course, this bug still applies (you might not want to set any parameters at all).
On top of this, I think it would be be helpful if an error were reported when unknown parameters appear at the outer level.
Thank you for the logs Brian. I in my setting it was very difficult to extract the logs, as the collect-logs command itself failed.
This was a regression introduced in cloud-init commit ded1ec81e3c6c37
I have made a pull request to fix this:
https:/
Hi Brian,
The development of cloud-init now happens on GitHub:
https:/
Could you please resubmit your PR there? Thanks!
[Expired for cloud-init because there has been no activity for 60 days.]
This bug is believed to be fixed in cloud-init in version 20.3. If this is still a problem for you, please make a comment and set the state back to New
Thank you.
Latest cloud-init for ubuntu 18.04 is 20.2, and this doesn't have the fix.
Are there plans to backport 20.3 ?
cloud-init 20.3 has appeared in Ubuntu 18.04, so as far as I'm concerned, this ticket can now be closed.
Tracked in Github Issues as https:/