Missing vip config shouldn't be a critical error - AttributeError: 'NoneType' object has no attribute 'split'

Bug #2039678 reported by Nobuto Murata
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Loadbalancer Charm
Triaged
High
Unassigned

Bug Description

Deploying the charm from jammy/stable and relate it with ceph-mon leads to an error status immediately.

ceph-loadbalancer error 1 openstack-loadbalancer jammy/stable 10 no hook failed: "loadbalancer-relation-changed"

The error is about missing vip a vip config, but it shouldn't be a critical error. Instead, the status can be "blocked".

unit-ceph-loadbalancer-0: 12:29:54 ERROR unit.ceph-loadbalancer/0.juju-log loadbalancer:10: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 153, in <module>
    main(OpenstackLoadbalancerCharm)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/main.py", line 431, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/main.py", line 142, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 283, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 743, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 790, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/interface_openstack_loadbalancer/loadbalancer.py", line 213, in _on_relation_changed
    self.on.lb_requested.emit()
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 283, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 743, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/venv/ops/framework.py", line 790, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 150, in _process_lb_requests
    self._send_loadbalancer_response()
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 115, in _send_loadbalancer_response
    for binding, vips in self._get_space_vip_mapping().items():
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 105, in _get_space_vip_mapping
    bindings[binding_name] = [
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 108, in <listcomp>
    for vip in self.vips
  File "/var/lib/juju/agents/unit-ceph-loadbalancer-0/charm/./src/charm.py", line 100, in vips
    return self.config.get('vip').split()
AttributeError: 'NoneType' object has no attribute 'split'
unit-ceph-loadbalancer-0: 12:29:55 ERROR juju.worker.uniter.operation hook "loadbalancer-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1

Nobuto Murata (nobuto)
tags: added: good-first-bug
Revision history for this message
Nobuto Murata (nobuto) wrote :

> The error is about missing vip a vip config, but it shouldn't be a critical error. Instead, the status can be "blocked".

For the record, a single unit without vip is totally fine from a deployment point of view. It's not for production usage, but it's well suited for testing purposes. So it doesn't have to be even "blocked" when hacluster relation is not there yet.

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

> > The error is about missing vip a vip config, but it shouldn't be a critical error. Instead, the status can be "blocked".

> For the record, a single unit without vip is totally fine from a deployment point of view. It's not for production usage, but it's well suited for testing purposes. So it doesn't have to be even "blocked" when hacluster relation is not there yet.

Yes, totally agree. The current code for the vips() is broken, in that it should default to a string, not None:

    @property
    def vips(self):
        return self.config.get('vip').split()

e.g. just changing it to "self.config.get('vip', '').split() would return an empty list rather than breaking due to the None.

If there's no hacluster relation, then it should 'just work' (I think?) - i.e. it won't go into blocked and will just use it's normal ingress address, rather than a VIP.

Changed in charm-openstack-loadbalancer:
importance: Undecided → High
status: New → Triaged
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.