{"record":{"id":"a6cbef5494e4622c","repo":"pentaho/pentaho-kettle","slug":"fileexistsmeta-exception-unabletoreadstepinfo","errorCode":null,"errorMessage":"FileExistsMeta.Exception.UnableToReadStepInfo","messagePattern":"FileExistsMeta\\.Exception\\.UnableToReadStepInfo","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java","lineNumber":187,"sourceCode":"    StringBuilder retval = new StringBuilder();\n\n    retval.append( \"    \" + XMLHandler.addTagValue( \"filenamefield\", filenamefield ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"resultfieldname\", resultfieldname ) );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"includefiletype\", includefiletype ) );\n    retval.append( \"    \" + XMLHandler.addTagValue( \"filetypefieldname\", filetypefieldname ) );\n    retval.append( \"    \" ).append( XMLHandler.addTagValue( \"addresultfilenames\", addresultfilenames ) );\n    return retval.toString();\n  }\n\n  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {\n    try {\n      filenamefield = XMLHandler.getTagValue( stepnode, \"filenamefield\" );\n      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 {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/fileexists/FileExistsMeta.java#L169-L205","documentation":"FileExistsMeta.loadXML()/readData() parses the step's XML node (fields like filenamefield, resultfieldname, includefiletype) and wraps any parsing exception in a KettleXMLException with the localized 'UnableToReadStepInfo' message. It signals corrupted or unexpected step XML when loading a transformation.","triggerScenarios":"Loading a .ktr whose <step type=\"FileExists\"> XML node is malformed, truncated, hand-edited, or produced by an incompatible plugin version.","commonSituations":"Manually edited XML; merge conflicts in versioned ktr files; repository export/import across Pentaho versions with changed tags; character-encoding corruption.","solutions":["Open the .ktr in a text editor and fix or remove the malformed FileExists step XML.","Re-create the FileExists step in Spoon and re-save the transformation.","Restore the ktr from backup or version control.","Ensure the opening/closing Spoon versions are compatible with the transformation."],"exampleFix":"<!-- before -->\n<step><name>FileExists</name><type>FileExists</type><filenamefield>filename <!-- unclosed tag\n<!-- after -->\n<step><name>FileExists</name><type>FileExists</type><filenamefield>filename</filenamefield></step>","handlingStrategy":"try-catch","validationCode":"org.w3c.dom.Document doc;\ntry {\n  doc = javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new java.io.File(ktrPath));\n} catch (Exception e) {\n  throw new IllegalStateException(\"Malformed ktr XML: \" + ktrPath, e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta(ktrPath);\n} catch (KettleXMLException e) {\n  if (e.getMessage().contains(\"FileExistsMeta.Exception.UnableToReadStepInfo\")) {\n    // repair or re-create the FileExists step XML\n  } else { throw e; }\n}","preventionTips":["Never hand-edit .ktr XML without validating afterwards in Spoon.","Resolve version-control merge conflicts in ktr files with the Spoon editor.","Back up transformations before Pentaho version upgrades.","Validate XML well-formedness in CI for repository-stored ktr files."],"tags":["xml","metadata","etl"],"backgroundTag":"json-unmarshal-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"}