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 on ingress removed #185

Open
shipperizer opened this issue Apr 29, 2024 · 1 comment
Open

Error on ingress removed #185

shipperizer opened this issue Apr 29, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@shipperizer
Copy link
Contributor

shipperizer commented Apr 29, 2024

Bug Description

charm doesn't behave nicely on ingress remove hook

To Reproduce

create a tfvars file with the following:

idp_provider_config = {
  client_id   = " ********************************************"
  provider    = "github"
  provider_id = "github_cccca7a7a3666c2bc336a09713596333b5d02fbc"
}

idp_provider_credentials = {
  client_secret = "********************************************"
}

internal_ingress = {
  name     = "traefik-internal"
  endpoint = "ingress"
}

juju_offers = {
  external_ingress_offer = "admin/admin.ingress"
}

model = "test"

hydra = {
  channel = "0.2/stable"
}

kratos = {
  channel = "0.2/stable"
}

login_ui = {
  channel = "0.2/stable"
}

using the terraform module in canonical/iam-bundle-integration on the IAM-838 branch do:

  • juju add-model test
  • juju add-model admin
  • juju deploy traefik-k8s --channel stable traefik-public --model admin
  • juju deploy traefik-k8s --channel stable traefik-internal --model test
  • juju offer admin.traefik-public:ingress ingress
  • terraform apply -var-file
  • terraform destroy -var-file

Environment

0.2/stable

Relevant log output

2024-04-29T21:09:55.303Z [container-agent] 2024-04-29 21:09:55 INFO juju.worker.uniter resolver.go:180 awaiting error resolution for "relation-departed" hook
2024-04-29T21:09:55.856Z [container-agent] 2024-04-29 21:09:55 ERROR juju-log admin-ingress:10: Uncaught exception while in charm code:
2024-04-29T21:09:55.856Z [container-agent] Traceback (most recent call last):
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 3019, in _run
2024-04-29T21:09:55.856Z [container-agent]     result = subprocess.run(args, **kwargs)  # type: ignore
2024-04-29T21:09:55.856Z [container-agent]   File "/usr/lib/python3.10/subprocess.py", line 526, in run
2024-04-29T21:09:55.856Z [container-agent]     raise CalledProcessError(retcode, process.args,
2024-04-29T21:09:55.856Z [container-agent] subprocess.CalledProcessError: Command '('/var/lib/juju/tools/unit-kratos-0/relation-set', '-r', '14', '--app', '--file', '-')' returned non-zero exit status 2.
2024-04-29T21:09:55.856Z [container-agent] 
2024-04-29T21:09:55.856Z [container-agent] The above exception was the direct cause of the following exception:
2024-04-29T21:09:55.856Z [container-agent] 
2024-04-29T21:09:55.856Z [container-agent] Traceback (most recent call last):
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 3124, in relation_set
2024-04-29T21:09:55.856Z [container-agent]     self._run(*args, input_stream=content)
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 3021, in _run
2024-04-29T21:09:55.856Z [container-agent]     raise ModelError(e.stderr) from e
2024-04-29T21:09:55.856Z [container-agent] ops.model.ModelError: ERROR invalid value "14" for option -r: relation not found
2024-04-29T21:09:55.856Z [container-agent] 
2024-04-29T21:09:55.856Z [container-agent] 
2024-04-29T21:09:55.856Z [container-agent] The above exception was the direct cause of the following exception:
2024-04-29T21:09:55.856Z [container-agent] 
2024-04-29T21:09:55.856Z [container-agent] Traceback (most recent call last):
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/./src/charm.py", line 1075, in <module>
2024-04-29T21:09:55.856Z [container-agent]     main(KratosCharm)
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/main.py", line 454, in main
2024-04-29T21:09:55.856Z [container-agent]     framework.reemit()
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/framework.py", line 863, in reemit
2024-04-29T21:09:55.856Z [container-agent]     self._reemit()
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/framework.py", line 943, in _reemit
2024-04-29T21:09:55.856Z [container-agent]     custom_handler(event)
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/./src/charm.py", line 894, in _on_client_config_changed
2024-04-29T21:09:55.856Z [container-agent]     self.external_provider.set_relation_registered_provider(
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/lib/charms/kratos_external_idp_integrator/v0/kratos_external_provider.py", line 763, in set_relation_registered_provider
2024-04-29T21:09:55.856Z [container-agent]     relation.data[self.model.app].update(data)
2024-04-29T21:09:55.856Z [container-agent]   File "/usr/lib/python3.10/_collections_abc.py", line 999, in update
2024-04-29T21:09:55.856Z [container-agent]     self[key] = other[key]
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 1687, in __setitem__
2024-04-29T21:09:55.856Z [container-agent]     self._commit(key, value)
2024-04-29T21:09:55.856Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 1691, in _commit
2024-04-29T21:09:55.857Z [container-agent]     self._backend.update_relation_data(self.relation.id, self._entity, key, value)
2024-04-29T21:09:55.857Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 3355, in update_relation_data
2024-04-29T21:09:55.857Z [container-agent]     self.relation_set(relation_id, key, value, isinstance(_entity, Application))
2024-04-29T21:09:55.857Z [container-agent]   File "/var/lib/juju/agents/unit-kratos-0/charm/venv/ops/model.py", line 3127, in relation_set
2024-04-29T21:09:55.857Z [container-agent]     raise RelationNotFoundError() from e
2024-04-29T21:09:55.857Z [container-agent] ops.model.RelationNotFoundError

Additional context

No response

@shipperizer shipperizer added the bug Something isn't working label Apr 29, 2024
Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/IAM-865.

This message was autogenerated

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

No branches or pull requests

1 participant