{"record":{"id":"7e6b59a2ae085a3a","repo":"pentaho/pentaho-kettle","slug":"this-cluster-schema-is-still-in-use-by-one-or-more","errorCode":null,"errorMessage":"This cluster schema is still in use by one or more transformations ({transCount}) :","messagePattern":"This cluster schema is still in use by one or more transformations \\((.+?)\\) :","errorType":"exception","errorClass":"KettleDependencyException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryClusterSchemaDelegate.java","lineNumber":243,"sourceCode":"    //\n    // We look in table R_TRANS_CLUSTER to see if there are any transformations using this schema.\n    String[] transList = repository.getTransformationsUsingCluster( id_cluster );\n\n    if ( transList.length == 0 ) {\n      repository.connectionDelegate.performDelete( \"DELETE FROM \"\n        + quoteTable( KettleDatabaseRepository.TABLE_R_CLUSTER ) + \" WHERE \"\n        + quote( KettleDatabaseRepository.FIELD_CLUSTER_ID_CLUSTER ) + \" = ? \", id_cluster );\n    } else {\n      StringBuilder message = new StringBuilder();\n\n      message.append( \"The cluster schema is used by the following transformations:\" ).append( Const.CR );\n      for ( int i = 0; i < transList.length; i++ ) {\n        message.append( \"  \" ).append( transList[i] ).append( Const.CR );\n      }\n      message.append( Const.CR );\n\n      KettleDependencyException e = new KettleDependencyException( message.toString() );\n      throw new KettleDependencyException( \"This cluster schema is still in use by one or more transformations (\"\n        + transList.length + \") :\", e );\n    }\n  }\n\n  public synchronized void renameClusterSchema( ObjectId id_cluster, String new_name ) throws KettleException {\n\n  }\n\n}\n","sourceCodeStart":225,"sourceCodeEnd":253,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryClusterSchemaDelegate.java#L225-L253","documentation":"KettleDependencyException thrown by delClusterSchema when attempting to delete a cluster schema that is still referenced by one or more transformations. The delegate queries the transformation list referencing the schema id and, if non-empty, builds a message enumerating them and throws with a chained KettleDependencyException. Deletion is refused to avoid breaking dependent transformations.","triggerScenarios":"repository.deleteClusterSchema(id) while r_cluster_schema_trans references exist for that id, i.e. transList.length > 0.","commonSituations":"Cleaning up old cluster schemas in a shared repository where running or historical transformations still point at them; scripted cleanup scripts deleting blindly.","solutions":["List referencing transformations via repository.getTransformationNames / dependent lookups and update or delete them first","Re-point transformations to a different cluster schema before deleting this one","Catch KettleDependencyException, parse the transformation list from the message, and inform the administrator which objects block deletion","Force cleanup by removing references in the repository tables if the transformations are already gone"],"exampleFix":"// before\nrepository.deleteClusterSchema(clusterSchemaId); // throws if in use\n\n// after\ntry {\n  repository.deleteClusterSchema(clusterSchemaId);\n} catch (KettleDependencyException e) {\n  log.warn(\"Cluster schema still referenced by transformations; not deleted.\");\n}","handlingStrategy":"validation","validationCode":"String[] users = repository.getClusterSchemaTransformations(id); if (users != null && users.length > 0) { throw new IllegalStateException(\"Cluster schema in use by: \" + Arrays.toString(users)); }","typeGuard":"boolean deletable = repository.getClusterSchemaTransformations(id) == null || repository.getClusterSchemaTransformations(id).length == 0;","tryCatchPattern":"try { repository.deleteClusterSchema(id); } catch (KettleDependencyException e) { /* enumerate referencing transformations from message and warn */ }","preventionTips":["Check dependents before deleting shared repository objects","Maintain an inventory of transformations per cluster schema","Never run blind bulk-delete scripts on repository tables","Catch KettleDependencyException in cleanup tooling and log the referenced list"],"tags":["repository","cluster-schema","referential-integrity"],"backgroundTag":"invalid-state-transition","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}