{"record":{"id":"43b10d80b4b2e212","repo":"pentaho/pentaho-kettle","slug":"unable-to-read-step-information-from-xml","errorCode":null,"errorMessage":"Unable to read step information from XML","messagePattern":"Unable to read step information from XML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/getvariable/GetVariableMeta.java","lineNumber":129,"sourceCode":"        fieldDefinitions[i].setFieldType(\n          ValueMetaFactory.getIdForValueMeta( XMLHandler.getTagValue( fnode, \"type\" ) ) );\n        fieldDefinitions[i].setFieldFormat( XMLHandler.getTagValue( fnode, \"format\" ) );\n        fieldDefinitions[i].setCurrency( XMLHandler.getTagValue( fnode, \"currency\" ) );\n        fieldDefinitions[i].setDecimal( XMLHandler.getTagValue( fnode, \"decimal\" ) );\n        fieldDefinitions[i].setGroup( XMLHandler.getTagValue( fnode, \"group\" ) );\n        fieldDefinitions[i].setFieldLength( Const.toInt( XMLHandler.getTagValue( fnode, \"length\" ), -1 ) );\n        fieldDefinitions[i].setFieldPrecision( Const.toInt( XMLHandler.getTagValue( fnode, \"precision\" ), -1 ) );\n        fieldDefinitions[i].setTrimType(\n          ValueMetaString.getTrimTypeByCode( XMLHandler.getTagValue( fnode, \"trim_type\" ) ) );\n\n        // Backward compatibility\n        //\n        if ( fieldDefinitions[i].getFieldType() == ValueMetaInterface.TYPE_NONE ) {\n          fieldDefinitions[i].setFieldType( ValueMetaInterface.TYPE_STRING );\n        }\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to read step information from XML\", e );\n    }\n  }\n\n  @Override\n  public void setDefault() {\n    int count = 0;\n\n    allocate( count );\n\n    for ( int i = 0; i < count; i++ ) {\n      fieldDefinitions[i].setFieldName( \"field\" + i );\n      fieldDefinitions[i].setVariableString( \"\" );\n    }\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface inputRowMeta, String name, RowMetaInterface[] info,\n      StepMeta nextStep, VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/getvariable/GetVariableMeta.java#L111-L147","documentation":"GetVariableMeta.readData (called from loadXML) rebuilds the step's field definitions from the transformation XML and wraps any exception in a KettleXMLException with the literal message 'Unable to read step information from XML'. Field type values are normalized (TYPE_NONE becomes TYPE_STRING) but any structural parsing failure surfaces here.","triggerScenarios":"loadXML parses the Get Variable step's <fields> node and an exception occurs — missing 'field_name'/'variable_name' tags, non-numeric length/precision values causing NumberFormatException, or a missing/malformed field node.","commonSituations":"Truncated or hand-edited .ktr; transformation XML written by an incompatible plugin version; merge conflicts corrupting the fields block of the step XML.","solutions":["Inspect e.getCause() (often NumberFormatException) to find the malformed attribute.","Open the .ktr in Spoon and re-create the Get Variable step to regenerate valid XML.","Validate XML well-formedness and that each <field> has field_name, variable_name and valid type/length/precision values.","Restore the .ktr from version control or backup if it was corrupted by editing."],"exampleFix":"// before: invalid numeric attribute in step XML\n<length>abc</length>\n// after\n<length>10</length>","handlingStrategy":"try-catch","validationCode":"// well-formedness check before loading\nDocumentBuilderFactory.newInstance().newDocumentBuilder().parse( new File( ktrPath ) );","typeGuard":null,"tryCatchPattern":"try {\n  TransMeta tm = new TransMeta( ktrPath );\n} catch ( KettleXMLException e ) {\n  if ( e.getMessage().contains( \"Unable to read step information from XML\" ) ) {\n    logError( \"Get Variable step XML corrupted: \" + e.getCause() );\n  }\n}","preventionTips":["Avoid manual edits/merges on .ktr XML.","Restore from VCS when XML corruption is suspected.","Validate each <field> has name, variable and numeric type/length values."],"tags":["kettle","xml","deserialization","metadata"],"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"}