{"record":{"id":"4d4de8ec7793b252","repo":"pentaho/pentaho-kettle","slug":"unexpected-error-reading-step-information-from-the-4d4de8","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/stepmeta/StepMetastructureMeta.java","lineNumber":97,"sourceCode":"  }\n\n  private void readData( Node stepnode ) throws KettleXMLException {\n    try {\n      outputRowcount = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"outputRowcount\" ) );\n      rowcountField = XMLHandler.getTagValue( stepnode, \"rowcountField\" );\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to load step info from XML\", e );\n    }\n  }\n\n  @Override\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      outputRowcount = rep.getStepAttributeBoolean( id_step, \"outputRowcount\" );\n      rowcountField = rep.getStepAttributeString( id_step, \"rowcountField\" );\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      rep.saveStepAttribute( id_transformation, id_step, \"outputRowcount\", outputRowcount );\n      rep.saveStepAttribute( id_transformation, id_step, \"rowcountField\", rowcountField );\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  @Override\n  public StepInterface getStep( StepMeta stepMeta, StepDataInterface stepDataInterface, int cnr, TransMeta tr,\n    Trans trans ) {\n    return new StepMetastructure( stepMeta, stepDataInterface, cnr, tr, trans );","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/stepmeta/StepMetastructureMeta.java#L79-L115","documentation":"StepMetastructureMeta.readRep wraps any exception thrown while loading this step's saved attributes (outputRowcount, rowcountField) from the Kettle repository in a KettleException with this generic message. It is a catch-all around repository I/O, so the root cause is always in the attached cause. The library throws it to signal that transformation metadata for this step could not be deserialized from the repository.","triggerScenarios":"Any Exception from rep.getStepAttributeBoolean(id_step, \"outputRowcount\") or rep.getStepAttributeString(id_step, \"rowcountField\") during readRep — e.g. repository connection dropped mid-read, id_step no longer exists in r_step_attribute, or the repository is a database repository whose tables are locked/corrupt.","commonSituations":"Opening or editing a transformation stored in a database repository while the repository DB is unreachable or restarted; a stale id_step after someone deleted/re-imported the transformation; repository table corruption or permission problems.","solutions":["Inspect the cause (e.getCause()) of the KettleException — fix the underlying repository connectivity/SQL error first.","Verify the repository connection (host, port, credentials) and that the repository database is up.","Re-open the transformation; if the step attributes are missing, re-save the step or re-create it in Spoon.","Check repository table integrity (r_step_attribute) and user permissions if errors persist."],"exampleFix":"// before: opaque failure, cause ignored\n} catch ( Exception e ) {\n  throw new KettleException( \"Unexpected error reading step information from the repository\", e );\n}\n// after: log cause and fail with a clear step/ID context\n} catch ( Exception e ) {\n  logError(\"Failed to read StepMetastructure attributes for id_step=\" + id_step, e);\n  throw new KettleException( \"Unexpected error reading step information from the repository for id_step=\" + id_step, e );\n}","handlingStrategy":"try-catch","validationCode":"// before loadRep/readRep, verify repository connectivity\nif (rep == null || !rep.getConnection().equals(expectedConnection)) {\n  throw new KettleException(\"Repository not connected before reading step metadata\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  stepMeta.readRep(rep, metaStore, idStep, databases);\n} catch (KettleException e) {\n  Throwable root = e; while (root.getCause() != null) root = root.getCause();\n  log.error(\"Repository read failed for id_step=\" + idStep + \": \" + root.getMessage(), root);\n  throw e;\n}","preventionTips":["Check repository connectivity before loading transformations.","Always log/diagnose the cause chain of KettleException from readRep.","Use file repositories or version-controlled XML for critical metadata to avoid DB-side issues."],"tags":["repository","metadata-read","kettle"],"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"}