From d82e4782c2bc5ae58dd3a4650671a39b79f0da68 Mon Sep 17 00:00:00 2001 From: Aseem Bansal Date: Mon, 16 Sep 2024 22:45:53 +0530 Subject: [PATCH] fix(ingest/nifi): add error handling for version (#11385) --- metadata-ingestion/src/datahub/ingestion/source/nifi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/metadata-ingestion/src/datahub/ingestion/source/nifi.py b/metadata-ingestion/src/datahub/ingestion/source/nifi.py index 1ad55407e2750..52dce3a8b7599 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/nifi.py +++ b/metadata-ingestion/src/datahub/ingestion/source/nifi.py @@ -638,7 +638,12 @@ def create_nifi_flow(self): ) nifi_version: Optional[str] = None if about_response.ok: - nifi_version = about_response.json().get("about", {}).get("version") + try: + nifi_version = about_response.json().get("about", {}).get("version") + except Exception as e: + logger.error( + f"Unable to parse about response from Nifi: {about_response} due to {e}" + ) else: logger.warning("Failed to fetch version for nifi") cluster_response = self.session.get(