pentaho/pentaho-kettle · error · KettleXMLException

AddSequenceMeta.Exception.ErrorLoadingStepInfo

Error message

AddSequenceMeta.Exception.ErrorLoadingStepInfo

What it means

AddSequenceMeta.readData() wraps all XMLHandler tag parsing of the step's serialized <fields> node in a try/catch and rethrows any Exception as a KettleXMLException with this message. It means the step's XML fragment in the .ktr file is malformed or contains values that cannot be parsed (e.g. non-numeric counter values), so the step metadata could not be loaded from XML.

Solutions

  1. Open the .ktr in a text editor and inspect the AddSequence step's XML node for malformed or missing tags; repair or remove the broken step node
  2. Recreate the AddSequence step in Spoon and re-save the transformation to regenerate valid XML
  3. Check the Kettle version that produced the file versus the one loading it; upgrade or migrate the file if schemas differ
  4. Look at the wrapped cause 'e' in the exception stack trace to pinpoint exactly which tag failed to parse

Example fix

// before: hand-edited step XML with non-numeric counter
<start_at>one</start_at>
// after
<start_at>1</start_at>
Defensive patterns

Strategy: try-catch

Validate before calling

Document doc = XMLHandler.loadXMLFile(ktrFile);
Node stepNode = findStepNode(doc, "AddSequence");
if (stepNode == null || XMLHandler.getTagValue(stepNode, "valuename") == null)
  throw new IllegalStateException("AddSequence step XML node missing or incomplete");

Type guard

boolean isParsableLong(String v) {
  if (v == null || v.isEmpty()) return false;
  try { Long.parseLong(v.trim()); return true; } catch (NumberFormatException e) { return false; }
}

Try / catch

try {
  transMeta.loadXML(file, null, metaStore, true);
} catch (KettleXMLException e) {
  if (e.getMessage().contains("ErrorLoadingStepInfo")) {
    logError("Corrupt AddSequence step XML: " + e.getCause());
    // fall back to rebuilding the step
  } else throw e;
}

Prevention

When it happens

Trigger: loadXML() calls readData(stepnode) and XMLHandler.getTagValue or subsequent parsing throws — corrupt/truncated transformation XML, unexpected node structure, or attribute values of wrong type inside the AddSequence step node.

Common situations: A .ktr file edited by hand or damaged by an interrupted save; transformation produced by an incompatible plugin or newer Kettle version with a different XML schema; copy-paste of step XML that lost required child tags.

Related errors


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

Appendix: source

Thrown at plugins/core/impl/src/main/java/org/pentaho/di/trans/steps/addsequence/AddSequenceMeta.java:248

      valuename = XMLHandler.getTagValue( stepnode, "valuename" );

      useDatabase = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "use_database" ) );
      String conn = XMLHandler.getTagValue( stepnode, "connection" );
      database = DatabaseMeta.findDatabase( databases, conn );
      schemaName = XMLHandler.getTagValue( stepnode, "schema" );
      sequenceName = XMLHandler.getTagValue( stepnode, "seqname" );

      useCounter = "Y".equalsIgnoreCase( XMLHandler.getTagValue( stepnode, "use_counter" ) );
      counterName = XMLHandler.getTagValue( stepnode, "counter_name" );
      startAt = XMLHandler.getTagValue( stepnode, "start_at" );
      incrementBy = XMLHandler.getTagValue( stepnode, "increment_by" );
      maxValue = XMLHandler.getTagValue( stepnode, "max_value" );

      // TODO startAt = Const.toLong(XMLHandler.getTagValue(stepnode, "start_at"), 1);
      // incrementBy = Const.toLong(XMLHandler.getTagValue(stepnode, "increment_by"), 1);
      // maxValue = Const.toLong(XMLHandler.getTagValue(stepnode, "max_value"), 999999999L);
    } catch ( Exception e ) {
      throw new KettleXMLException(
        BaseMessages.getString( PKG, "AddSequenceMeta.Exception.ErrorLoadingStepInfo" ), e );
    }
  }

  @Override
  public void setDefault() {
    valuename = "valuename";

    useDatabase = false;
    schemaName = "";
    sequenceName = "SEQ_";
    database = null;

    useCounter = true;
    counterName = null;
    startAt = "1";
    incrementBy = "1";
    maxValue = "999999999";

View on GitHub (pinned to f3058517a1)