pentaho/pentaho-kettle · error · KettleException

Unable to save step information to the repository for…

Error message

Unable to save step information to the repository for id_step=" + id_step

What it means

RandomValueMeta.saveRep wraps exceptions raised while persisting the step's field list (field_name / field_type per row index) to the repository into a KettleException. The step configuration could not be saved; the cause is chained.

Solutions

  1. Inspect the chained cause for the real repository error
  2. Validate fieldType values are in range before saving (functions[fieldType[i]] must exist)
  3. Reconnect to the repository and retry the save
  4. Check repository user write privileges on r_step_attribute

Example fix

// before
meta.saveRep(repository, metastore, transId, stepId);
// after
if (meta.getFieldType() != null) {
  for (int t : meta.getFieldType()) {
    if (t < 0 || t >= RandomValueMeta.functions.length) {
      throw new KettleException("Invalid fieldType index: " + t);
    }
  }
}
meta.saveRep(repository, metastore, transId, stepId);
Defensive patterns

Strategy: validation

Validate before calling

if (meta.getFieldType() != null) {
  for (int t : meta.getFieldType()) {
    if (t < 0 || t >= RandomValueMeta.functions.length) throw new KettleException("fieldType index out of range: " + t);
  }
}

Try / catch

try { meta.saveRep(rep, metaStore, transId, stepId); } catch (KettleException e) { logError("RandomValue repository save failed: " + e.getCause()); throw e; }

Prevention

When it happens

Trigger: saveRep() called during transformation save when Repository.saveStepAttribute throws — DB connection failure, read-only repository, constraint violation on r_step_attribute, or fieldType index out of bounds when reading functions[fieldType[i]].

Common situations: Saving over a flaky VPN database connection; repository account without write privileges; metadata migrated between Pentaho versions where the fieldType enum index no longer matches functions[].

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/randomvalue/RandomValueMeta.java:285

      for ( int i = 0; i < nrfields; i++ ) {
        fieldName[i] = rep.getStepAttributeString( id_step, i, "field_name" );
        fieldType[i] = getType( rep.getStepAttributeString( id_step, i, "field_type" ) );
      }
    } catch ( Exception e ) {
      throw new KettleException( "Unexpected error reading step information from the repository", e );
    }
  }

  @Override
  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {
    try {
      for ( int i = 0; i < fieldName.length; i++ ) {
        rep.saveStepAttribute( id_transformation, id_step, i, "field_name", fieldName[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_type", functions[fieldType[i]] != null
          ? functions[fieldType[i]].getCode() : "" );
      }
    } catch ( Exception e ) {
      throw new KettleException( "Unable to save step information to the repository for id_step=" + id_step, e );
    }

  }

  @Override
  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,
    RowMetaInterface prev, String[] input, String[] output, RowMetaInterface info, VariableSpace space,
    Repository repository, IMetaStore metaStore ) {
    // See if we have input streams leading to this step!
    int nrRemarks = remarks.size();
    for ( int i = 0; i < fieldName.length; i++ ) {
      if ( fieldType[i] <= TYPE_RANDOM_NONE ) {
        CheckResult cr =
          new CheckResult( CheckResultInterface.TYPE_RESULT_ERROR, BaseMessages.getString(
            PKG, "RandomValueMeta.CheckResult.FieldHasNoType", fieldName[i] ), stepMeta );
        remarks.add( cr );
      }
    }

View on GitHub (pinned to f3058517a1)