apache/dolphinscheduler · error · IllegalArgumentException

url can not be null

Error message

url can not be null

What it means

HttpAlert's paramsValidator requires the 'url' parameter to be a non-blank string. If HttpAlertConstants.NAME_URL is missing or blank, it throws IllegalArgumentException('url can not be null') when the HTTP alert plugin instance is constructed.

Source

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

@Slf4j
public final class HttpSender {

    private Map<String, String> headerParams;
    private OkHttpRequestHeaderContentType contentType;
    private Map<String, Object> bodyParams;
    private HttpRequestMethod requestType;
    private int timeout;
    private String url;

    HttpSender(Map<String, String> paramsMap) {
        paramsValidator(paramsMap);
    }

    private void paramsValidator(Map<String, String> paramsMap) {
        url = paramsMap.get(HttpAlertConstants.NAME_URL);
        if (StringUtils.isBlank(url)) {
            throw new IllegalArgumentException("url can not be null");
        }

        String headerParamsString = paramsMap.get(HttpAlertConstants.NAME_HEADER_PARAMS);
        if (StringUtils.isNotBlank(headerParamsString)) {
            headerParams = JSONUtils.toMap(headerParamsString);
            if (headerParams == null) {
                throw new IllegalArgumentException("headerParams is not a valid json");
            }
        } 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");

View on GitHub (pinned to 02eac45a1b)

Solutions

  1. Set the url field in the HTTP alert instance configuration to the full target endpoint.
  2. Validate the alert params JSON contains HttpAlertConstants.NAME_URL before saving the alert instance.
  3. Test the alert instance from the UI after configuration to fail fast.

Example fix

// before
{"requestType":"POST"}
// after
{"url":"https://example.com/webhook", "requestType":"POST"}
Defensive patterns

Strategy: validation

Validate before calling

if (paramsMap.get("url") == null || paramsMap.get("url").isBlank()) throw new IllegalArgumentException("url is required for http alert");

Try / catch

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

Prevention

When it happens

Trigger: Creating an HTTP alert instance whose params map has no 'url' key or url='' / whitespace only.

Common situations: HTTP alert plugin configured in the UI without the target webhook URL; params JSON edited manually dropping the url 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 apache/dolphinscheduler@02eac45a1b (2026-09-06). Data as JSON: /api/errors/6866da72766fbf36. Report an issue: GitHub.