Skip to content
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

cloud-init crashes with IPv6 routes #4094

Closed
ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Closed

cloud-init crashes with IPv6 routes #4094

ubuntu-server-builder opened this issue May 12, 2023 · 4 comments
Labels
incomplete Action required by submitter launchpad Migrated from Launchpad

Comments

@ubuntu-server-builder
Copy link
Collaborator

This bug was originally filed in Launchpad as LP: #2014226

Launchpad details
affected_projects = []
assignee = None
assignee_name = None
date_closed = None
date_created = 2023-03-31T21:37:48.042949+00:00
date_fix_committed = 2023-04-05T21:59:44.610594+00:00
date_fix_released = 2023-04-05T21:59:44.610594+00:00
id = 2014226
importance = undecided
is_complete = False
lp_url = https://bugs.launchpad.net/cloud-init/+bug/2014226
milestone = None
owner = mcamilli
owner_name = Michael Camilli
private = False
status = incomplete
submitter = mcamilli
submitter_name = Michael Camilli
tags = ['docs']
duplicates = []

Launchpad user Michael Camilli(mcamilli) wrote on 2023-03-31T21:37:48.042949+00:00

I have static routes specified for two networks, and during cloud-init an error occurs as it tries to make use of NETMASK1.

Network 2

eth1:
addresses: # List of IP[v4,v6] addresses to assign to this interface
- 2001:db8:abcd:abce:fe::1000/96

routes: # List of static routes for this interface
  - to: 2001:db8:abcd:abce:fe::0/96
    via: 2001:db8:abcd:bbce:fe::2

Network 3

eth2:
addresses: # List of IP[v4,v6] addresses to assign to this interface
- 2001:db8:abcd:abcf:fe::1000/96

routes: # List of static routes for this interface
  - to: 2001:db8:abcd:abcf:fe::0/96
    via: 2001:db8:abcd:bbcf:fe::2

Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 761, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 433, in main_init
init.apply_network_config(bring_up=bring_up_interfaces)
File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 926, in apply_network_config
netcfg, bring_up=bring_up
File "/usr/lib/python3.6/site-packages/cloudinit/distros/init.py", line 233, in apply_network_config
self._write_network_state(network_state)
File "/usr/lib/python3.6/site-packages/cloudinit/distros/init.py", line 129, in _write_network_state
renderer.render_network_state(network_state)
File "/usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py", line 1011, in render_network_state
base_sysconf_dir, network_state, self.flavor, templates=templates
File "/usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py", line 1002, in _render_sysconfig
contents[cpath] = iface_cfg.routes.to_string(proto)
File "/usr/lib/python3.6/site-packages/cloudinit/net/sysconfig.py", line 199, in to_string
netmask_value = str(self._conf["NETMASK" + index])
KeyError: 'NETMASK1'

Additional Info:

  1. Using KVM on a private server
  2. See above configuration details that cause an issue. Note in the documentation I could only find an example of an ipv4 route, so maybe you could enhance the documentation with an example for ipv6 if possible.
@ubuntu-server-builder ubuntu-server-builder added incomplete Action required by submitter launchpad Migrated from Launchpad labels May 12, 2023
@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Michael Camilli(mcamilli) wrote on 2023-03-31T21:37:48.042949+00:00

Launchpad attachments: cloud-init.tar.gz

@ubuntu-server-builder
Copy link
Collaborator Author

Launchpad user Chad Smith(chad.smith) wrote on 2023-04-05T21:59:37.597357+00:00

Thanks for filing a bug and making cloud-init better and for the documentation request plug as well.
I'm adding a docs tag to the bug so it could be looked at from a documentation standpoint as well.

This bug looks conspicuously like the former bug https://bugs.launchpad.net/cloud-init/+bug/1958506 which was fixed in cloud-init version 22.2. If possible, would you be able to try reproducing this issue with a newer version of cloud-init?

You may be able to install cloud-init upstream's latest approved upstream release of 23.1 from our copr repo
https://copr.fedorainfracloud.org/coprs/g/cloud-init/el-testing/packages/

Once cloud-init is upgraded to 23.1 try running sudo cloud-init clean --logs --reboot to force cloud-init to try to reconfigure the system and network from scratch across reboot. If the KeyError still persists, then we know this is a new bug and not one formerly fixed.
I'm marking it 'incomplete' status above. Please set back to 'New' if you get a chance to confirm that latest cloud-init 23.1 still exhibits this issue.

@igalic
Copy link
Collaborator

igalic commented Jun 14, 2023

@holmanb
Copy link
Member

holmanb commented May 28, 2024

This is believed to be fixed. Please reopen if you believe this to still be an issue.

@holmanb holmanb closed this as completed May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incomplete Action required by submitter launchpad Migrated from Launchpad
Projects
None yet
Development

No branches or pull requests

3 participants