pentaho/pentaho-kettle · error · KettleDependencyException

This cluster schema is still in use by one or more…

Error message

This cluster schema is still in use by one or more transformations ({transCount}) :

What it means

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.

Solutions

  1. List referencing transformations via repository.getTransformationNames / dependent lookups and update or delete them first
  2. Re-point transformations to a different cluster schema before deleting this one
  3. Catch KettleDependencyException, parse the transformation list from the message, and inform the administrator which objects block deletion
  4. Force cleanup by removing references in the repository tables if the transformations are already gone

Example fix

// before
repository.deleteClusterSchema(clusterSchemaId); // throws if in use

// after
try {
  repository.deleteClusterSchema(clusterSchemaId);
} catch (KettleDependencyException e) {
  log.warn("Cluster schema still referenced by transformations; not deleted.");
}
Defensive patterns

Strategy: validation

Validate before calling

String[] users = repository.getClusterSchemaTransformations(id); if (users != null && users.length > 0) { throw new IllegalStateException("Cluster schema in use by: " + Arrays.toString(users)); }

Type guard

boolean deletable = repository.getClusterSchemaTransformations(id) == null || repository.getClusterSchemaTransformations(id).length == 0;

Try / catch

try { repository.deleteClusterSchema(id); } catch (KettleDependencyException e) { /* enumerate referencing transformations from message and warn */ }

Prevention

When it happens

Trigger: repository.deleteClusterSchema(id) while r_cluster_schema_trans references exist for that id, i.e. transList.length > 0.

Common situations: Cleaning up old cluster schemas in a shared repository where running or historical transformations still point at them; scripted cleanup scripts deleting blindly.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/7e6b59a2ae085a3a. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/repository/kdr/delegates/KettleDatabaseRepositoryClusterSchemaDelegate.java:243

    //
    // We look in table R_TRANS_CLUSTER to see if there are any transformations using this schema.
    String[] transList = repository.getTransformationsUsingCluster( id_cluster );

    if ( transList.length == 0 ) {
      repository.connectionDelegate.performDelete( "DELETE FROM "
        + quoteTable( KettleDatabaseRepository.TABLE_R_CLUSTER ) + " WHERE "
        + quote( KettleDatabaseRepository.FIELD_CLUSTER_ID_CLUSTER ) + " = ? ", id_cluster );
    } else {
      StringBuilder message = new StringBuilder();

      message.append( "The cluster schema is used by the following transformations:" ).append( Const.CR );
      for ( int i = 0; i < transList.length; i++ ) {
        message.append( "  " ).append( transList[i] ).append( Const.CR );
      }
      message.append( Const.CR );

      KettleDependencyException e = new KettleDependencyException( message.toString() );
      throw new KettleDependencyException( "This cluster schema is still in use by one or more transformations ("
        + transList.length + ") :", e );
    }
  }

  public synchronized void renameClusterSchema( ObjectId id_cluster, String new_name ) throws KettleException {

  }

}

View on GitHub (pinned to f3058517a1)