metrics-endpoint-relation-created on every unit fail in cluster mode
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- python
- Domain
- backend, distributed-systems
Research direction
Start with _on_metrics_endpoint_relation_created in src/charm.py and follow add_metrics_user in src/controlsocket.py, especially the APIError raised by _request_raw. Reproduce the metrics-endpoint integration in a three-node controller cluster and verify that repeated relation-created events do not leave the hook in an error state when the juju-metrics-r1 user already exists.
Written by the indexing model from the issue text.
Description
I have a juju controller 3 node cluster.
I have a alloy-vm charm which can integrate with the controller via its metrics-endpoint
When I relate it to my monitoring charm "alloy-vm" which is capable of scraping metrics the relation hook ends up in an error state.
juju switch admin/controller juju integrate controller:metrics-endpoint alloy-vm:metrics-endpoint
It ends up in this:
File "/var/lib/juju/agents/unit-controller-0/charm/venv/ops/framework.py", line 947, in _reemit custom_handler(event) File "/var/lib/juju/agents/unit-controller-0/charm/./src/charm.py", line 81, in _on_metrics_endpoint_relation_created self.control_socket.add_metrics_user(username, password) File "/var/lib/juju/agents/unit-controller-0/charm/src/controlsocket.py", line 133, in add_metrics_user resp = self._request( ^^^^^^^^^^^^^^ File "/var/lib/juju/agents/unit-controller-0/charm/src/controlsocket.py", line 80, in _request response = self._request_raw(method, path, query, headers, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/var/lib/juju/agents/unit-controller-0/charm/src/controlsocket.py", line 126, in _request_raw raise APIError(body, code, status, message) controlsocket.APIError: user "juju-metrics-r1" already exists unit-controller-0: 18:43:40 ERROR juju.worker.uniter.operation hook "metrics-endpoint-relation-created" (via hook dispatching script: dispatch) failed: exit status 1
- Dominant language
- Python
- Stars
- 3
- Forks
- 21
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from juju/juju-controller
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
juju/juju-controller#155 ·
-
metrics-endpoint-relation-created hook fails with ValueError on k8s when bind_address returns service FQDNMay be free again @gfouillet claimed this 89 days ago, and no pull request is open. Open
juju/juju-controller#130 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 40/100
juju/juju-controller#96 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
juju/juju-controller#93 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
juju/juju-controller#92 · 1 comment ·
All issues in juju/juju-controller
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
snap-stanford/Biomni#380 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
microsoft/playwright-python#3361 ·
Maintainers usually reply within 1 day
-
documentation priority: low size: S status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
cubrid-lab/sqlalchemy-cubrid#1397 ·
Maintainers usually reply within 1 day
-
documentation priority: low size: S status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
cubrid-lab/pycubrid#1307 ·
Maintainers usually reply within 1 day
-
[Bug]: Installer hides SSL certificate errors as bare URLError, and the suggested fix can't workOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ShaftHQ/chaosengine-harness#143 ·
Maintainers usually reply within 1 day