{"record":{"id":"b4b9cfb335425483","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-step-info-from-xml-avrooutputmetabase","errorCode":null,"errorMessage":"Unable to load step info from XML","messagePattern":"Unable to load step info from XML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/output/AvroOutputMetaBase.java","lineNumber":181,"sourceCode":"        outputField.setPrecision( XMLHandler.getTagValue( fnode, PRECISION ) );\n        outputField.setScale( XMLHandler.getTagValue( fnode, SCALE ) );\n        outputField.setAllowNull( XMLHandler.getTagValue( fnode, NULLABLE ) );\n        outputField.setDefaultValue( XMLHandler.getTagValue( fnode, DEFAULT )  );\n        avroOutputFields.add( outputField );\n      }\n      this.outputFields = avroOutputFields;\n\n      compressionType = XMLHandler.getTagValue( stepnode, FieldNames.COMPRESSION );\n      dateTimeFormat = XMLHandler.getTagValue( stepnode, FieldNames.DATE_FORMAT );\n      dateInFileName = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, FieldNames.DATE_IN_FILE_NAME ) );\n      timeInFileName = \"Y\".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, FieldNames.TIME_IN_FILE_NAME ) );\n      schemaFilename = XMLHandler.getTagValue( stepnode, FieldNames.SCHEMA_FILENAME );\n      namespace = XMLHandler.getTagValue( stepnode, FieldNames.NAMESPACE );\n      docValue = XMLHandler.getTagValue( stepnode, FieldNames.DOC_VALUE );\n      recordName = XMLHandler.getTagValue( stepnode, FieldNames.RECORD_NAME );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to load step info from XML\", e );\n    }\n  }\n\n  @Override\n  public String getXML() {\n    StringBuilder retval = new StringBuilder( 800 );\n    final String INDENT = \"    \";\n\n    retval.append( INDENT ).append( XMLHandler.addTagValue( FILE_NAME, filename ) );\n    parentStepMeta.getParentTransMeta().getNamedClusterEmbedManager().registerUrl( filename );\n    retval.append( INDENT ).append( XMLHandler.addTagValue( FieldNames.OVERRIDE_OUTPUT, overrideOutput ) );\n\n    retval.append( \"    <fields>\" ).append( Const.CR );\n    for ( int i = 0; i < outputFields.size(); i++ ) {\n      AvroOutputField field = outputFields.get( i );\n\n      if ( field.getPentahoFieldName() != null && field.getPentahoFieldName().length() != 0 ) {\n        retval.append( \"      <field>\" ).append( Const.CR );","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/avro-format/core/src/main/java/org/pentaho/di/trans/steps/avro/output/AvroOutputMetaBase.java#L163-L199","documentation":"AvroOutputMetaBase.readData wraps any exception raised while parsing the step's XML node into a KettleXMLException with message 'Unable to load step info from XML'. This runs when a transformation (.ktr) containing the Avro Output step is loaded, reading tags such as schemaFilename, namespace, docValue, recordName via XMLHandler. The original exception is chained as the cause.","triggerScenarios":"loadXML -> readData encounters malformed or missing XML structure for the step node — e.g. a .ktr edited by hand or produced by an incompatible PDI version, a truncated file, or unexpected tag content that makes XMLHandler.getTagValue or surrounding parsing code throw.","commonSituations":"Opening a transformation saved by a newer/older PDI or plugin version whose Avro Output XML layout changed; hand-editing a .ktr and breaking the step node; file transfer corruption; missing plugin jar so the XML cannot be interpreted as expected.","solutions":["Read the chained cause (e.getCause()) to pinpoint which tag/value failed to parse.","Open the .ktr in a text editor and verify the <step> node for the Avro Output contains well-formed children (schemaFilename, namespace, docValue, recordName).","Re-save the transformation from the PDI version that matches the installed Avro plugin, or align plugin versions.","Restore the .ktr from backup/VC if it was truncated or hand-edited incorrectly.","Delete and re-create the Avro Output step if its node is irreparably malformed."],"exampleFix":"<!-- before (hand-edited ktr, broken tag) -->\n<schemaFilename>/data/sch.avsc</schemaFilenam>\n<!-- after -->\n<schemaFilename>/data/sch.avsc</schemaFilename>","handlingStrategy":"try-catch","validationCode":"// Validate the .ktr before load\nDocument doc;\ntry {\n  doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new File(ktrPath));\n} catch (Exception e) { throw new IOException(\"Malformed ktr XML: \" + ktrPath, e); }\nNodeList steps = doc.getElementsByTagName(\"step\");\nfor (int i = 0; i < steps.getLength(); i++) {\n  Element el = (Element) steps.item(i);\n  if (el.getElementsByTagName(\"schemaFilename\").getLength() == 0)\n    throw new IOException(\"Avro Output step missing schemaFilename tag\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  transMeta.loadXML(ktrFile, null, false, null, null, true);\n} catch (KettleXMLException e) {\n  logError(\"Failed to load step XML: \" + e.getCause(), e);\n  // fall back to backup copy or re-save from matching PDI/plugin version\n}","preventionTips":["Do not hand-edit .ktr files; edit via Spoon.","Keep PDI and the Avro plugin versions aligned across environments.","Store transformations in version control to recover from corruption.","Validate XML well-formedness after any scripted ktr generation."],"tags":["kettle","xml","step-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"}