Bootstrap fails if ipv6 present on host

Bug #2067481 reported by Mark Beierl
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sunbeam Charms
Fix Committed
High
Hemanth Nakkina

Bug Description

openstack 2024.1 507 2024.1/edge canonical✓ -
openstack-hypervisor 2024.1 143 2024.1/edge canonical✓ -

I attempted installation on a host that has IPv6 addresses on the primary interface:

  2607:fea8:60a1:2300:92b1:1cff:fea2:69a8

Bootstrap failed and the following was observed in the Juju debug-log:

unit-openstack-hypervisor-0: 20:04:27 INFO juju.worker.uniter awaiting error resolution for "relation-joined" hook
unit-openstack-hypervisor-0: 20:04:28 ERROR unit.openstack-hypervisor/0.juju-log certificates:3: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/./src/charm.py", line 565, in <module>
    main(HypervisorOperatorCharm)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/main.py", line 544, in main
    manager.run()
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/main.py", line 520, in run
    self._emit()
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/main.py", line 509, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/main.py", line 143, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/framework.py", line 350, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/framework.py", line 849, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/venv/ops/framework.py", line 939, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/lib/ops_sunbeam/relation_handlers.py", line 965, in _on_certificates_relation_joined
    self._request_certificates()
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/./src/charm.py", line 130, in _request_certificates
    csr = generate_csr(
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/lib/charms/tls_certificates_interface/v1/tls_certificates.py", line 819, in generate_csr
    _sans.extend([x509.IPAddress(IPv4Address(san)) for san in sans_ip])
  File "/var/lib/juju/agents/unit-openstack-hypervisor-0/charm/lib/charms/tls_certificates_interface/v1/tls_certificates.py", line 819, in <listcomp>
    _sans.extend([x509.IPAddress(IPv4Address(san)) for san in sans_ip])
  File "/usr/lib/python3.10/ipaddress.py", line 1305, in __init__
    self._ip = self._ip_int_from_string(addr_str)
  File "/usr/lib/python3.10/ipaddress.py", line 1192, in _ip_int_from_string
    raise AddressValueError("Expected 4 octets in %r" % ip_str)
ipaddress.AddressValueError: Expected 4 octets in '2607:fea8:60a1:2300:92b1:1cff:fea2:69a8'

Revision history for this message
Mark Beierl (mbeierl) wrote :

Disabling IPv6 was sufficient to workaround the problem.

Changed in sunbeam-charms:
status: New → Confirmed
importance: Undecided → High
tags: added: open-2187
Changed in sunbeam-charms:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to sunbeam-charms (main)
Changed in sunbeam-charms:
assignee: nobody → Hemanth Nakkina (hemanth-n)
Revision history for this message
Hemanth Nakkina (hemanth-n) wrote :

Problem should be resolved by the endpoint bindings introduced in snap-openstack.
The fix in sunbeam-charms is an additional check.

sunbeam is not tested on just ipv6 only network. However to support only IPv6 in future,
raised following bug on tls-certificate interface https://github.com/canonical/tls-certificates-interface/issues/194

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to sunbeam-charms (main)

Reviewed: https://review.opendev.org/c/openstack/sunbeam-charms/+/922782
Committed: https://opendev.org/openstack/sunbeam-charms/commit/e31f1eb34c0c38e660afce90897523cd9730cb3a
Submitter: "Zuul (22348)"
Branch: main

commit e31f1eb34c0c38e660afce90897523cd9730cb3a
Author: Hemanth Nakkina <email address hidden>
Date: Wed Jun 26 11:58:01 2024 +0530

    [ops-sunbeam] return only ipv4 address for ip_sans

    Generate CSR expects only IPv4 address as sans.
    Return only IPv4 addresses for ip_sans.

    Closes-Bug: #2067481
    Change-Id: Ibf4943d00815f61eeab27bfdc312bbd5c0e94dc9

tags: added: in-main
Changed in sunbeam-charms:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.