{"record":{"id":"4095c2cdbd71e76c","repo":"pentaho/pentaho-kettle","slug":"rowsfromresultmeta-exception","errorCode":null,"errorMessage":"RowsFromResultMeta.Exception.ErrorReadingStepInfoFromRepository","messagePattern":"RowsFromResultMeta\\.Exception\\.ErrorReadingStepInfoFromRepository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/rowsfromresult/RowsFromResultMeta.java","lineNumber":193,"sourceCode":"  }\n\n  public void setDefault() {\n    allocate( 0 );\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      int nrfields = rep.countNrStepAttributes( id_step, \"field_name\" );\n      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        fieldname[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        type[i] = ValueMetaFactory.getIdForValueMeta( rep.getStepAttributeString( id_step, i, \"field_type\" ) );\n        length[i] = (int) rep.getStepAttributeInteger( id_step, i, \"field_length\" );\n        precision[i] = (int) rep.getStepAttributeInteger( id_step, i, \"field_precision\" );\n      }\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 );","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/rowsfromresult/RowsFromResultMeta.java#L175-L211","documentation":"KettleException thrown by RowsFromResultMeta.readRep when reading per-field step attributes (field_name, field_type, field_length, field_precision) from the repository fails. Message comes from the localized bundle RowsFromResultMeta.Exception.ErrorReadingStepInfoFromRepository and wraps the underlying cause.","triggerScenarios":"readRep runs while loading a 'Get rows from result' step from a repository and rep.getStepAttributeString/Integer or ValueMetaFactory.getIdForValueMeta throws, including an unknown field_type name string that ValueMetaFactory cannot resolve.","commonSituations":"Repository rows edited manually so field_type holds a non-existent value type name; repository schema mismatch after Kettle upgrade; repository connection failure while iterating nrFields rows.","solutions":["Read the wrapped cause; if it is a ValueMetaFactory error, fix the field_type attribute value in R_STEP_ATTRIBUTE to a valid value meta name.","Check repository connectivity and retry loading the transformation.","Verify the attribute rows for this id_step (attribute codes field_name/field_type/field_length/field_precision) are intact and consistently numbered.","Re-create the step in Spoon and re-save to rebuild its repository attributes."],"exampleFix":"// before: hand-inserted repository row with bad type\nUPDATE R_STEP_ATTRIBUTE SET VALUE_STR='STRNG' WHERE CODE='field_type';\n// after: use a valid ValueMeta name\nUPDATE R_STEP_ATTRIBUTE SET VALUE_STR='String' WHERE CODE='field_type';","handlingStrategy":"try-catch","validationCode":"// Validate repository attribute rows before relying on readRep\nString type = repository.getStepAttributeString(idStep, 0, \"field_type\");\nif (type != null && ValueMetaFactory.getIdForValueMeta(type) < 0) {\n  throw new IllegalStateException(\"Invalid field_type in repository: \" + type);\n}","typeGuard":"boolean hasFields = false;\nfor (int i = 0; repository.getStepAttributeString(idStep, i, \"field_name\") != null; i++) hasFields = true;\nif (!hasFields) log.warn(\"No field rows found for id_step \" + idStep);","tryCatchPattern":"try {\n  meta.readRep(repository, metaStore, idStep, databases);\n} catch (KettleException e) {\n  log.error(\"Error reading RowsFromResult attributes: {}\", e.getCause(), e);\n  meta.setDefault(); // fall back to defaults instead of aborting\n}","preventionTips":["Do not edit R_STEP_ATTRIBUTE rows by hand; field_type must be a valid value meta name.","Test repository loads after every Kettle upgrade.","Keep field type names consistent with ValueMetaFactory names.","Preview the step in Spoon to catch metadata issues before runtime."],"tags":["kettle","repository","metadata","value-types"],"backgroundTag":"database-query-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"}