pentaho/pentaho-kettle · error · KettleStepException

RegexEval.Exception.ErrorResultFieldMissing

Error message

RegexEval.Exception.ErrorResultFieldMissing

What it means

RegexEval.processRow throws KettleStepException when the Result Field Name is empty in the step configuration and capture groups are not allowed. The step needs a target field to write the regex match result into; without it the output row shape cannot be produced, so it logs RegexEval.Log.ErrorResultFieldMissing and fails the step.

Solutions

  1. Open the Regex Eval step dialog and set a non-empty Result field name
  2. Or enable 'Allow capture groups' if you only need capture-group output fields
  3. Validate meta.getResultFieldName() before running the transformation

Example fix

// before
RegexEvalMeta meta = (RegexEvalMeta) stepMeta.getStepMetaInterface();
meta.setResultFieldName("");
// after
RegexEvalMeta meta = (RegexEvalMeta) stepMeta.getStepMetaInterface();
if (meta.getResultFieldName() == null || meta.getResultFieldName().trim().isEmpty()) {
  meta.setResultFieldName("matchResult");
}
Defensive patterns

Strategy: validation

Validate before calling

RegexEvalMeta m = (RegexEvalMeta) stepMeta.getStepMetaInterface();
boolean ok = (m.getResultFieldName() != null && !m.getResultFieldName().trim().isEmpty()) || m.isAllowCaptureGroupsFlagSet();
if (!ok) throw new IllegalArgumentException("Result field name required unless capture groups are allowed");

Type guard

boolean hasResultField(RegexEvalMeta m) { return m.getResultFieldName() != null && !m.getResultFieldName().trim().isEmpty(); }

Try / catch

try { trans.execute(...); } catch (KettleException e) { if (e.getMessage().contains("ErrorResultFieldMissing")) { logError("Set the Regex Eval result field name in the step dialog"); } throw e; }

Prevention

When it happens

Trigger: Executing a Regex Eval step whose 'Result field name' is blank while 'Allow capture groups' is unchecked — detected on the first processRow call before any row is processed.

Common situations: Creating the step and forgetting to type a result field name; metadata migrated between versions losing the field; disabling capture groups which makes the previously-optional result field mandatory.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/regexeval/RegexEval.java:82

      return false;
    }

    if ( first ) { // we just got started

      first = false;

      // get the RowMeta
      data.outputRowMeta = getInputRowMeta().clone();
      int captureIndex = getInputRowMeta().size();
      meta.getFields( getTransMeta().getBowl(), data.outputRowMeta, getStepname(), null, null, this, repository,
        metaStore );

      // Let's check that Result Field is given
      if ( Utils.isEmpty( environmentSubstitute( meta.getResultFieldName() ) ) ) {
        if ( !meta.isAllowCaptureGroupsFlagSet() ) {
          // Result field is missing !
          logError( BaseMessages.getString( PKG, "RegexEval.Log.ErrorResultFieldMissing" ) );
          throw new KettleStepException( BaseMessages.getString(
            PKG, "RegexEval.Exception.ErrorResultFieldMissing" ) );
        }
        data.indexOfResultField = -1;
      } else {
        if ( meta.isReplacefields() ) {
          data.indexOfResultField = getInputRowMeta().indexOfValue( meta.getResultFieldName() );
        }
        if ( data.indexOfResultField < 0 ) {
          data.indexOfResultField = getInputRowMeta().size();
          captureIndex++;
        }
      }

      // Check if a Field (matcher) is given
      if ( meta.getMatcher() == null ) {
        // Matcher is missing !
        logError( BaseMessages.getString( PKG, "RegexEval.Log.ErrorMatcherMissing" ) );
        throw new KettleStepException( BaseMessages.getString( PKG, "RegexEval.Exception.ErrorMatcherMissing" ) );

View on GitHub (pinned to f3058517a1)