diff --git a/src/lib/charm/vault.py b/src/lib/charm/vault.py index 6be32b2..90f36ed 100644 --- a/src/lib/charm/vault.py +++ b/src/lib/charm/vault.py @@ -236,6 +236,8 @@ def get_client(url=None): @tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60), stop=tenacity.stop_after_attempt(8), + retry=tenacity.retry_if_exception_type( + hvac.exceptions.InternalServerError), reraise=True) def get_local_client(): """Provide a client for talking to the vault api diff --git a/src/reactive/vault_handlers.py b/src/reactive/vault_handlers.py index 155f318..edefd06 100644 --- a/src/reactive/vault_handlers.py +++ b/src/reactive/vault_handlers.py @@ -727,7 +727,8 @@ def client_approle_authorized(): vault.get_local_client() return True except (vault.hvac.exceptions.InternalServerError, - vault.VaultNotReady): + vault.VaultNotReady, + vault.hvac.exceptions.VaultDown): log("InternalServerError: Unable to athorize approle. " "This may indicate failure to communicate with the database ", "WARNING")