diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/exception/CatalogExceptionMessage.java b/openmetadata-service/src/main/java/org/openmetadata/service/exception/CatalogExceptionMessage.java index ea2792f346c..e3994394ffb 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/exception/CatalogExceptionMessage.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/exception/CatalogExceptionMessage.java @@ -268,6 +268,10 @@ public final class CatalogExceptionMessage { return String.format("System entity [%s] of type %s can not be renamed.", name, entityType); } + public static String systemEntityModifyNotAllowed(String name, String entityType) { + return String.format("System entity [%s] of type %s can not be modified.", name, entityType); + } + public static String mutuallyExclusiveLabels(TagLabel tag1, TagLabel tag2) { return String.format( "Tag labels %s and %s are mutually exclusive and can't be assigned together", diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java b/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java index f0d4e9d72da..2a29055de96 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/resources/apps/AppResource.java @@ -597,6 +597,10 @@ public class AppResource extends EntityResource { JsonPatch patch) throws SchedulerException { App app = repository.get(null, id, repository.getFields("bot,pipelines")); + if (app.getSystemApp()) { + throw new IllegalArgumentException( + CatalogExceptionMessage.systemEntityModifyNotAllowed(app.getName(), "SystemApp")); + } AppScheduler.getInstance().deleteScheduledApplication(app); Response response = patchInternal(uriInfo, securityContext, id, patch); App updatedApp = (App) response.getEntity();