The k8s deployment controller for dex-auth keeps toggling between 0 and 1. For deployments, each time a new pod is created, that results in a new Juju unit, hence a new leader. So next step is to figure out what's causing the deployment to kill and restart pods.
In the Juju logs, there is a hook error logged twice
application-dex-auth: 11:58:50 ERROR unit.dex-auth/0.juju-log oidc-client:0: Hook error:
Traceback (most recent call last):
File "lib/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "lib/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "lib/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "lib/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-dex-auth-0/charm/reactive/dex_auth.py", line 60, in start_charm
oidc_client_info = endpoint_from_name('oidc-client').get_config()
File "/var/lib/juju/agents/unit-dex-auth-0/charm/hooks/relations/oidc-client/requires.py", line 13, in get_config
return [
File "/var/lib/juju/agents/unit-dex-auth-0/charm/hooks/relations/oidc-client/requires.py", line 14, in <listcomp>
json.loads(unit.received_raw["client_info"])
File "/usr/lib/python3.8/json/__init__.py", line 341, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType
The k8s deployment controller for dex-auth keeps toggling between 0 and 1. For deployments, each time a new pod is created, that results in a new Juju unit, hence a new leader. So next step is to figure out what's causing the deployment to kill and restart pods.
In the Juju logs, there is a hook error logged twice
application- dex-auth: 11:58:50 ERROR unit.dex- auth/0. juju-log oidc-client:0: Hook error: reactive/ __init_ _.py", line 74, in main dispatch( restricted= restricted_ mode) reactive/ bus.py" , line 390, in dispatch other_handlers) reactive/ bus.py" , line 359, in _invoke invoke( ) reactive/ bus.py" , line 181, in invoke _action( *args) juju/agents/ unit-dex- auth-0/ charm/reactive/ dex_auth. py", line 60, in start_charm client_ info = endpoint_ from_name( 'oidc-client' ).get_config( ) juju/agents/ unit-dex- auth-0/ charm/hooks/ relations/ oidc-client/ requires. py", line 13, in get_config juju/agents/ unit-dex- auth-0/ charm/hooks/ relations/ oidc-client/ requires. py", line 14, in <listcomp> loads(unit. received_ raw["client_ info"]) python3. 8/json/ __init_ _.py", line 341, in loads
Traceback (most recent call last):
File "lib/charms/
bus.
File "lib/charms/
_invoke(
File "lib/charms/
handler.
File "lib/charms/
self.
File "/var/lib/
oidc_
File "/var/lib/
return [
File "/var/lib/
json.
File "/usr/lib/
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not NoneType