{"record":{"id":"97d1911c901a05cb","repo":"pentaho/pentaho-kettle","slug":"execsqlmeta-exception-unabletoloadstepinfofromxml","errorCode":"ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML","errorMessage":"ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML","messagePattern":"ExecSQLMeta\\.Exception\\.UnableToLoadStepInfoFromXML","errorType":"exception","errorClass":"KettleXMLException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java","lineNumber":280,"sourceCode":"      replaceVariables = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"replace_variables\" ) );\n      quoteString = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"quoteString\" ) );\n      setParams = \"Y\".equals( XMLHandler.getTagValue( stepnode, \"set_params\" ) );\n      sql = XMLHandler.getTagValue( stepnode, \"sql\" );\n\n      insertField = XMLHandler.getTagValue( stepnode, \"insert_field\" );\n      updateField = XMLHandler.getTagValue( stepnode, \"update_field\" );\n      deleteField = XMLHandler.getTagValue( stepnode, \"delete_field\" );\n      readField = XMLHandler.getTagValue( stepnode, \"read_field\" );\n\n      Node argsnode = XMLHandler.getSubNode( stepnode, \"arguments\" );\n      int nrArguments = XMLHandler.countNodes( argsnode, \"argument\" );\n      allocate( nrArguments );\n      for ( int i = 0; i < nrArguments; i++ ) {\n        Node argnode = XMLHandler.getSubNodeByNr( argsnode, \"argument\", i );\n        arguments[i] = XMLHandler.getTagValue( argnode, \"name\" );\n      }\n    } catch ( Exception e ) {\n      throw new KettleXMLException( BaseMessages.getString(\n        PKG, \"ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML\" ), e );\n    }\n  }\n\n  public void setDefault() {\n    databaseMeta = null;\n    sql = \"\";\n    arguments = new String[0];\n  }\n\n  @Override\n  public void getFields( Bowl bowl, RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,\n    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {\n    RowMetaAndData add =\n      ExecSQL.getResultRow( new Result(), getUpdateField(), getInsertField(), getDeleteField(), getReadField() );\n\n    r.mergeRowMeta( add.getRowMeta() );\n  }","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java#L262-L298","documentation":"Thrown by ExecSQLMeta.readData (via loadXML) when parsing the ExecSQL step's XML definition fails, typically while reading the sql field, connection, useVariableSubstitution settings or the argument list nodes. The exception is wrapped in a KettleXMLException with this message key, aborting transformation load from XML.","triggerScenarios":"Loading a .ktr where the ExecSQL step node is malformed: missing <arguments> node while nrArguments > 0, XMLHandler.getSubNodeByNr returning unexpected nodes, or hand-edited XML that breaks the expected tag structure.","commonSituations":"Manual edits to a .ktr file; merge conflicts in XML; transformations exported from newer PDI versions read by older ones; truncated files copied between systems.","solutions":["Examine the wrapped cause for the precise XML parse error","Rebuild the ExecSQL step in Spoon and re-save the transformation","Restore the .ktr from version control or backup","Reconcile PDI versions (open with the version that wrote the file)"],"exampleFix":"// before\nTransMeta tm = new TransMeta(\"etl.ktr\"); // KettleXMLException on ExecSQL step\n// after\ntry {\n  TransMeta tm = new TransMeta(\"etl.ktr\");\n} catch (KettleXMLException e) {\n  logError(\"ExecSQL step XML invalid: \" + e.getCause());\n  // open file, fix/remove the malformed <step type=\"ExecSQL\"> node, retry\n}","handlingStrategy":"try-catch","validationCode":"// sanity-check the XML before load\nDocument doc = XMLHandler.loadXMLFile(new File(ktrPath));\nif (XMLHandler.getSubNode(XMLHandler.getSubNode(doc, \"transformation\"), \"step\") == null) throw new IllegalStateException(\"no steps in XML\");","typeGuard":null,"tryCatchPattern":"try { transMeta = new TransMeta(ktrPath); } catch (KettleXMLException e) { logError(\"ExecSQL XML invalid: \" + e.getCause()); /* fix or regenerate the step XML */ }","preventionTips":["Avoid manual XML edits on .ktr files","Store transformations in VCS to recover from corruption","Match PDI versions between authoring and consuming environments","Re-save in Spoon after scripted modifications"],"tags":["xml","deserialization","kettle"],"backgroundTag":"json-unmarshal-failed","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"}