pentaho/pentaho-kettle · error · KettleException

RowsFromResultMeta.Exception.UnableToSaveStepInfoToRepositor…

Error message

RowsFromResultMeta.Exception.UnableToSaveStepInfoToRepository

What it means

KettleException thrown by RowsFromResultMeta.saveRep when writing the step's field definitions (field_name, field_type, field_length, field_precision per row) to the repository fails. The localized base message is concatenated with id_step and the original exception is attached as the cause.

Solutions

  1. Inspect the wrapped cause; for a value-type conversion failure, verify the step's field types are valid ValueMeta types before saving.
  2. Check repository DB connectivity, write privileges, and free space, then re-save.
  3. Compare the failing id_step's existing rows in R_STEP_ATTRIBUTE for constraint conflicts and clean them up.
  4. If metadata is corrupt, delete and re-add the step in Spoon, then save.

Example fix

// before: field type set to an invalid id
meta.setFieldType(new int[] { 9999 });
// after: use a valid ValueMetaFactory type
meta.setFieldType(new int[] { ValueMetaFactory.getIdForValueMeta("String") });
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure all value types are valid before saving
for (int t : meta.getFieldType()) {
  if (t < 0) throw new IllegalStateException("Invalid value type id: " + t);
}

Type guard

if (meta.getFieldName() == null || meta.getFieldName().length != meta.getFieldType().length) {
  throw new IllegalStateException("Field name/type arrays out of sync");
}

Try / catch

try {
  meta.saveRep(repository, metaStore, idTransformation, idStep);
} catch (KettleException e) {
  log.error("Error saving RowsFromResult attributes for id_step={}: {}", idStep, e.getCause(), e);
  // export XML backup so work is not lost
}

Prevention

When it happens

Trigger: saveRep runs during transformation save and a rep.saveStepAttribute call or ValueMetaFactory.getValueMetaName(type[i]) throws, e.g. repository write error, or an invalid value type id in type[] that cannot be translated to a name.

Common situations: Repository DB read-only or out of space; connection dropped mid-save; step metadata mutated by plugin code to hold an out-of-range value type id; DB constraint violation on R_STEP_ATTRIBUTE.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/rowsfromresult/RowsFromResultMeta.java:209

      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "RowsFromResultMeta.Exception.ErrorReadingStepInfoFromRepository" ), e );
    }

  }

  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",
          ValueMetaFactory.getValueMetaName( type[i] ) );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_length", length[i] );
        rep.saveStepAttribute( id_transformation, id_step, i, "field_precision", precision[i] );
      }
    } catch ( Exception e ) {
      throw new KettleException( BaseMessages.getString(
        PKG, "RowsFromResultMeta.Exception.UnableToSaveStepInfoToRepository" )
        + id_step, e );
    }
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    for ( int i = 0; i < this.fieldname.length; i++ ) {
      ValueMetaInterface v;
      try {
        v = ValueMetaFactory.createValueMeta( fieldname[i], type[i], length[i], precision[i] );
        v.setOrigin( origin );
        r.addValueMeta( v );
      } catch ( KettlePluginException e ) {
        throw new KettleStepException( e );
      }
    }

View on GitHub (pinned to f3058517a1)