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

hook failed: "update-status" when relating for more than one application #95

Closed
ashugauttam225 opened this issue Nov 8, 2023 · 2 comments · Fixed by #137
Closed

hook failed: "update-status" when relating for more than one application #95

ashugauttam225 opened this issue Nov 8, 2023 · 2 comments · Fixed by #137
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ashugauttam225
Copy link

adding hw-observer for one application worked fine(let say nova-compute), but when adding it for other application in the same model i.e ceph-osd or ubuntu(which are on metal) it is getting failed with the below error.

detailed error log:

unit-hardware-observer-11: 14:22:39 INFO unit.hardware-observer/11.juju-log Writing file to /etc/hardware-exporter-config.yaml.
unit-hardware-observer-11: 14:22:39 INFO unit.hardware-observer/11.juju-log Writing file to /etc/hardware-exporter-config.yaml - Done.
unit-hardware-observer-11: 14:22:39 ERROR unit.hardware-observer/11.juju-log Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/./src/charm.py", line 173, in
ops.main(HardwareObserverCharm) # type: ignore
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/main.py", line 451, in call
return main(charm_class, use_juju_for_storage=use_juju_for_storage)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/main.py", line 436, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/main.py", line 144, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/framework.py", line 340, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/framework.py", line 842, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/framework.py", line 931, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/./src/charm.py", line 144, in _on_config_changed
self._on_update_status(event)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/./src/charm.py", line 90, in _on_update_status
if not self.model.get_relation("cos-agent"):
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/model.py", line 237, in get_relation
return self.relations._get_unique(relation_name, relation_id)
File "/var/lib/juju/agents/unit-hardware-observer-11/charm/venv/ops/model.py", line 864, in _get_unique
raise TooManyRelatedAppsError(relation_name, num_related, 1)
ops.model.TooManyRelatedAppsError: Too many remote applications on cos-agent (3 > 1)
unit-hardware-observer-11: 14:22:40 ERROR juju.worker.uniter.operation hook "config-changed" (via hook dispatching script: dispatch) failed: exit status 1
unit-hardware-observer-11: 14:22:40 INFO juju.worker.uniter awaiting error resolution for "config-changed" hook
unit-hardware-observer-11: 14:26:18 INFO juju.worker.uniter awaiting error resolution for "config-changed" hook
unit-hardware-observer-11: 14:27:40 INFO juju.worker.uniter awaiting error resolution for "config-changed" hook
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Setting exporter-log-level to: INFO
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Setting exporter-port to: 10000
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Setting redfish-password to:
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Setting redfish-username to:
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Detected changes in exporter config.
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Attempt 1 of /redfish/v1/
unit-hardware-observer-11: 14:27:41 INFO unit.hardware-observer/11.juju-log Response Time for GET to /redfish/v1/: 0.19726872816681862 seconds.
unit-hardware-observer-11: 14:27:42 INFO unit.hardware-observer/11.juju-log Attempt 1 of /redfish/v1/SessionService/Sessions
unit-hardware-observer-11: 14:27:42 INFO unit.hardware-observer/11.juju-log Response Time for POST to /redfish/v1/SessionService/Sessions: 0.1827135756611824 seconds.

@Pjack
Copy link

Pjack commented Nov 9, 2023

There are 2 grafana-agent and then cause this problem. It may be not a real issue, should remove one of grafana-agent in the environment.

@Pjack Pjack added the bug Something isn't working label Nov 9, 2023
This was referenced Nov 28, 2023
@Pjack Pjack added this to the 23.10.2 milestone Nov 30, 2023
@jneo8
Copy link
Contributor

jneo8 commented Dec 4, 2023

Adding relation number check in #119

@jneo8 jneo8 self-assigned this Dec 4, 2023
@Pjack Pjack linked a pull request Dec 26, 2023 that will close this issue
@Pjack Pjack closed this as completed Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants