{"record":{"id":"95967f1f3ad7a559","repo":"pentaho/pentaho-kettle","slug":"this-slave-server-is-still-in-use-by-one-or-more","errorCode":null,"errorMessage":"This slave server is still in use by one or more transformations ({transCount}) or cluster schemas ({clusterCount}) :","messagePattern":"This slave server is still in use by one or more transformations \\((.+?)\\) or cluster schemas \\((.+?)\\) :","errorType":"exception","errorClass":"KettleDependencyException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/repository/kdr/KettleDatabaseRepository.java","lineNumber":1450,"sourceCode":"    } else {\n      StringBuilder message = new StringBuilder( 100 );\n\n      if ( transList.length > 0 ) {\n        message.append( \"Slave 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      if ( clustList.length > 0 ) {\n        message.append( \"Slave used by the following cluster schemas:\" ).append( Const.CR );\n        for ( int i = 0; i < clustList.length; i++ ) {\n          message.append( \"  \" ).append( clustList[i] ).append( Const.CR );\n        }\n      }\n\n      KettleDependencyException e = new KettleDependencyException( message.toString() );\n      throw new KettleDependencyException( \"This slave server is still in use by one or more transformations (\"\n        + transList.length + \") or cluster schemas (\" + clustList.length + \") :\", e );\n    }\n  }\n\n  public synchronized void deletePartitionSchema( ObjectId id_partition_schema ) throws KettleException {\n    partitionSchemaDelegate.delPartitionSchema( id_partition_schema );\n    commit();\n  }\n\n  public synchronized void deleteClusterSchema( ObjectId id_cluster ) throws KettleException {\n    clusterSchemaDelegate.delClusterSchema( id_cluster );\n    commit();\n  }\n\n  public synchronized void deleteTransformation( ObjectId id_transformation ) throws KettleException {\n    delTransNotes( id_transformation );\n    delStepAttributes( id_transformation );\n    delSteps( id_transformation );","sourceCodeStart":1432,"sourceCodeEnd":1468,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/repository/kdr/KettleDatabaseRepository.java#L1432-L1468","documentation":"Before deleting a slave server, KettleDatabaseRepository checks whether transformations or cluster schemas still reference it; if so it builds a message listing the dependents and throws a KettleDependencyException. This enforces referential integrity in the database repository so no dangling slave references are left behind.","triggerScenarios":"Calling deleteSlaveServer(id) while r_slave/cluster tables still contain rows referencing the slave server (used by transformations or cluster schemas).","commonSituations":"Retiring a slave from a clustered Pentaho setup that is still referenced by cluster schemas; cleanup scripts deleting shared objects in the wrong order.","solutions":["Delete or update the referencing cluster schemas and transformations first, then delete the slave server.","Reassign the transformations' slave references to another slave or remove the slave from cluster definitions in Spoon.","Read the exception's dependent-name lists from the message to find exactly which objects to fix.","If the references are stale, clean up the repository tables (R_SLAVE, cluster/transform link tables) carefully with a backup."],"exampleFix":"// before\nrepo.deleteSlaveServer(slaveId); // still referenced\n// after\nfor (ClusterSchema cs : repo.getClusterSchemas()) {\n  cs.getSlaveServers().removeIf(s -> s.getObjectId().equals(slaveId));\n  repo.save(cs, \"remove slave\", null, true);\n}\nrepo.deleteSlaveServer(slaveId);","handlingStrategy":"try-catch","validationCode":"boolean inUse = repo.getClusterSchemaIDs(slave.getObjectId()).length > 0; // and check transformations\nif (inUse) { throw new IllegalStateException(\"Slave server still referenced; remove references first\"); }","typeGuard":null,"tryCatchPattern":"try {\n  repo.deleteSlaveServer(slaveId);\n} catch (KettleDependencyException e) {\n  // parse dependent names from message, clean up cluster schemas/transformations, then retry\n}","preventionTips":["Remove the slave from all cluster schemas and transformations before deleting it.","Run dependency lookups (cluster schemas referencing the slave) prior to deletion.","Order repository cleanup: dependents first, shared objects last."],"tags":["repository","referential-integrity","slave-server"],"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"}