From e9186dc5772ba664071472496ffa42bb13bf6052 Mon Sep 17 00:00:00 2001 From: IceS2 Date: Sat, 30 Nov 2024 17:26:49 +0100 Subject: [PATCH] Catch exception that arises due to a change in code. Shouldn't be an issue (#18863) --- .../service/migration/utils/v150/MigrationUtil.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v150/MigrationUtil.java b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v150/MigrationUtil.java index 42666bb2edd..e0996c27b5a 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v150/MigrationUtil.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/migration/utils/v150/MigrationUtil.java @@ -14,6 +14,7 @@ import javax.json.JsonObject; import javax.json.JsonObjectBuilder; import lombok.extern.slf4j.Slf4j; import org.jdbi.v3.core.Handle; +import org.jdbi.v3.core.statement.UnableToExecuteStatementException; import org.openmetadata.schema.dataInsight.custom.DataInsightCustomChart; import org.openmetadata.schema.dataInsight.custom.LineChart; import org.openmetadata.schema.dataInsight.custom.LineChartMetric; @@ -148,6 +149,9 @@ public class MigrationUtil { appRepository.deleteByName("admin", "DataInsightsApplication", true, true); } catch (EntityNotFoundException ex) { LOG.debug("DataInsights Application not found."); + } catch (UnableToExecuteStatementException ex) { + // Note: Due to a change in the code this delete fails on a postDelete step that is not + LOG.debug("[UnableToExecuteStatementException]: {}", ex.getMessage()); } // Update DataInsightsApplication MarketplaceDefinition - It will be recreated on AppStart @@ -158,6 +162,9 @@ public class MigrationUtil { marketPlaceRepository.deleteByName("admin", "DataInsightsApplication", true, true); } catch (EntityNotFoundException ex) { LOG.debug("DataInsights Application Marketplace Definition not found."); + } catch (UnableToExecuteStatementException ex) { + // Note: Due to a change in the code this delete fails on a postDelete step that is not + LOG.debug("[UnableToExecuteStatementException]: {}", ex.getMessage()); } }