canonical / traefik-k8s-operator

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

Traefik in error state while deploying COS-Lite #110

Closed Abuelodelanada closed 1 year ago

Abuelodelanada commented 1 year ago

Bug Description

Sometimes Traefik ends up in error state while deploying COS-Lite.

╭─ubuntu@charm-dev-juju-3 ~ 
╰─$ juju status --color --relations           
Model  Controller           Cloud/Region        Version  SLA          Timestamp
cos    charm-dev-batteries  microk8s/localhost  3.0.2    unsupported  14:59:03-03:00

App           Version  Status   Scale  Charm             Channel  Rev  Address         Exposed  Message
alertmanager  0.23.0   active       1  alertmanager-k8s  stable    36  10.152.183.24   no       
catalogue              active       1  catalogue-k8s     stable     4  10.152.183.99   no       
grafana       9.2.1    active       1  grafana-k8s       stable    52  10.152.183.27   no       
loki          2.4.1    active       1  loki-k8s          stable    47  10.152.183.221  no       
prometheus    2.33.5   active       1  prometheus-k8s    stable    79  10.152.183.84   no       
traefik                waiting      1  traefik-k8s       stable    93  10.152.183.203  no       installing agent

Unit             Workload  Agent  Address      Ports  Message
alertmanager/0*  active    idle   10.1.36.120         
catalogue/0*     active    idle   10.1.36.109         
grafana/0*       active    idle   10.1.36.123         
loki/0*          active    idle   10.1.36.122         
prometheus/0*    active    idle   10.1.36.121         
traefik/0*       error     idle   10.1.36.119         hook failed: "traefik-route-relation-changed" for grafana:ingress

To Reproduce

  1. Deploy cos-lite: juju deploy cos-lite --trust
  2. Check juju status

Environment

Relevant log output

unit-traefik-0: 14:57:28.646 INFO juju.worker.uniter awaiting error resolution for "relation-changed" hook
unit-traefik-0: 14:57:30.712 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 710, 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 166, in _on_relation_changed
    self._update_requirers_with_external_host()
  File "/var/lib/juju/agents/unit-traefik-0/charm/lib/charms/traefik_route_k8s/v0/traefik_route.py", line 175, in _update_requirers_with_external_host
    relation.data[self.charm.app]["external_host"] = self._stored.external_host
  File "/var/lib/juju/agents/unit-traefik-0/charm/venv/ops/model.py", line 945, in __setitem__
    raise RelationDataError('relation data values must be strings')
ops.model.RelationDataError: relation data values must be strings
unit-traefik-0: 14:57:31.044 ERROR juju.worker.uniter.operation hook "traefik-route-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1
unit-traefik-0: 14:57:31.046 INFO juju.worker.uniter awaiting error resolution for "relation-changed" hook

Additional context

No response

sed-i commented 1 year ago

This sounds like #106. Would you be able to test with edge?

Abuelodelanada commented 1 year ago

@sed-i after refreshing traefik charm with edge everything is ok. It's #106 !