When relating oathkeeper with kratos, the following error can be observed in juju-debug logs if kratos-endpoint-info relation data is not yet available:
unit-oathkeeper-0: 12:04:01 INFO unit.oathkeeper/0.juju-log kratos-endpoint-info:6: No relation data available.
unit-oathkeeper-0: 12:04:01 ERROR unit.oathkeeper/0.juju-log kratos-endpoint-info:6: Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 724, in <module>
main(OathkeeperCharm)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/main.py", line 456, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 351, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 853, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 943, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 437, in _on_kratos_relation_changed
self._handle_status_update_config(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 531, in _handle_status_update_config
self._update_config()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 379, in __call__
do = self.iter(retry_state=retry_state)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 325, in iter
raise retry_exc.reraise()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 158, in reraise
raise self.last_attempt.result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 382, in __call__
result = fn(*args, **kwargs)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 304, in _update_config
conf = self._render_conf_file()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 291, in _render_conf_file
kratos_session_url=self._kratos_session_url,
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 272, in _kratos_session_url
return self._get_kratos_endpoint_info("sessions_endpoint")
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 334, in _get_kratos_endpoint_info
return kratos_endpoints[key]
TypeError: 'NoneType' object is not subscriptable
unit-oathkeeper-0: 12:04:01 ERROR juju.worker.uniter.operation hook "kratos-endpoint-info-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1
The charm will eventually receive the relation data and become active.
unit-oathkeeper-0: 12:04:01 INFO unit.oathkeeper/0.juju-log kratos-endpoint-info:6: No relation data available.
unit-oathkeeper-0: 12:04:01 ERROR unit.oathkeeper/0.juju-log kratos-endpoint-info:6: Uncaught exception while in charm code:
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 724, in <module>
main(OathkeeperCharm)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/main.py", line 456, in main
_emit_charm_event(charm, dispatcher.event_name)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/main.py", line 144, in _emit_charm_event
event_to_emit.emit(*args, **kwargs)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 351, in emit
framework._emit(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 853, in _emit
self._reemit(event_path)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/ops/framework.py", line 943, in _reemit
custom_handler(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 437, in _on_kratos_relation_changed
self._handle_status_update_config(event)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 531, in _handle_status_update_config
self._update_config()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 289, in wrapped_f
return self(f, *args, **kw)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 379, in __call__
do = self.iter(retry_state=retry_state)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 325, in iter
raise retry_exc.reraise()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 158, in reraise
raise self.last_attempt.result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 451, in result
return self.__get_result()
File "/usr/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
raise self._exception
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/venv/tenacity/__init__.py", line 382, in __call__
result = fn(*args, **kwargs)
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 304, in _update_config
conf = self._render_conf_file()
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 291, in _render_conf_file
kratos_session_url=self._kratos_session_url,
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 272, in _kratos_session_url
return self._get_kratos_endpoint_info("sessions_endpoint")
File "/var/lib/juju/agents/unit-oathkeeper-0/charm/./src/charm.py", line 334, in _get_kratos_endpoint_info
return kratos_endpoints[key]
TypeError: 'NoneType' object is not subscriptable
unit-oathkeeper-0: 12:04:01 ERROR juju.worker.uniter.operation hook "kratos-endpoint-info-relation-changed" (via hook dispatching script: dispatch) failed: exit status 1
Bug Description
When relating oathkeeper with kratos, the following error can be observed in juju-debug logs if
kratos-endpoint-info
relation data is not yet available:The charm will eventually receive the relation data and become active.
To Reproduce
Environment
juju 3.3.1
Relevant log output
Additional context
No response