In testrun https://solutions.qa.canonical.com/v2/testruns/3989aa33-ea60-44f6-9742-481a8f290484, which is aws kubernetes on focal, vault fails on the certificates-relation-changed hook. In the vault logs we see:
```
Traceback (most recent call last):
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/charms/reactive/__init__.py", line 74, in main
bus.dispatch(restricted=restricted_mode)
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 390, in dispatch
_invoke(other_handlers)
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 359, in _invoke
handler.invoke()
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/charms/reactive/bus.py", line 181, in invoke
self._action(*args)
File "/var/lib/juju/agents/unit-vault-0/charm/reactive/vault_handlers.py", line 1100, in tune_pki_backend_config_changed
vault_pki.update_roles(max_ttl=max_ttl)
File "/var/lib/juju/agents/unit-vault-0/charm/lib/charm/vault_pki.py", line 339, in update_roles
write_roles(client, **local)
File "/var/lib/juju/agents/unit-vault-0/charm/lib/charm/vault_pki.py", line 314, in write_roles
client.write(
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/hvac/v1/__init__.py", line 189, in write
response = self._adapter.post('/v1/{0}'.format(path), json=kwargs, wrap_ttl=wrap_ttl)
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/hvac/adapters.py", line 103, in post
return self.request('post', url, **kwargs)
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/hvac/adapters.py", line 233, in request
utils.raise_for_error(response.status_code, text, errors=errors)
File "/var/lib/juju/agents/unit-vault-0/.venv/lib/python3.8/site-packages/hvac/utils.py", line 39, in raise_for_error
raise exceptions.InternalServerError(message, errors=errors)
hvac.exceptions.InternalServerError: 1 error occurred:
* invalid connection
```
I can't track down why this is happening. The crashdump doesn't show any additional information that I can find at first glance.
Crashdumps and configs can be found here:
https://oil-jenkins.canonical.com/artifacts/3989aa33-ea60-44f6-9742-481a8f290484/index.html
Seeing another fail in https:/ /solutions. qa.canonical. com/v2/ testruns/ fb1016df- 2473-40da- b897-e40a382ec8 7d.
And vault logs shows:
unit-vault-1: 06:39:35 INFO unit.vault/ 1.juju- log certificates:64: Get installed key for snap vault 1.certificates- relation- changed Traceback (most recent call last): 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/charm/ hooks/certifica tes-relation- changed" , line 22, in <module> 1.certificates- relation- changed main() 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ charms/ reactive/ __init_ _.py", line 84, in main 1.certificates- relation- changed hookenv. _run_atexit( ) 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ charmhelpers/ core/hookenv. py", line 1357, in _run_atexit 1.certificates- relation- changed callback(*args, **kwargs) 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/charm/ reactive/ vault_handlers. py", line 867, in _assess_status 1.certificates- relation- changed if not client. ha_status[ 'ha_enabled' ]: 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ hvac/v1/ __init_ _.py", line 491, in ha_status 1.certificates- relation- changed return self._adapter. get('/v1/ sys/leader' ).json( ) 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ hvac/adapters. py", line 90, in get 1.certificates- relation- changed return self.request('get', url, **kwargs) 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ hvac/adapters. py", line 233, in request 1.certificates- relation- changed utils.raise_ for_error( response. status_ code, text, errors=errors) 1.certificates- relation- changed File "/var/lib/ juju/agents/ unit-vault- 1/.venv/ lib/python3. 8/site- packages/ hvac/utils. py", line 39, in raise_for_error 1.certificates- relation- changed raise exceptions. InternalServerE rror(message, errors=errors) 1.certificates- relation- changed hvac.exceptions .InternalServer Error: context deadline exceeded uniter. operation hook "certificates- relation- changed" (via explicit, bespoke hook script) failed: exit status 1
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:40 WARNING unit.vault/
unit-vault-1: 06:39:41 ERROR juju.worker.