{"record":{"id":"228636cb7c9f1ae0","repo":"pentaho/pentaho-kettle","slug":"fileexistsmeta-exception-unexpectederrorreadingstepinfo","errorCode":null,"errorMessage":"FileExistsMeta.Exception.UnexpectedErrorReadingStepInfo","messagePattern":"FileExistsMeta\\.Exception\\.UnexpectedErrorReadingStepInfo","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java","lineNumber":200,"sourceCode":"      resultfieldname = XMLHandler.getTagValue( stepnode, \"resultfieldname\" );\n      includefiletype = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"includefiletype\" ) );\n      filetypefieldname = XMLHandler.getTagValue( stepnode, \"filetypefieldname\" );\n      addresultfilenames = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"addresultfilenames\" ) );\n    } catch ( Exception e ) {\n      throw new KettleXMLException(\n        BaseMessages.getString( PKG, \"FileExistsMeta.Exception.UnableToReadStepInfo\" ), e );\n    }\n  }\n\n  public void readRep( Repository rep, IMetaStore metaStore, ObjectId id_step, List<DatabaseMeta> databases ) throws KettleException {\n    try {\n      filenamefield = rep.getStepAttributeString( id_step, \"filenamefield\" );\n      resultfieldname = rep.getStepAttributeString( id_step, \"resultfieldname\" );\n      includefiletype = rep.getStepAttributeBoolean( id_step, \"includefiletype\" );\n      filetypefieldname = rep.getStepAttributeString( id_step, \"filetypefieldname\" );\n      addresultfilenames = rep.getStepAttributeBoolean( id_step, \"addresultfilenames\" );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString(\n        PKG, \"FileExistsMeta.Exception.UnexpectedErrorReadingStepInfo\" ), e );\n    }\n  }\n\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, \"filenamefield\", filenamefield );\n      rep.saveStepAttribute( id_transformation, id_step, \"resultfieldname\", resultfieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"includefiletype\", includefiletype );\n      rep.saveStepAttribute( id_transformation, id_step, \"filetypefieldname\", filetypefieldname );\n      rep.saveStepAttribute( id_transformation, id_step, \"addresultfilenames\", addresultfilenames );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"FileExistsMeta.Exception.UnableToSaveStepInfo\" )\n        + id_step, e );\n    }\n  }\n\n  public void check( List<CheckResultInterface> remarks, TransMeta transMeta, StepMeta stepMeta,","sourceCodeStart":182,"sourceCodeEnd":218,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java#L182-L218","documentation":"FileExistsMeta.readRep() reads the step's attributes from the Kettle repository (filenamefield, resultfieldname, includefiletype, etc.) and wraps any repository exception in a KettleException with 'UnexpectedErrorReadingStepInfo'. It means the step's stored metadata could not be loaded from the repository database.","triggerScenarios":"Loading a transformation from a repository when the underlying r_step_attribute query fails: DB connection dropped, schema mismatch, corrupted or missing rows for id_step.","commonSituations":"Repository database outage mid-load; repository schema version mismatch after Pentaho upgrade; deleted attributes rows; repository connection timeout.","solutions":["Check the repository database connectivity and retry loading the transformation.","Verify the repository schema is upgraded to match the Pentaho version (repository upgrade tools).","Inspect r_step_attribute rows for the step; re-save the step to regenerate them.","Fall back to loading the transformation from a file export instead of the repository."],"exampleFix":"// before\n// load with stale repository connection -> readRep throws\n// after\n// reconnect/validate repository before loading\nif (!rep.connect()) { rep.connect(); }\nTransMeta tm = new TransMeta(rep, \"MyTrans\");","handlingStrategy":"retry","validationCode":"if (!rep.getConnection().isValid(5)) {\n  throw new IllegalStateException(\"Repository connection is not healthy before load\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta(rep, \"MyTrans\");\n} catch (KettleException e) {\n  if (e.getMessage().contains(\"FileExistsMeta.Exception.UnexpectedErrorReadingStepInfo\")) {\n    // reconnect / check repository schema, then retry once\n  } else { throw e; }\n}","preventionTips":["Verify repository DB connectivity before loading transformations.","Keep the repository schema upgraded in lockstep with the Pentaho version.","Avoid deleting repository rows manually.","Keep file-based exports as a fallback source of truth."],"tags":["repository","database","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"}