pentaho/pentaho-kettle · error · KettleXMLException

DynamicSQLRowMeta.Exception.UnableToLoadStepInfo

Error message

DynamicSQLRowMeta.Exception.UnableToLoadStepInfo

What it means

DynamicSQLRowMeta.readData wraps any exception thrown while parsing the step's XML node (via XMLHandler tag lookups) into a KettleXMLException with this message key, called from loadXML. It means the step's XML definition could not be parsed into step metadata.

Solutions

  1. Inspect the wrapped cause (e.getCause()) to find the exact parse failure
  2. Validate/repair the .ktr XML (open in an XML editor, check the step's <fields> block)
  3. Re-create the Dynamic SQL Row step in Spoon and re-save the transformation
  4. Align file versions — open the transformation with the same PDI version that produced it

Example fix

// before
<step><name>Dynamic SQL row</name><sql>SELECT ...</sql>   // truncated file
// after
complete the step XML including <sql_fieldname>, <query_only_on_change>, <rowlimit> tags and re-save from Spoon
Defensive patterns

Strategy: validation

Validate before calling

// Validate the .ktr XML before loading:
DocumentBuilderFactory f = DocumentBuilderFactory.newInstance();
f.setValidating(false);
Document doc = f.newDocumentBuilder().parse(new File(ktrPath)); // throws if malformed
if (doc.getElementsByTagName("sql_fieldname").getLength() == 0) {
  System.out.println("Warning: Dynamic SQL Row step missing sql_fieldname tag");
}

Try / catch

try (InputStream in = new FileInputStream(ktrPath)) {
  transMeta = new TransMeta(in, null, false, vars, null);
} catch (KettleXMLException e) {
  logError("Failed parsing transformation XML: " + e.getCause(), e);
  throw e;
}

Prevention

When it happens

Trigger: Loading a .ktr file whose Dynamic SQL Row step XML is malformed or has unexpected structure, causing XMLHandler.getTagValue or related calls to throw inside readData.

Common situations: Hand-edited or truncated .ktr files; transformation files from newer/older Pentaho versions with different tags; corrupted XML from bad merges or transfer (encoding issues).

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/55ed88c4cac15c12. Report an issue: GitHub.

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/dynamicsqlrow/DynamicSQLRowMeta.java:199

    DynamicSQLRowMeta retval = (DynamicSQLRowMeta) super.clone();

    return retval;
  }

  private void readData( Node stepnode, List<DatabaseMeta> databases ) throws KettleXMLException {
    try {
      String con = XMLHandler.getTagValue( stepnode, "connection" );
      databaseMeta = DatabaseMeta.findDatabase( databases, con );
      sql = XMLHandler.getTagValue( stepnode, "sql" );
      outerJoin = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "outer_join" ) );
      replacevars = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "replace_vars" ) );
      queryonlyonchange = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "query_only_on_change" ) );

      rowLimit = Const.toInt( XMLHandler.getTagValue( stepnode, "rowlimit" ), 0 );
      sqlfieldname = XMLHandler.getTagValue( stepnode, "sql_fieldname" );

    } catch ( Exception e ) {
      throw new KettleXMLException( BaseMessages.getString(
        PKG, "DynamicSQLRowMeta.Exception.UnableToLoadStepInfo" ), e );
    }
  }

  public void setDefault() {
    databaseMeta = null;
    rowLimit = 0;
    sql = "";
    outerJoin = false;
    replacevars = false;
    sqlfieldname = null;
    queryonlyonchange = false;
  }

  @Override
  public void getFields( Bowl bowl, RowMetaInterface row, String name, RowMetaInterface[] info, StepMeta nextStep,
    VariableSpace space, Repository repository, IMetaStore metaStore ) throws KettleStepException {

View on GitHub (pinned to f3058517a1)