{"record":{"id":"7be63fca5af965bf","repo":"pentaho/pentaho-kettle","slug":"rowsfromresultmeta-exception-7be63f","errorCode":null,"errorMessage":"RowsFromResultMeta.Exception.UnableToSaveStepInfoToRepository","messagePattern":"RowsFromResultMeta\\.Exception\\.UnableToSaveStepInfoToRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/rowsfromresult/RowsFromResultMeta.java","lineNumber":209,"sourceCode":"      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"RowsFromResultMeta.Exception.ErrorReadingStepInfoFromRepository\" ), e );\n    }\n\n  }\n\n  public void saveRep( Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step ) throws KettleException {\n    try {\n      for ( int i = 0; i < fieldname.length; i++ ) {\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_name\", fieldname[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_type\",\n          ValueMetaFactory.getValueMetaName( type[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_length\", length[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"field_precision\", precision[i] );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"RowsFromResultMeta.Exception.UnableToSaveStepInfoToRepository\" )\n        + id_step, e );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface r, String origin, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    for ( int i = 0; i < this.fieldname.length; i++ ) {\n      ValueMetaInterface v;\n      try {\n        v = ValueMetaFactory.createValueMeta( fieldname[i], type[i], length[i], precision[i] );\n        v.setOrigin( origin );\n        r.addValueMeta( v );\n      } catch ( KettlePluginException e ) {\n        throw new KettleStepException( e );\n      }\n    }","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/rowsfromresult/RowsFromResultMeta.java#L191-L227","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Inspect the wrapped cause; for a value-type conversion failure, verify the step's field types are valid ValueMeta types before saving.","Check repository DB connectivity, write privileges, and free space, then re-save.","Compare the failing id_step's existing rows in R_STEP_ATTRIBUTE for constraint conflicts and clean them up.","If metadata is corrupt, delete and re-add the step in Spoon, then save."],"exampleFix":"// before: field type set to an invalid id\nmeta.setFieldType(new int[] { 9999 });\n// after: use a valid ValueMetaFactory type\nmeta.setFieldType(new int[] { ValueMetaFactory.getIdForValueMeta(\"String\") });","handlingStrategy":"try-catch","validationCode":"// Ensure all value types are valid before saving\nfor (int t : meta.getFieldType()) {\n  if (t < 0) throw new IllegalStateException(\"Invalid value type id: \" + t);\n}","typeGuard":"if (meta.getFieldName() == null || meta.getFieldName().length != meta.getFieldType().length) {\n  throw new IllegalStateException(\"Field name/type arrays out of sync\");\n}","tryCatchPattern":"try {\n  meta.saveRep(repository, metaStore, idTransformation, idStep);\n} catch (KettleException e) {\n  log.error(\"Error saving RowsFromResult attributes for id_step={}: {}\", idStep, e.getCause(), e);\n  // export XML backup so work is not lost\n}","preventionTips":["Validate step metadata (array lengths, value type ids) before save.","Ensure the repository DB has free space and write privileges.","Save over a stable network connection; retry on transient JDBC errors.","Keep plugin-updated metadata within valid ValueMeta ranges."],"tags":["kettle","repository","metadata","persistence"],"backgroundTag":"database-write-failed","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"}