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

grafana-agent charm install hook fails on focal #5

Closed
dashmage opened this issue Sep 15, 2023 · 5 comments · Fixed by #9
Closed

grafana-agent charm install hook fails on focal #5

dashmage opened this issue Sep 15, 2023 · 5 comments · Fixed by #9

Comments

@dashmage
Copy link

Bug Description

While deploying grafana-agent and relating with a focal unit, there's an install hook error.

To Reproduce

$ juju deploy ubuntu --base [email protected]
$ juju deploy grafana-agent --channel edge --base [email protected]
$ juju relate ubuntu grafana-agent

Environment

  • This bug occurs when running juju locally on lxd and on openstack.
  • Deployed grafana-agent from edge channel
  • Controller version for model is 3.1.5

Relevant log output

$ juju status

Model              Controller        Cloud/Region             Version  SLA          Timestamp
grafana-agent-bug  serverstack-ctrl  serverstack/serverstack  3.1.5    unsupported  11:48:59Z

App            Version  Status  Scale  Charm          Channel  Rev  Exposed  Message
grafana-agent           error       1  grafana-agent  edge      18  no       hook failed: "install"
ubuntu         20.04    active      1  ubuntu         stable    24  no

Unit                Workload  Agent  Machine  Public address  Ports  Message
ubuntu/0*           active    idle   0        10.5.2.237
  grafana-agent/1*  error     idle            10.5.2.237             hook failed: "install"

Machine  State    Address     Inst id                               Base          AZ    Message
0        started  10.5.2.237  56c25251-fd92-459c-92ae-390d132ee2a0  [email protected]  nova  ACTIVE



$ juju debug-log

unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install Traceback (most recent call last):
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/lib/charms/observability_libs/v0/cert_handler.py", line 41, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from charms.tls_certificates_interface.v2.tls_certificates import (  # type: ignore
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/lib/charms/tls_certificates_interface/v2/tls_certificates.py", line 285, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from cryptography import x509
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/venv/cryptography/x509/__init__.py", line 7, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from cryptography.x509 import certificate_transparency
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/venv/cryptography/x509/certificate_transparency.py", line 11, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from cryptography.hazmat.bindings._rust import x509 as rust_x509
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install ImportError: libssl.so.3: cannot open shared object file: No such file or directory
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install During handling of the above exception, another exception occurred:
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install Traceback (most recent call last):
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "./src/charm.py", line 20, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from grafana_agent import METRICS_RULES_SRC_PATH, GrafanaAgentCharm
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/src/grafana_agent.py", line 31, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     from charms.observability_libs.v0.cert_handler import CertHandler
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install   File "/var/lib/juju/agents/unit-grafana-agent-1/charm/lib/charms/observability_libs/v0/cert_handler.py", line 51, in <module>
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install     raise ImportError(
unit-grafana-agent-1: 11:48:23 WARNING unit.grafana-agent/1.install ImportError: charms.tls_certificates_interface.v2.tls_certificates is missing; please get it through charmcraft fetch-lib
unit-grafana-agent-1: 11:48:23 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1
unit-grafana-agent-1: 11:48:23 INFO juju.worker.uniter awaiting error resolution for "install" hook

Additional context

This could be caused with the latest commit that bumps the operator_libs_linux library to v2.

This error is not present on jammy.

@sed-i
Copy link
Contributor

sed-i commented Sep 15, 2023

We need to split the build-on/run-on. A 22.04 charm cannot run as-is on 20.04.

@simskij
Copy link
Member

simskij commented Sep 15, 2023

Works on 22.04, confirming @sed-i's statement.

Machine  State    Address        Inst id        Base          AZ  Message
0        started  10.227.50.80   juju-2b0924-0  [email protected]      Running
1        started  10.227.50.220  juju-2b0924-1  [email protected]      Running
ubuntu@juju:~$ juju status
Model      Controller  Cloud/Region         Version  SLA          Timestamp
issue-250  lxd         localhost/localhost  3.1.5    unsupported  14:38:57+02:00

App             Version  Status   Scale  Charm          Channel  Rev  Exposed  Message
grafana-agent            error        1  grafana-agent  edge      18  no       hook failed: "install"
grafana-agent2           blocked      1  grafana-agent  edge      18  no       logging-consumer: off, send-remote-write: off, grafana-cloud-config: off
ubuntu          20.04    active       1  ubuntu         stable    24  no       
ubuntu2         22.04    active       1  ubuntu         stable    24  no       

Unit                 Workload  Agent  Machine  Public address  Ports  Message
ubuntu2/0*           active    idle   1        10.227.50.220          
  grafana-agent2/0*  blocked   idle            10.227.50.220          logging-consumer: off, send-remote-write: off, grafana-cloud-config: off
ubuntu/0*            active    idle   0        10.227.50.80           
  grafana-agent/0*   error     idle            10.227.50.80           hook failed: "install"

Machine  State    Address        Inst id        Base          AZ  Message
0        started  10.227.50.80   juju-2b0924-0  [email protected]      Running
1        started  10.227.50.220  juju-2b0924-1  [email protected]      Running

@sed-i
Copy link
Contributor

sed-i commented Sep 27, 2023

@simskij for some reason I can't transfer this issue to the machine charm repo. Are you able to?

@sed-i
Copy link
Contributor

sed-i commented Sep 29, 2023

Partially blocked by canonical/charmcraft#1263.

@sed-i sed-i transferred this issue from canonical/grafana-agent-k8s-operator Oct 3, 2023
@sed-i sed-i mentioned this issue Oct 5, 2023
@PietroPasotti
Copy link
Contributor

Should have been closed by #9, @dashmage please re-open if the issue persists.

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

Successfully merging a pull request may close this issue.

4 participants