{"record":{"id":"fcf9981acbdb82c0","repo":"pentaho/pentaho-kettle","slug":"rest-exception-methodfieldmissing","errorCode":"Rest.Exception.MethodFieldMissing","errorMessage":"Rest.Exception.MethodFieldMissing","messagePattern":"Rest\\.Exception\\.MethodFieldMissing","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java","lineNumber":503,"sourceCode":"            BaseMessages.getString( PKG, \"Rest.Exception.ErrorFindingField\", realUrlfieldName ) );\n        }\n      }\n    } else {\n      // Static URL\n      data.realUrl = environmentSubstitute( meta.getUrl() );\n    }\n  }\n\n  /**\n   * Calculate method\n   *\n   * @throws KettleException\n   */\n  private void calcMethod() throws KettleException {\n    if ( meta.isDynamicMethod() ) {\n      String field = environmentSubstitute( meta.getMethodFieldName() );\n      if ( Utils.isEmpty( field ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"Rest.Exception.MethodFieldMissing\" ) );\n      }\n      data.indexOfMethod = data.inputRowMeta.indexOfValue( field );\n      if ( data.indexOfMethod < 0 ) {\n        // The field is unreachable !\n        throw new KettleException( BaseMessages.getString( PKG, \"Rest.Exception.ErrorFindingField\", field ) );\n      }\n    }\n  }\n\n  /**\n   * Calculate headers\n   *\n   * @throws KettleException\n   */\n  private void calcHeaders() throws KettleException {\n    int nrArgs = meta.getHeaderName() == null ? 0 : meta.getHeaderName().length;\n    if ( nrArgs > 0 ) {\n      data.nrheader = nrArgs;","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/rest/core/src/main/java/org/pentaho/di/trans/steps/rest/Rest.java#L485-L521","documentation":"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).","triggerScenarios":"meta.isDynamicMethod() is true and environmentSubstitute(meta.getMethodFieldName()) is null or empty during processRow.","commonSituations":"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.","solutions":["Open the REST step, and with dynamic method enabled select the incoming field containing the HTTP method (GET/POST/...).","If the method should be fixed, disable dynamic method and choose the method from the dropdown instead.","Check that the variable used for the method field name is defined in the runtime environment."],"exampleFix":"// before\ndynamic_method=true; method_field_name=\"\"      // throws\n// after\ndynamic_method=true; method_field_name=\"http_verb\"","handlingStrategy":"validation","validationCode":"// Check metadata before running\nif (restMeta.isDynamicMethod() && (restMeta.getMethodFieldName() == null || restMeta.getMethodFieldName().trim().isEmpty())) {\n  throw new IllegalStateException(\"REST step: method field name required when dynamic method is enabled\");\n}","typeGuard":null,"tryCatchPattern":"try { processRow(); } catch (KettleException e) {\n  if (e.getMessage().contains(\"Method field name is missing\")) { /* set the method field in the dialog */ }\n  throw e;\n}","preventionTips":["Enable dynamic method only together with an upstream step (e.g. Value Mapper) that guarantees the method column.","Validate the transformation before scheduling.","Confirm any variable used for the field name is defined at runtime."],"tags":["configuration","http-method","kettle","missing-field"],"backgroundTag":"missing-required-config-field","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"}