{"record":{"id":"22c3e1b06187a786","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-reading-step-information-from-the-22c3e1","errorCode":null,"errorMessage":"Unexpected error reading step information from the repository","messagePattern":"Unexpected error reading step information from the repository","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/randomvalue/RandomValueMeta.java","lineNumber":272,"sourceCode":"    }\n    retval.append( \"    </fields>\" + Const.CR );\n\n    return retval.toString();\n  }\n\n  @Override\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\n      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        fieldName[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        fieldType[i] = getType( rep.getStepAttributeString( id_step, i, \"field_type\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unexpected error reading step information from the repository\", e );\n    }\n  }\n\n  @Override\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\", functions[fieldType[i]] != null\n          ? functions[fieldType[i]].getCode() : \"\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleException( \"Unable to save step information to the repository for id_step=\" + id_step, e );\n    }\n\n  }\n\n  @Override","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/randomvalue/RandomValueMeta.java#L254-L290","documentation":"RandomValueMeta.readRep wraps exceptions raised while loading the Random Value step's fields from the repository into a generic KettleException. It indicates the step metadata (field_name / field_type attributes per field index) could not be read from r_step_attribute.","triggerScenarios":"readRep() invoked when Repository.getStepAttributeString throws for the per-field loop (bad id_step, repository connection lost, corrupted attribute rows) or nrfields resolves to a bad value.","commonSituations":"Corrupted r_step_attribute rows after a failed save; DB repository connection dropped mid-load; opening a transformation stored under an older repository schema.","solutions":["Check the chained cause for the underlying repository error","Reconnect to the repository and retry loading","Verify nrfields attribute and the indexed field_name/field_type rows exist and are intact","Re-save the step in Spoon to rewrite its attributes"],"exampleFix":"// before\nmeta.readRep(repository, metastore, stepId, databases);\n// after\ntry {\n  meta.readRep(repository, metastore, stepId, databases);\n} catch (KettleException e) {\n  logError(\"Failed reading RandomValue step: \" + (e.getCause() != null ? e.getCause().getMessage() : \"\"));\n  throw new KettleException(\"Repository unreadable — reconnect and retry\", e);\n}","handlingStrategy":"try-catch","validationCode":"if (rep == null || idStep == null) throw new KettleException(\"Repository and id_step are required for readRep\");","typeGuard":null,"tryCatchPattern":"try { meta.readRep(rep, metaStore, idStep, databases); } catch (KettleException e) { logError(\"RandomValue repository read failed: \" + e.getCause()); throw e; }","preventionTips":["Read the chained cause for the underlying repository error","Audit r_step_attribute rows after interrupted saves","Reconnect and retry on transient DB failures","Re-save steps after repository schema upgrades"],"tags":["kettle","repository","metadata","deserialization"],"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"}