canonical / traefik-k8s-operator

https://charmhub.io/traefik-k8s
Apache License 2.0
11 stars 26 forks source link

Charm goes into error state on startup #90

Open sed-i opened 2 years ago

sed-i commented 2 years ago

When deploying the cos-lite bundle, traefik enters error state because of an assertion error:

Example 1: Manual bundle deployment

unit-traefik-0: 11:53:36.750 ERROR unit.traefik/0.juju-log traefik-route:5: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "./src/charm.py", line 693, in <module>
    main(TraefikIngressCharm)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 431, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/main.py", line 142, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 316, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 784, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 857, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_route_k8s/v0/traefik_route.py", line 153, in _on_relation_changed
    self.on.ready.emit(event.relation)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 316, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 784, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/framework.py", line 857, in _reemit
    custom_handler(event)
  File "./src/charm.py", line 361, in _handle_traefik_route_ready
    self._process_ingress_relation(event.relation)
  File "./src/charm.py", line 373, in _process_ingress_relation
    assert gateway_address, "No gateway address available"

https://github.com/canonical/traefik-k8s-operator/blob/14bc21f39c3eb9c4d500d5e2226211b2c3508d75/src/charm.py#L366-L373

Example 2: CI

https://github.com/canonical/cos-lite-bundle/actions/runs/3189444890/jobs/5203256288

sed-i commented 2 years ago

I think this was fixed by #91 @PietroPasotti ?

PietroPasotti commented 2 years ago

yes it should be!