{"record":{"id":"0e935b61518975b9","repo":"pentaho/pentaho-kettle","slug":"mysqlbulkloadermeta-exception-unabletoreadstepinfofromxml","errorCode":"MySQLBulkLoaderMeta.Exception.UnableToReadStepInfoFromXML","errorMessage":"MySQLBulkLoaderMeta.Exception.UnableToReadStepInfoFromXML","messagePattern":"MySQLBulkLoaderMeta\\.Exception\\.UnableToReadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java","lineNumber":275,"sourceCode":"      replacingData = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"replace\" ) );\n      ignoringErrors = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"ignore\" ) );\n      localFile = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, \"local\" ) );\n\n      int nrvalues = XMLHandler.countNodes( stepnode, \"mapping\" );\n      allocate( nrvalues );\n\n      for ( int i = 0; i < nrvalues; i++ ) {\n        Node vnode = XMLHandler.getSubNodeByNr( stepnode, \"mapping\", i );\n\n        fieldTable[i] = XMLHandler.getTagValue( vnode, \"stream_name\" );\n        fieldStream[i] = XMLHandler.getTagValue( vnode, \"field_name\" );\n        if ( fieldStream[i] == null ) {\n          fieldStream[i] = fieldTable[i]; // default: the same name!\n        }\n        fieldFormatType[i] = getFieldFormatType( XMLHandler.getTagValue( vnode, \"field_format_ok\" ) );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString( PKG,\n          \"MySQLBulkLoaderMeta.Exception.UnableToReadStepInfoFromXML\" ), e );\n    }\n  }\n\n  public void setDefault() {\n    fieldTable = null;\n    databaseMeta = null;\n    schemaName = \"\";\n    tableName = BaseMessages.getString( PKG, \"MySQLBulkLoaderMeta.DefaultTableName\" );\n    encoding = \"\";\n    fifoFileName = \"/tmp/fifo\";\n    delimiter = \"\\t\";\n    enclosure = \"\\\"\";\n    escapeChar = \"\\\\\";\n    replacingData = false;\n    ignoringErrors = false;\n    localFile = true;\n    bulkSize = null;","sourceCodeStart":257,"sourceCodeEnd":293,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/mysql-bulk-loader/impl/src/main/java/org/pentaho/di/trans/steps/mysqlbulkloader/MySQLBulkLoaderMeta.java#L257-L293","documentation":"readData parses the step's XML representation (via loadXML) and wraps any exception during tag parsing in a KettleXMLException with the UnableToReadStepInfoFromXML message. It means the <step> XML for the MySQL Bulk Loader could not be read: a required tag was missing, malformed, or had an unexpected value. The original exception is attached as the cause.","triggerScenarios":"loadXML -> readData throws when XMLHandler.getTagValue returns unexpected content, getFieldFormatType fails on an unknown format string, or any exception occurs while reading field_table/field_stream/field_format_ok tags inside the <fields> element.","commonSituations":"Manually edited .ktr files with corrupted or missing tags; transformations from a different Pentaho/Kettle version using a different XML schema; truncated file transfer; copy-pasted step XML between transformations with mismatched content.","solutions":["Open the .ktr file in a text editor and inspect the MySQL Bulk Loader step's <fields> section for missing or malformed tags (field_table, field_stream, field_format_ok).","Recreate the step in Spoon and save a fresh .ktr to regenerate valid XML.","Check Kettle version compatibility — if the file came from a newer PDI version, upgrade the runtime or re-save in your version.","Look at the KettleXMLException's cause (getCause()) to pinpoint the exact parse failure."],"exampleFix":"// before: hand-edited XML with an unrecognized format value\n<field_format_ok>BigDecimal</field_format_ok>\n// after: use one of the supported format identifiers\n<field_format_ok>none</field_format_ok>","handlingStrategy":"try-catch","validationCode":"// Before loading, check the .ktr contains well-formed step XML\nDocument doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File( ktrPath ) );\nNodeList steps = doc.getElementsByTagName( \"step\" );\nfor ( int i = 0; i < steps.getLength(); i++ ) {\n  Element step = (Element) steps.item( i );\n  if ( \"MySQLBulkLoader\".equals( step.getAttribute( \"type\" ) ) ) {\n    NodeList fields = step.getElementsByTagName( \"fields\" );\n    if ( fields.getLength() == 0 ) {\n      throw new IllegalStateException( \"MySQLBulkLoader step XML missing <fields> element\" );\n    }\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta = new TransMeta( ktrPath );\n} catch ( KettleXMLException e ) {\n  if ( String.valueOf( e.getMessage() ).contains( \"UnableToReadStepInfoFromXML\" ) ) {\n    log.error( \"Corrupt MySQL Bulk Loader step XML; inspect the <fields> block, cause:\", e.getCause() );\n  } else {\n    throw e;\n  }\n}","preventionTips":["Never hand-edit .ktr files; edit through Spoon.","Validate XML before loading programmatically-generated transformations.","Keep the Kettle runtime version in sync with the tooling that produced the .ktr.","Verify file integrity (no truncation) after transferring transformations between machines."],"tags":["xml","parsing","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"}