{"record":{"id":"e86ec62242a6b69e","repo":"pentaho/pentaho-kettle","slug":"getsequence-exception-couldnotfindnextvalueforsequence","errorCode":null,"errorMessage":"GetSequence.Exception.CouldNotFindNextValueForSequence","messagePattern":"GetSequence\\.Exception\\.CouldNotFindNextValueForSequence","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/getslavesequence/GetSlaveSequence.java","lineNumber":71,"sourceCode":"    if ( data.value >= ( data.startValue + data.increment ) ) {\n      // Get a new value from the service...\n      //\n      data.startValue = data.slaveServer.getNextSlaveSequenceValue( data.sequenceName, data.increment );\n      data.value = data.startValue;\n    }\n\n    next = Long.valueOf( data.value );\n    data.value++;\n\n    if ( next != null ) {\n      Object[] outputRowData = inputRowData;\n      if ( inputRowData.length < inputRowMeta.size() + 1 ) {\n        outputRowData = RowDataUtil.resizeArray( inputRowData, inputRowMeta.size() + 1 );\n      }\n      outputRowData[inputRowMeta.size()] = next;\n      return outputRowData;\n    } else {\n      throw new KettleStepException( BaseMessages.getString(\n        PKG, \"GetSequence.Exception.CouldNotFindNextValueForSequence\" )\n        + meta.getValuename() );\n    }\n  }\n\n  public boolean processRow( StepMetaInterface smi, StepDataInterface sdi ) throws KettleException {\n    meta = (GetSlaveSequenceMeta) smi;\n    data = (GetSlaveSequenceData) sdi;\n\n    Object[] r = getRow(); // Get row from input rowset & set row busy!\n    if ( r == null ) { // no more input to be expected...\n\n      setOutputDone();\n      return false;\n    }\n\n    if ( first ) {\n      first = false;","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/getslavesequence/GetSlaveSequence.java#L53-L89","documentation":"GetSlaveSequence.addSequence throws KettleStepException with 'CouldNotFindNextValueForSequence' when it cannot obtain the next value from the slave server's named sequence. The step asks a remote slave server for the next sequence value; if the slave server is unknown, unreachable, or the sequence name is missing/invalid, no value can be produced and the step aborts the row. The target field name is appended to the message for diagnostics.","triggerScenarios":"processRow -> addSequence calls meta.getSlaveServerName()/sequence lookup and the returned next value is null/unavailable; slave server not defined in the cluster run configuration; sequence name does not exist on the slave.","commonSituations":"Running a clustered transformation where the slave server was removed or renamed; typo in the sequence name; slave's sequence service not running; using the step in a non-clustered run where no slave is available.","solutions":["Verify the slave server named in the step exists and is reachable (Tools > Slave servers / cluster schema).","Confirm the sequence name is created/registered on the slave server.","Check the increment value configured in the step is a positive number.","Run the transformation on the master with the cluster enabled so the slave dispatcher is initialized."],"exampleFix":"// before: step references stale slave\nslaveServerName = \"old-slave\"; // removed from config\n// after: point to a defined, reachable slave\nslaveServerName = \"slave-1\"; // exists in cluster schema","handlingStrategy":"validation","validationCode":"// Before running the transformation, verify slave + sequence config\nGetSlaveSequenceMeta m = (GetSlaveSequenceMeta) stepMeta.getStepMetaInterface();\nif ( m.getSlaveServerName() == null || m.getSlaveServerName().isEmpty() )\n  throw new IllegalStateException( \"Get slave sequence step has no slave server configured\" );\nif ( m.getSequenceName() == null || m.getSequenceName().isEmpty() )\n  throw new IllegalStateException( \"Get slave sequence step has no sequence name configured\" );","typeGuard":null,"tryCatchPattern":"try {\n  trans.execute( null );\n} catch ( KettleException e ) {\n  if ( e.getMessage() != null && e.getMessage().contains( \"CouldNotFindNextValueForSequence\" ) ) {\n    // check slave server availability and sequence existence, then re-run\n  } else throw e;\n}","preventionTips":["Define all slave servers in the cluster schema and health-check them before runs","Create the named sequence on every slave before deploying the transformation","Keep sequence names in variables/parameters validated at job level","Test clustered transformations with a single row before production runs"],"tags":["kettle","pdi","cluster","sequence"],"backgroundTag":"resource-not-found","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"}