{"record":{"id":"6fbcfb1883865a01","repo":"pentaho/pentaho-kettle","slug":"yamlinputmeta-exception-errorloadingxml","errorCode":null,"errorMessage":"YamlInputMeta.Exception.ErrorLoadingXML","messagePattern":"YamlInputMeta\\.Exception\\.ErrorLoadingXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInputMeta.java","lineNumber":513,"sourceCode":"        fileName[i] = XMLHandler.getNodeValue( filenamenode );\n        fileMask[i] = XMLHandler.getNodeValue( filemasknode );\n        fileRequired[i] = XMLHandler.getNodeValue( fileRequirednode );\n        includeSubFolders[i] = XMLHandler.getNodeValue( includeSubFoldersnode );\n      }\n\n      for ( int i = 0; i < nrFields; i++ ) {\n        Node fnode = XMLHandler.getSubNodeByNr( fields, \"field\", i );\n        YamlInputField field = new YamlInputField( fnode );\n        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      inFields = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"IsInFields\" ) );\n      IsAFile = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"IsAFile\" ) );\n      yamlField = XMLHandler.getTagValue( stepnode, \"YamlField\" );\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG, \"YamlInputMeta.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    fileRequired = new String[nrfiles];\n    includeSubFolders = new String[nrfiles];\n    inputFields = new YamlInputField[nrfields];\n  }\n\n  @Override\n  public void setDefault() {\n    IsIgnoreEmptyFile = false;\n    doNotFailIfNoFile = true;\n    includeFilename = false;\n    filenameField = \"\";","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/yaml-input/impl/src/main/java/org/pentaho/di/trans/steps/yamlinput/YamlInputMeta.java#L495-L531","documentation":"YamlInputMeta.readData wraps XML deserialization of the step's settings; any exception while reading tags from the step XML node is rethrown as a KettleXMLException with this message, including the underlying exception's toString. It protects the loader from partially corrupt step metadata.","triggerScenarios":"loadXML -> readData: any XMLHandler.getTagValue call or conversion (e.g. Const.toLong on 'limit', boolean parsing of 'IsInFields') throws because the XML fragment is malformed or an unexpected value is present.","commonSituations":"Hand-edited .ktr files, transformations written by a different PDI version with an incompatible schema, truncated/corrupt repository export, copy-paste of XML between transformations with mismatched tags.","solutions":["Read the nested exception in the message to identify which tag/value failed to parse.","Open the .ktr in a text editor and fix or remove the malformed tag for this step (e.g. non-numeric <limit>).","Recreate the YAML Input step in Spoon and re-enter its settings.","Align PDI versions between the environment that wrote and the one reading the transformation."],"exampleFix":"// before: corrupt XML\n<limit>abc</limit>\n// after: valid numeric value\n<limit>0</limit>","handlingStrategy":"try-catch","validationCode":"// validate XML before handing it to Kettle\ntry { Document d = XMLHandler.loadXMLString(xml); if (d == null) throw new IllegalArgumentException(\"null step node\"); }\ncatch (KettleXMLException e) { throw new IllegalArgumentException(\"malformed step XML\", e); }","typeGuard":null,"tryCatchPattern":"try { meta.loadXML(stepNode, databases, metaStore, transMeta, null); }\ncatch (KettleXMLException e) {\n  log.error(\"Corrupt YAML Input step XML: \" + e.getMessage(), e);\n  meta = new YamlInputMeta(); // fall back to defaults and reconfigure\n}","preventionTips":["Never hand-edit .ktr files; edit in Spoon.","Keep writer and reader PDI versions aligned.","Keep transformations in version control to restore known-good XML."],"tags":["xml-parse","metadata","serialization"],"backgroundTag":"json-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"}