{"record":{"id":"0053ac8779a8e4bd","repo":"pentaho/pentaho-kettle","slug":"loadfileinputmeta-exception-errorloadingxml","errorCode":"LoadFileInputMeta.Exception.ErrorLoadingXML","errorMessage":"LoadFileInputMeta.Exception.ErrorLoadingXML","messagePattern":"LoadFileInputMeta\\.Exception\\.ErrorLoadingXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/loadfileinput/LoadFileInputMeta.java","lineNumber":717,"sourceCode":"        inputFields[i] = field;\n      }\n\n      // Is there a limit on the number of rows we process?\n      rowLimit = Const.toLong( XMLHandler.getTagValue( stepnode, LIMIT ), 0L );\n\n      fileInField = YES.equalsIgnoreCase( XMLHandler.getTagValue( stepnode, IS_IN_FIELDS ) );\n\n      dynamicFilenameField = XMLHandler.getTagValue( stepnode, DYNAMIC_FILENAME_FIELD );\n      shortFileFieldName = XMLHandler.getTagValue( stepnode, SHORT_FILE_FIELD_NAME );\n      pathFieldName = XMLHandler.getTagValue( stepnode, PATH_FIELD_NAME );\n      hiddenFieldName = XMLHandler.getTagValue( stepnode, HIDDEN_FIELD_NAME );\n      lastModificationTimeFieldName = XMLHandler.getTagValue( stepnode, LAST_MODIFICATION_TIME_FIELD_NAME );\n      uriNameFieldName = XMLHandler.getTagValue( stepnode, URI_NAME_FIELD_NAME );\n      rootUriNameFieldName = XMLHandler.getTagValue( stepnode, ROOT_URI_NAME_FIELD_NAME );\n      extensionFieldName = XMLHandler.getTagValue( stepnode, EXTENSION_FIELD_NAME );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"LoadFileInputMeta.Exception.ErrorLoadingXML\", e\n          .toString() ) );\n    }\n  }\n\n  public void allocate( int nrFiles, int nrFields ) {\n    fileName = new String[ nrFiles ];\n    fileMask = new String[ nrFiles ];\n    excludeFileMask = new String[ nrFiles ];\n    fileRequired = new String[ nrFiles ];\n    includeSubFolders = new String[ nrFiles ];\n    inputFields = new LoadFileInputField[ nrFields ];\n  }\n\n  public void setDefault() {\n    shortFileFieldName = null;\n    pathFieldName = null;\n    hiddenFieldName = null;\n    lastModificationTimeFieldName = null;","sourceCodeStart":699,"sourceCodeEnd":735,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/loadfileinput/LoadFileInputMeta.java#L699-L735","documentation":"Thrown from LoadFileInputMeta when loading the step's configuration from a saved .ktr XML document (loadXML). Any Exception while reading XMLHandler tag values (malformed step XML, unexpected node structure, XMLHandler failure) is wrapped in KettleXMLException with message key LoadFileInputMeta.Exception.ErrorLoadingXML. It signals the step definition in the XML could not be deserialized.","triggerScenarios":"TransformationRepoXML / TransMeta.loadXML parses a <step type=\"LoadFileInput\"> node and loadXML throws: corrupted .ktr file, manually edited XML, XML from a newer/older Pentaho version with a changed schema, or truncation during transfer.","commonSituations":"Opening a .ktr generated by a different PDI version; hand-editing the XML and breaking tag structure; file copied via email/FTP in text mode and truncated; merging transformations by copy-paste with malformed step nodes.","solutions":["Inspect the cause in the stack trace to find the malformed tag, then repair or remove the LoadFileInput step XML node.","Recreate the step in Spoon and re-save the .ktr.","Open the file with the PDI version it was created with, or upgrade Spoon to match the file's version.","Keep .ktr files in version control and transfer in binary mode to avoid truncation/corruption."],"exampleFix":"// before (hand-edited .ktr)\n<files><name>in.txt</name></files> <!-- required tags like file/field structure removed -->\n// after\n// restore the original step XML from version control or recreate the LoadFileInput step in Spoon","handlingStrategy":"try-catch","validationCode":"// Before loading, sanity-check the XML parses and contains the step node:\nDocument doc = XMLHandler.loadXMLFile(new File(ktrPath));\nif (doc == null || XMLHandler.getSubNode(XMLHandler.getSubNode(doc, \"transformation\"), \"step\") == null) {\n  throw new IllegalStateException(\"Corrupt or missing step XML in \" + ktrPath);\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta(ktrPath);\n} catch (KettleXMLException e) {\n  if (e.getMessage().contains(\"ErrorLoadingXML\")) {\n    log.error(\"Failed to parse LoadFileInput step XML: \" + e.getCause(), e);\n    // recover from a backup copy / recreate the step\n  } else { throw e; }\n}","preventionTips":["Keep .ktr files in version control to restore known-good XML.","Do not hand-edit transformation XML; edit via Spoon.","Transfer .ktr files in binary mode; avoid email truncation.","Use the same or newer PDI version than the one that produced the file."],"tags":["xml","serialization","kettle","metadata"],"backgroundTag":"xml-parse-error","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"}