pentaho/pentaho-kettle · error · KettleException

Rest.Exception.MethodFieldMissing

Rest.Exception.MethodFieldMissing

Error message

Rest.Exception.MethodFieldMissing

What it means

Thrown in calcMethod (from processRow) with message 'Method field name is missing!': dynamic HTTP method is enabled but the 'Method field name' setting is empty (Utils.isEmpty after environment substitution).

Solutions

  1. Open the REST step, and with dynamic method enabled select the incoming field containing the HTTP method (GET/POST/...).
  2. If the method should be fixed, disable dynamic method and choose the method from the dropdown instead.
  3. Check that the variable used for the method field name is defined in the runtime environment.

Example fix

// before
dynamic_method=true; method_field_name=""      // throws
// after
dynamic_method=true; method_field_name="http_verb"
Defensive patterns

Strategy: validation

Validate before calling

// Check metadata before running
if (restMeta.isDynamicMethod() && (restMeta.getMethodFieldName() == null || restMeta.getMethodFieldName().trim().isEmpty())) {
  throw new IllegalStateException("REST step: method field name required when dynamic method is enabled");
}

Try / catch

try { processRow(); } catch (KettleException e) {
  if (e.getMessage().contains("Method field name is missing")) { /* set the method field in the dialog */ }
  throw e;
}

Prevention

When it happens

Trigger: meta.isDynamicMethod() is true and environmentSubstitute(meta.getMethodFieldName()) is null or empty during processRow.

Common situations: User enabled 'Accept HTTP method from field' (dynamic method) but did not choose the incoming field; variable used for the method field name resolves to empty at runtime; metadata imported from an older step version with the flag set but no field.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


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

Appendix: source

Thrown at plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java:503

            BaseMessages.getString( PKG, "Rest.Exception.ErrorFindingField", realUrlfieldName ) );
        }
      }
    } else {
      // Static URL
      data.realUrl = environmentSubstitute( meta.getUrl() );
    }
  }

  /**
   * Calculate method
   *
   * @throws KettleException
   */
  private void calcMethod() throws KettleException {
    if ( meta.isDynamicMethod() ) {
      String field = environmentSubstitute( meta.getMethodFieldName() );
      if ( Utils.isEmpty( field ) ) {
        throw new KettleException( BaseMessages.getString( PKG, "Rest.Exception.MethodFieldMissing" ) );
      }
      data.indexOfMethod = data.inputRowMeta.indexOfValue( field );
      if ( data.indexOfMethod < 0 ) {
        // The field is unreachable !
        throw new KettleException( BaseMessages.getString( PKG, "Rest.Exception.ErrorFindingField", field ) );
      }
    }
  }

  /**
   * Calculate headers
   *
   * @throws KettleException
   */
  private void calcHeaders() throws KettleException {
    int nrArgs = meta.getHeaderName() == null ? 0 : meta.getHeaderName().length;
    if ( nrArgs > 0 ) {
      data.nrheader = nrArgs;

View on GitHub (pinned to f3058517a1)