apache/dolphinscheduler · error · IllegalArgumentException

requestType is not a valid value

Error message

requestType is not a valid value

What it means

paramsValidator converts the 'requestType' parameter to the HttpRequestMethod enum via valueOf. Any name that is not an exact enum constant (GET, POST, etc.) throws an inner IllegalArgumentException which is rethrown as 'requestType is not a valid value'.

Source

Thrown at dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java:86

        } else {
            headerParams = new HashMap<>();
        }

        String bodyParamsString = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS);
        if (StringUtils.isNotBlank(bodyParamsString)) {
            bodyParams = JSONUtils.parseObject(bodyParamsString, new TypeReference<Map<String, Object>>() {
            });
            if (bodyParams == null) {
                throw new IllegalArgumentException("bodyParams is not a valid json");
            }
        } else {
            bodyParams = new HashMap<>();
        }

        try {
            requestType = HttpRequestMethod.valueOf(paramsMap.get(HttpAlertConstants.NAME_REQUEST_TYPE));
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException("requestType is not a valid value");
        }

        contentType = OkHttpRequestHeaderContentType.fromValue(paramsMap.get(HttpAlertConstants.NAME_CONTENT_TYPE));
        if (contentType == null) {
            throw new IllegalArgumentException("contentType is not a valid value");
        }

        timeout = (StringUtils.isNotBlank(paramsMap.get(HttpAlertConstants.NAME_TIMEOUT))
                ? Integer.parseInt(paramsMap.get(HttpAlertConstants.NAME_TIMEOUT))
                : HttpAlertConstants.DEFAULT_TIMEOUT) * 1000;
    }

    AlertResult send(String msg) {

        AlertResult alertResult = new AlertResult();
        OkHttpResponse okHttpResponse;

        try {

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set requestType to an exact, uppercase supported value such as GET, POST, PUT, DELETE (check HttpRequestMethod for the list in your version).
  2. Verify the value is not null or misspelled in the alert params JSON.
  3. Upgrade DolphinScheduler if you need an HTTP method not present in your version's enum.

Example fix

// before
requestType=get
// after
requestType=GET
Defensive patterns

Strategy: validation

Validate before calling

String rt = paramsMap.get("requestType");
if (rt == null || java.util.Arrays.stream(HttpRequestMethod.values()).noneMatch(m -> m.name().equals(rt))) throw new IllegalArgumentException("requestType must be one of GET/POST/...");

Try / catch

try { new HttpAlert(paramsMap); } catch (IllegalArgumentException e) { log.error("invalid requestType", e); }

Prevention

When it happens

Trigger: requestType missing (null -> NullPointerException is not caught, but a wrong string like 'Get'/'PUTT' throws), or any value not matching an HttpRequestMethod constant exactly.

Common situations: Typo or lowercase value in the HTTP alert request type field; selecting a method unsupported by this plugin version (e.g. 'PATCH' on older builds).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


AI-assisted analysis of apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/231f2e5666fe03e9. Report an issue: GitHub.