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

traefik hook error #106

Closed
jamesbeedy opened this issue Nov 23, 2022 · 5 comments · Fixed by #103
Closed

traefik hook error #106

jamesbeedy opened this issue Nov 23, 2022 · 5 comments · Fixed by #103

Comments

@jamesbeedy
Copy link

Bug Description

unit-traefik-0: 22:43:11 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

To Reproduce

#!/bin/bash

# Install microk8s, juju and lxd snaps
sudo snap install microk8s --classic
sudo snap install juju --classic
sudo snap install lxd --channel latest/stable

lxd init --auto
lxc network set lxdbr0 ipv6.address none

sudo zpool create lxd-pool /dev/nvme0n1p3
lxc storage create lxd-pool zfs source=lxd-pool

# Uncomment and configure your own zfs pool name
lxc profile edit default <<EOY
config: {}
description: Default LXD profile
devices:
  eth0:
    name: eth0
    network: lxdbr0
    type: nic
  root:
    path: /
    pool: lxd-pool
    type: disk
name: default
EOY

#
# Bootstrap LXD
juju bootstrap lxd

# Enable microk8s hostpath storage and dns
microk8s.enable hostpath-storage dns

# Get our primary ip and add the k8s to our lxd controller
my_ip=`hostname --ip-address | awk '{print $2}'`
#ip route get 8.8.8.8 | head -1 | cut -d' ' -f7
microk8s.kubectl config view --raw \
  | sed "s/127.0.0.1/\${my_ip}/g" \
  | juju add-k8s microk8s-localhost --cluster-name=microk8s-cluster --controller=localhost-localhost

# Add a k8s model
juju add-model cos-lite-testing microk8s-localhost

# Deploy COS lite
juju deploy cos-lite --trust

Environment

hitting this on latest/stable and latest/edge

Relevant log output

https://paste.ubuntu.com/p/32cvWD8rhW/

Additional context

No response

@sed-i
Copy link
Contributor

sed-i commented Nov 24, 2022

I think this was fixed in canonical/traefik-route-k8s-operator#18
@PietroPasotti?

@PietroPasotti
Copy link
Collaborator

Yup should be. We only need to bump the lib in all bundle charms

@sed-i
Copy link
Contributor

sed-i commented Nov 24, 2022

Transferring to traefik-k8s since it is the one errors in the log.

@sed-i sed-i transferred this issue from canonical/cos-lite-bundle Nov 24, 2022
@PietroPasotti
Copy link
Collaborator

noooo why...
I had originally transferred canonical/traefik-route-k8s-operator#18 from traefik-k8s :D
Either way I believe this can be closed. We should release a new cos-lite soon with this fix, it's starting to pop up too often

@sed-i
Copy link
Contributor

sed-i commented Nov 24, 2022

This will automatically close once #103 merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants