From f130cf103d508a5fc00fae351c09acfa93bbf281 Mon Sep 17 00:00:00 2001 From: Serge Smertin Date: Wed, 30 Oct 2024 16:52:53 +0100 Subject: [PATCH] Fixed `UnknownHostException` on the specified KeyVault Fix #3090 --- src/databricks/labs/ucx/assessment/secrets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/databricks/labs/ucx/assessment/secrets.py b/src/databricks/labs/ucx/assessment/secrets.py index 2eb3c0143f..6d2eab415e 100644 --- a/src/databricks/labs/ucx/assessment/secrets.py +++ b/src/databricks/labs/ucx/assessment/secrets.py @@ -3,7 +3,7 @@ import re from databricks.sdk import WorkspaceClient -from databricks.sdk.errors import NotFound +from databricks.sdk.errors import NotFound, InvalidState logger = logging.getLogger(__name__) @@ -24,6 +24,10 @@ def _get_secret_if_exists(self, secret_scope, secret_key) -> str | None: except NotFound: logger.warning(f'removed on the backend: {secret_scope}/{secret_key}') return None + except InvalidState as e: + # see https://github.com/databrickslabs/ucx/issues/3090 + logger.warning(f'Invalid Azure Key Vault for {secret_scope}/{secret_key}: {e}') + return None except UnicodeDecodeError: logger.warning( f"Secret {secret_scope}/{secret_key} has Base64 bytes that cannot be decoded to utf-8 string."