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

cos-proxy fails on hook "monitors-relation-changed" #83

Open
jeffreychang911 opened this issue Sep 26, 2023 · 0 comments
Open

cos-proxy fails on hook "monitors-relation-changed" #83

jeffreychang911 opened this issue Sep 26, 2023 · 0 comments

Comments

@jeffreychang911
Copy link

Bug Description

n SQA testrun ea8cc747-5fbe-4a8b-b846-1e1e8139a53b, cos-proxy fails to install in hook "monitors-relation-changed".

To Reproduce

To reproduce, deploy cos and then the charmed kubernetes bundle, which includes cos. This issue is not necessarily reproducible, we have seen this bundle deploy without issues before.

Environment

The environment is a juju maas controller hosting a charmed kubernetes deployment. This deployment is connected to cos, which is hosted on a microk8s, hosted on the same juju maas controller.

Relevant log output

From the debug log

2023-09-26 10:40:44 DEBUG juju.worker.uniter agent.go:22 [AGENT-STATUS] executing: running monitors-relation-changed hook for nrpe/0
2023-09-26 10:40:44 DEBUG juju.worker.uniter.runner runner.go:728 starting jujuc server  {unix @/var/lib/juju/agents/unit-cos-proxy-0/agent.socket <nil>}
2023-09-26 10:40:44 DEBUG unit.cos-proxy/0.juju-log server.go:316 monitors:44: Operator Framework 2.1.1+2.geb8e25a up and running.
2023-09-26 10:40:44 DEBUG unit.cos-proxy/0.juju-log server.go:316 monitors:44: Emitting Juju event monitors_relation_changed.
2023-09-26 10:40:44 DEBUG unit.cos-proxy/0.juju-log server.go:316 monitors:44: Operator Framework 2.1.1+2.geb8e25a up and running.
2023-09-26 10:40:44 DEBUG unit.cos-proxy/0.juju-log server.go:316 monitors:44: Emitting Juju event monitors_relation_changed.
2023-09-26 10:40:44 ERROR unit.cos-proxy/0.juju-log server.go:316 monitors:44: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/model.py", line 2615, in _run
    result = run(args, **kwargs)
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('/var/lib/juju/tools/unit-cos-proxy-0/network-get', 'monitors', '-r', '44', '--format=json')' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/./src/charm.py", line 475, in <module>
    main(COSProxyCharm)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/main.py", line 436, in main
    _emit_charm_event(charm, dispatcher.event_name)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/framework.py", line 354, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/framework.py", line 830, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/framework.py", line 919, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/lib/charms/nrpe_exporter/v0/nrpe_exporter.py", line 292, in _on_nrpe_relation_changed
    endpoints, alerts = self._generate_data(relation)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/lib/charms/nrpe_exporter/v0/nrpe_exporter.py", line 387, in _generate_data
    exporter_address = self._charm.model.get_binding(relation).network.bind_address
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/model.py", line 835, in network
    self._network = self._network_get(self.name, self._relation_id)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/model.py", line 828, in _network_get
    return Network(self._backend.network_get(name, relation_id))
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/model.py", line 2900, in network_get
    network = self._run(*cmd, return_output=True, use_json=True)
  File "/var/lib/juju/agents/unit-cos-proxy-0/charm/venv/ops/model.py", line 2617, in _run
    raise ModelError(e.stderr)
ops.model.ModelError: ERROR no network config found for binding "monitors"

2023-09-26 10:40:45 ERROR juju.worker.uniter.operation runhook.go:153 hook "monitors-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1

Additional context

No response

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

No branches or pull requests

1 participant