pentaho/pentaho-kettle · error · KettleStepException

HTTPPOST.Exception.CouldnotFindRequestEntityField

Error message

HTTPPOST.Exception.CouldnotFindRequestEntityField

What it means

When a request-entity (body source) field is configured, the step looks it up in the input row and throws KettleStepException with 'HTTPPOST.Exception.CouldnotFindRequestEntityField' if indexOfValue returns -1. The message includes the (environment-substituted source of the) configured entity field name.

Solutions

  1. Set the request entity field to a field present in the input stream.
  2. Fix the environment variable value so it resolves to the real field name.
  3. Recreate the body content field upstream (e.g. 'Add constants' or 'JavaScript'/UDJE step).
  4. Preview upstream rows to confirm the field exists with the exact name.

Example fix

// before
requestEntity="${BODY_FIELD}"; // env var unset -> resolves to wrong name
// after
requestEntity="json_payload"; // or set BODY_FIELD=json_payload in the environment
Defensive patterns

Strategy: validation

Validate before calling

String entityField = environmentSubstitute(meta.getRequestEntity());
if (entityField != null && !entityField.isEmpty()
    && transMeta.getPrevStepFields(stepName).indexOfValue(entityField) < 0)
  throw new KettleException("Request entity field not found: " + entityField);

Prevention

When it happens

Trigger: processRow, when !Utils.isEmpty(meta.getRequestEntity()), computes data.indexOfRequestEntity = inputRowMeta.indexOfValue(environmentSubstitute(meta.getRequestEntity())); if < 0, throws at line 459.

Common situations: Body field (e.g. XML/JSON content column) removed or renamed upstream; environment variable used for the field name resolves to a nonexistent field; transformation reused with a different input schema.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at engine/src/main/java/org/pentaho/di/trans/steps/httppost/HTTPPOST.java:459

        for ( int i = 0; i < nrQuery; i++ ) {
          data.query_parameters_nrs[ i ] = data.inputRowMeta.indexOfValue( meta.getQueryField()[ i ] );
          if ( data.query_parameters_nrs[ i ] < 0 ) {
            logError(
              BaseMessages.getString( PKG, "HTTPPOST.Log.ErrorFindingField" ) + meta.getQueryField()[ i ] + "]" );
            throw new KettleStepException( BaseMessages.getString( PKG, "HTTPPOST.Exception.CouldnotFindField", meta
              .getQueryField()[ i ] ) );
          }
          data.queryParameters[ i ] =
            new BasicNameValuePair( environmentSubstitute( meta.getQueryParameter()[ i ] ),
              data.outputRowMeta.getString( r,
                data.query_parameters_nrs[ i ] ) );
        }
      }
      // set request entity?
      if ( !Utils.isEmpty( meta.getRequestEntity() ) ) {
        data.indexOfRequestEntity = data.inputRowMeta.indexOfValue( environmentSubstitute( meta.getRequestEntity() ) );
        if ( data.indexOfRequestEntity < 0 ) {
          throw new KettleStepException( BaseMessages.getString( PKG,
            "HTTPPOST.Exception.CouldnotFindRequestEntityField", meta.getRequestEntity() ) );
        }
      }
      data.realEncoding = environmentSubstitute( meta.getEncoding() );
    } // end if first

    try {
      Object[] outputRowData = callHTTPPOST( r );
      putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);

      if ( checkFeedback( getLinesRead() ) ) {
        if ( isDetailed() ) {
          logDetailed( BaseMessages.getString( PKG, "HTTPPOST.LineNumber" ) + getLinesRead() );
        }
      }
    } catch ( KettleException e ) {
      boolean sendToErrorRow = false;
      String errorMessage = null;

View on GitHub (pinned to f3058517a1)