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

Error when relating multiple vault-kv applications #436

Closed
kelkawi-a opened this issue Jul 22, 2024 · 1 comment · Fixed by #442
Closed

Error when relating multiple vault-kv applications #436

kelkawi-a opened this issue Jul 22, 2024 · 1 comment · Fixed by #442
Labels
bug Something isn't working

Comments

@kelkawi-a
Copy link

Bug Description

We plan on using Vault as a secret store for multiple different charmed applications by relating them through the vault-kv interface. The expectation is that each application would get its own mount point when relating to the same vault-k8s charm. The charm currently goes into an error state with the below output from the logs.

vault-k8s/0*            error     idle   10.1.232.48         hook failed: "vault-peers-relation-changed"

To Reproduce

  1. juju deploy vault-k8s --channel=1.16/edge --revision=256
  2. Initialize and unseal the vault
  3. Deploy two separate vault-kv requirer charms (the one from the integration tests will do)
  4. Relate the requirer charms to the vault-k8s charm.

Environment

Operating system: Ubuntu 22.04.4 LTS

Juju CLI: 3.5.2-genericlinux-amd64

Juju agent: 3.5.2

Charm revision: 256

microk8s: v1.25.16

Relevant log output

unit-vault-k8s-0: 00:28:13 ERROR unit.vault-k8s/0.juju-log vault-peers:17: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/./src/charm.py", line 1569, in <module>
    main(VaultCharm)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/main.py", line 548, in main
    manager.run()
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/main.py", line 527, in run
    self._emit()
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/main.py", line 516, in _emit
    _emit_charm_event(self.charm, self.dispatcher.event_name)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/main.py", line 147, in _emit_charm_event
    event_to_emit.emit(*args, **kwargs)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/framework.py", line 348, in emit
    framework._emit(event)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/framework.py", line 860, in _emit
    self._reemit(event_path)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/framework.py", line 950, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/./src/charm.py", line 404, in _configure
    self._sync_vault_kv()
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/./src/charm.py", line 562, in _sync_vault_kv
    outstanding_kv_requests = self.vault_kv.get_outstanding_kv_requests()
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/lib/charms/vault_k8s/v0/vault_kv.py", line 408, in get_outstanding_kv_requests
    if not self._credentials_issued_for_request(
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/lib/charms/vault_k8s/v0/vault_kv.py", line 449, in _credentials_issued_for_request
    relation = self.model.get_relation(self.relation_name, relation_id)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/model.py", line 245, in get_relation
    return self.relations._get_unique(relation_name, relation_id)
  File "/var/lib/juju/agents/unit-vault-k8s-0/charm/venv/ops/model.py", line 939, in _get_unique
    raise TooManyRelatedAppsError(relation_name, num_related, 1)
ops.model.TooManyRelatedAppsError: Too many remote applications on vault-kv (2 > 1)

Additional context

No response

@kelkawi-a kelkawi-a added the bug Something isn't working label Jul 22, 2024
@gruyaume
Copy link
Collaborator

gruyaume commented Jul 22, 2024

Hello @kelkawi-a thank you for opening this issue. We should be looking at it in the next couple of days. Thank you.

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.

2 participants