canonical / grafana-agent-k8s-operator

https://charmhub.io/grafana-agent-k8s
Apache License 2.0
8 stars 18 forks source link

[k8s] 22.04-built charm fails on install hook when running on 20.04. #245

Closed sed-i closed 1 year ago

sed-i commented 1 year ago

Bug Description

K8s charm fails on install hook, because of a missing libssl.so.3.

Also see "Context" section in https://github.com/canonical/grafana-agent-k8s-operator/pull/242.

To Reproduce

Run prometheus tests/integration/test_remote_write_grafana_agent.py without forcing series to jammy.

Environment

Latest.

Relevant log output

INFO juju.worker.uniter awaiting error resolution for "install" hook
WARNING unit.grafana-agent/0.install Traceback (most recent call last):
WARNING unit.grafana-agent/0.install   File "/var/lib/juju/agents/unit-grafana-agent-0/charm/lib/charms/observability_libs/v0/cert_handler.py", line 41, in <module>
WARNING unit.grafana-agent/0.install     from charms.tls_certificates_interface.v2.tls_certificates import (  # type: ignore
WARNING unit.grafana-agent/0.install   File "/var/lib/juju/agents/unit-grafana-agent-0/charm/lib/charms/tls_certificates_interface/v2/tls_certificates.py", line 285, in <module>
WARNING unit.grafana-agent/0.install     from cryptography import x509
WARNING unit.grafana-agent/0.install   File "/var/lib/juju/agents/unit-grafana-agent-0/charm/venv/cryptography/x509/__init__.py", line 7, in <module>
WARNING unit.grafana-agent/0.install     from cryptography.x509 import certificate_transparency
WARNING unit.grafana-agent/0.install   File "/var/lib/juju/agents/unit-grafana-agent-0/charm/venv/cryptography/x509/certificate_transparency.py", line 11, in <module>
WARNING unit.grafana-agent/0.install     from cryptography.hazmat.bindings._rust import x509 as rust_x509
WARNING unit.grafana-agent/0.install ImportError: libssl.so.3: cannot open shared object file: No such file or directory

Additional context

According to @jameinel,

if the user isn't explicit, charmhub uses the "select descending LTS then descending supported series" so 22.04 > 20.04 ... > 23.10 > 23.04

For some reason, the focal (not jammy) series is deployed in prometheus tests/integration/test_remote_write_grafana_agent.py. Maybe something to do with pylibjuju.

However, regardless of the series selection method, we still have a problem here, and juju deploying focal instead of jammy uncovered the issue.

sed-i commented 1 year ago

Fixed in https://github.com/canonical/grafana-agent-k8s-operator/pull/254.