{"record":{"id":"96d3dcdf3b6e4dbd","repo":"pentaho/pentaho-kettle","slug":"setvariable0005","errorCode":"SETVARIABLE0005","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/setvariable/SetVariableMeta.java","lineNumber":273,"sourceCode":"    return retval.toString();\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\n      allocate( nrfields );\n\n      for ( int i = 0; i < nrfields; i++ ) {\n        fieldName[i] = rep.getStepAttributeString( id_step, i, \"field_name\" );\n        variableName[i] = rep.getStepAttributeString( id_step, i, \"variable_name\" );\n        variableType[i] = getVariableType( rep.getStepAttributeString( id_step, i, \"variable_type\" ) );\n        defaultValue[i] = rep.getStepAttributeString( id_step, i, \"default_value\" );\n      }\n\n      usingFormatting = rep.getStepAttributeBoolean( id_step, 0, \"use_formatting\", false );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"SetVariableMeta.RuntimeError.UnableToReadRepository.SETVARIABLE0005\" ), e );\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\", Utils.isEmpty( fieldName[i] )\n          ? \"\" : fieldName[i] );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"variable_name\", variableName[i] );\n        rep.saveStepAttribute(\n          id_transformation, id_step, i, \"variable_type\", getVariableTypeCode( variableType[i] ) );\n        rep.saveStepAttribute( id_transformation, id_step, i, \"default_value\", defaultValue[i] );\n      }\n\n      rep.saveStepAttribute( id_transformation, id_step, 0, \"use_formatting\", usingFormatting );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(","sourceCodeStart":255,"sourceCodeEnd":291,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/setvariable/SetVariableMeta.java#L255-L291","documentation":"SetVariableMeta.readRep loads the step's configuration from the repository (per-field variable_name, variable_type, default_value rows plus use_formatting). Any exception during these repository reads is wrapped in a KettleException with SETVARIABLE0005, indicating repository step metadata could not be read.","triggerScenarios":"loadRep calls readRep for the step and rep.getStepAttributeString/Boolean throws or the surrounding block fails (e.g. repository connection issue, corrupt r_step_attribute rows, wrong id_step).","commonSituations":"Repository database partially migrated (missing attribute rows); stale id_step after a repository upgrade; network/DB outage mid-load; shared repository accessed with an older PDI client.","solutions":["Verify repository connectivity and retry loading the transformation","Repair the repository (r_step_attribute rows for this id_step) or re-save the step","Upgrade/align the repository schema with the current PDI version (repository upgrade scripts)","Inspect the wrapped cause in the stack trace for the underlying repository exception"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify repository connectivity before load\nif (!rep.connect(null, false)) throw new IllegalStateException(\"repository unreachable\");","typeGuard":null,"tryCatchPattern":"try { loadRep(rep, metaStore, id_step); } catch (KettleException e) { if (e.getMessage().contains(\"SETVARIABLE0005\")) { log(\"Repository read failed: \", e.getCause()); /* retry or load from XML fallback */ } else throw e; }","preventionTips":["Keep repository schema upgraded in step with the PDI client version","Monitor repository DB health","Back up r_step_attribute data before migrations"],"tags":["kettle","pdi","repository","metadata"],"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"}