{"record":{"id":"0f346a511be1c7a9","repo":"pentaho/pentaho-kettle","slug":"httppost-exception-couldnotfindrequestentityfield","errorCode":null,"errorMessage":"HTTPPOST.Exception.CouldnotFindRequestEntityField","messagePattern":"HTTPPOST\\.Exception\\.CouldnotFindRequestEntityField","errorType":"exception","errorClass":"KettleStepException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/httppost/HTTPPOST.java","lineNumber":459,"sourceCode":"        for ( int i = 0; i < nrQuery; i++ ) {\n          data.query_parameters_nrs[ i ] = data.inputRowMeta.indexOfValue( meta.getQueryField()[ i ] );\n          if ( data.query_parameters_nrs[ i ] < 0 ) {\n            logError(\n              BaseMessages.getString( PKG, \"HTTPPOST.Log.ErrorFindingField\" ) + meta.getQueryField()[ i ] + \"]\" );\n            throw new KettleStepException( BaseMessages.getString( PKG, \"HTTPPOST.Exception.CouldnotFindField\", meta\n              .getQueryField()[ i ] ) );\n          }\n          data.queryParameters[ i ] =\n            new BasicNameValuePair( environmentSubstitute( meta.getQueryParameter()[ i ] ),\n              data.outputRowMeta.getString( r,\n                data.query_parameters_nrs[ i ] ) );\n        }\n      }\n      // set request entity?\n      if ( !Utils.isEmpty( meta.getRequestEntity() ) ) {\n        data.indexOfRequestEntity = data.inputRowMeta.indexOfValue( environmentSubstitute( meta.getRequestEntity() ) );\n        if ( data.indexOfRequestEntity < 0 ) {\n          throw new KettleStepException( BaseMessages.getString( PKG,\n            \"HTTPPOST.Exception.CouldnotFindRequestEntityField\", meta.getRequestEntity() ) );\n        }\n      }\n      data.realEncoding = environmentSubstitute( meta.getEncoding() );\n    } // end if first\n\n    try {\n      Object[] outputRowData = callHTTPPOST( r );\n      putRow( data.outputRowMeta, outputRowData ); // copy row to output rowset(s);\n\n      if ( checkFeedback( getLinesRead() ) ) {\n        if ( isDetailed() ) {\n          logDetailed( BaseMessages.getString( PKG, \"HTTPPOST.LineNumber\" ) + getLinesRead() );\n        }\n      }\n    } catch ( KettleException e ) {\n      boolean sendToErrorRow = false;\n      String errorMessage = null;","sourceCodeStart":441,"sourceCodeEnd":477,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/httppost/HTTPPOST.java#L441-L477","documentation":"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.","triggerScenarios":"processRow, when !Utils.isEmpty(meta.getRequestEntity()), computes data.indexOfRequestEntity = inputRowMeta.indexOfValue(environmentSubstitute(meta.getRequestEntity())); if < 0, throws at line 459.","commonSituations":"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.","solutions":["Set the request entity field to a field present in the input stream.","Fix the environment variable value so it resolves to the real field name.","Recreate the body content field upstream (e.g. 'Add constants' or 'JavaScript'/UDJE step).","Preview upstream rows to confirm the field exists with the exact name."],"exampleFix":"// before\nrequestEntity=\"${BODY_FIELD}\"; // env var unset -> resolves to wrong name\n// after\nrequestEntity=\"json_payload\"; // or set BODY_FIELD=json_payload in the environment","handlingStrategy":"validation","validationCode":"String entityField = environmentSubstitute(meta.getRequestEntity());\nif (entityField != null && !entityField.isEmpty()\n    && transMeta.getPrevStepFields(stepName).indexOfValue(entityField) < 0)\n  throw new KettleException(\"Request entity field not found: \" + entityField);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure env vars used in field names resolve at runtime","Stabilize body-field names across environments"],"tags":["pentaho","configuration","request-body","http-post"],"backgroundTag":"resource-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}