{"record":{"id":"d76ee16578878a4a","repo":"pentaho/pentaho-kettle","slug":"unable-to-load-step-info-from-xml-tableinputmeta","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":"engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java","lineNumber":188,"sourceCode":"  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {\n    this.databases = databases;\n    try {\n      databaseMeta = DatabaseMeta.findDatabase( databases, XMLHandler.getTagValue( stepnode, \"connection\" ) );\n      sql = XMLHandler.getTagValue( stepnode, \"sql\" );\n      rowLimit = XMLHandler.getTagValue( stepnode, \"limit\" );\n\n      String lookupFromStepname = XMLHandler.getTagValue( stepnode, \"lookup\" );\n      StreamInterface infoStream = getStepIOMeta().getInfoStreams().get( 0 );\n      infoStream.setSubject( lookupFromStepname );\n\n      executeEachInputRow = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"execute_each_row\" ) );\n      variableReplacementActive = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"variables_active\" ) );\n      lazyConversionActive = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"lazy_conversion_active\" ) );\n      cachedRowMetaActive = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"cached_row_meta_active\" ) );\n      cachedRowMeta = new RowMeta( XMLHandler.getSubNode( stepnode, RowMeta.XML_META_TAG ) );\n\n    } catch ( Exception e ) {\n      throw new KettleXMLException( \"Unable to load step info from XML\", e );\n    }\n  }\n\n  public void setDefault() {\n    databaseMeta = null;\n    sql = \"SELECT <values> FROM <table name> WHERE <conditions>\";\n    rowLimit = \"0\";\n  }\n\n  protected Database getDatabase() {\n    // Added for test purposes\n    return new Database( loggingObject, databaseMeta );\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface row, String origin, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    if ( databaseMeta == null ) {","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/tableinput/TableInputMeta.java#L170-L206","documentation":"TableInputMeta.readData(), invoked from loadXML(), parses the step's XML node (connection, SQL, 'execute each input row', lazy conversion, cached row meta tags) via XMLHandler. Any exception during parsing is rethrown as a KettleXMLException with the message 'Unable to load step info from XML'.","triggerScenarios":"loadXML() is called with a stepnode whose expected tags are malformed or whose cached row-meta subnode (RowMeta.XML_META_TAG) is missing/corrupt, causing XMLHandler.getSubNode/new RowMeta to throw; also a null or non-element stepnode.","commonSituations":"Hand-edited or truncated .ktr files; transformations exported by other tools or older/newer Pentaho versions missing tags like <row-meta>; copy-pasting step XML fragments between transformations; corrupted repository/export files.","solutions":["Open the .ktr file in an XML editor and validate it; fix or remove the malformed TableInput step node.","Check the cause chain (KettleXMLException wraps the original exception) to find which tag failed.","Remove or repair the cached row meta node (xml_meta tag) — it is recomputed at runtime.","Recreate the TableInput step in Spoon and re-enter its settings, then re-save the transformation.","Ensure the transformation file was fully written/exported (not truncated) and matches your Pentaho version."],"exampleFix":"// before: missing <row-meta> element breaks new RowMeta(XMLHandler.getSubNode(...)) if code expects it\n<step name=\"Table input\" type=\"TableInput\">\n  <sql>SELECT ...</sql>\n</step>\n// after: re-save the step via Spoon so all tags are serialized\n<step name=\"Table input\" type=\"TableInput\">\n  <sql>SELECT ...</sql>\n  <variables_active>Y</variables_active>\n  <lazy_conversion_active>N</lazy_conversion_active>\n  <cached_row_meta_active>N</cached_row_meta_active>\n</step>","handlingStrategy":"try-catch","validationCode":"// Validate the .ktr XML parses and contains the TableInput node before loading\nDocument doc = XMLHandler.loadXMLFile(new File(\"trans.ktr\"));\nif (doc == null || XMLHandler.getSubNode(doc.getDocumentElement(), \"step\") == null) {\n  throw new IllegalStateException(\"Transformation XML is malformed\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  meta.loadXML(stepnode, databases, metaStore);\n} catch (KettleXMLException e) {\n  log.error(\"Step XML invalid: \" + KettleUtil.getMessage(e));\n  throw e; // or recreate the step from defaults: meta.setDefault();\n}","preventionTips":["Never hand-edit .ktr files; edit via Spoon and let it serialize the step.","Validate XML after copying steps between transformations.","Check for full/clean file writes when exporting transformations.","When upgrading Pentaho versions, re-save transformations so tag schemas match."],"tags":["kettle","xml","serialization","step-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"}