pentaho/pentaho-kettle · error · KettleXMLException

ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML

ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML

Error message

ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML

What it means

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.

Solutions

  1. Examine the wrapped cause for the precise XML parse error
  2. Rebuild the ExecSQL step in Spoon and re-save the transformation
  3. Restore the .ktr from version control or backup
  4. Reconcile PDI versions (open with the version that wrote the file)

Example fix

// before
TransMeta tm = new TransMeta("etl.ktr"); // KettleXMLException on ExecSQL step
// after
try {
  TransMeta tm = new TransMeta("etl.ktr");
} catch (KettleXMLException e) {
  logError("ExecSQL step XML invalid: " + e.getCause());
  // open file, fix/remove the malformed <step type="ExecSQL"> node, retry
}
Defensive patterns

Strategy: try-catch

Validate before calling

// sanity-check the XML before load
Document doc = XMLHandler.loadXMLFile(new File(ktrPath));
if (XMLHandler.getSubNode(XMLHandler.getSubNode(doc, "transformation"), "step") == null) throw new IllegalStateException("no steps in XML");

Try / catch

try { transMeta = new TransMeta(ktrPath); } catch (KettleXMLException e) { logError("ExecSQL XML invalid: " + e.getCause()); /* fix or regenerate the step XML */ }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "failed to unmarshal" / json.Unmarshal errors: why parsing a response into a Go struct fails and how to fix it — this error's family across 23 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/97d1911c901a05cb. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/sql/ExecSQLMeta.java:280

      replaceVariables = "Y".equals( XMLHandler.getTagValue( stepnode, "replace_variables" ) );
      quoteString = "Y".equals( XMLHandler.getTagValue( stepnode, "quoteString" ) );
      setParams = "Y".equals( XMLHandler.getTagValue( stepnode, "set_params" ) );
      sql = XMLHandler.getTagValue( stepnode, "sql" );

      insertField = XMLHandler.getTagValue( stepnode, "insert_field" );
      updateField = XMLHandler.getTagValue( stepnode, "update_field" );
      deleteField = XMLHandler.getTagValue( stepnode, "delete_field" );
      readField = XMLHandler.getTagValue( stepnode, "read_field" );

      Node argsnode = XMLHandler.getSubNode( stepnode, "arguments" );
      int nrArguments = XMLHandler.countNodes( argsnode, "argument" );
      allocate( nrArguments );
      for ( int i = 0; i < nrArguments; i++ ) {
        Node argnode = XMLHandler.getSubNodeByNr( argsnode, "argument", i );
        arguments[i] = XMLHandler.getTagValue( argnode, "name" );
      }
    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString(
        PKG, "ExecSQLMeta.Exception.UnableToLoadStepInfoFromXML" ), e );
    }
  }

  public void setDefault() {
    databaseMeta = null;
    sql = "";
    arguments = new String[0];
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface r, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {
    RowMetaAndData add =
      ExecSQL.getResultRow( new Result(), getUpdateField(), getInsertField(), getDeleteField(), getReadField() );

    r.mergeRowMeta( add.getRowMeta() );
  }

View on GitHub (pinned to f3058517a1)