{"record":{"id":"6866da72766fbf36","repo":"apache/dolphinscheduler","slug":"url-can-not-be-null","errorCode":null,"errorMessage":"url can not be null","messagePattern":"url can not be null","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java","lineNumber":59,"sourceCode":"\n@Slf4j\npublic final class HttpSender {\n\n    private Map<String, String> headerParams;\n    private OkHttpRequestHeaderContentType contentType;\n    private Map<String, Object> bodyParams;\n    private HttpRequestMethod requestType;\n    private int timeout;\n    private String url;\n\n    HttpSender(Map<String, String> paramsMap) {\n        paramsValidator(paramsMap);\n    }\n\n    private void paramsValidator(Map<String, String> paramsMap) {\n        url = paramsMap.get(HttpAlertConstants.NAME_URL);\n        if (StringUtils.isBlank(url)) {\n            throw new IllegalArgumentException(\"url can not be null\");\n        }\n\n        String headerParamsString = paramsMap.get(HttpAlertConstants.NAME_HEADER_PARAMS);\n        if (StringUtils.isNotBlank(headerParamsString)) {\n            headerParams = JSONUtils.toMap(headerParamsString);\n            if (headerParams == null) {\n                throw new IllegalArgumentException(\"headerParams is not a valid json\");\n            }\n        } else {\n            headerParams = new HashMap<>();\n        }\n\n        String bodyParamsString = paramsMap.get(HttpAlertConstants.NAME_BODY_PARAMS);\n        if (StringUtils.isNotBlank(bodyParamsString)) {\n            bodyParams = JSONUtils.parseObject(bodyParamsString, new TypeReference<Map<String, Object>>() {\n            });\n            if (bodyParams == null) {\n                throw new IllegalArgumentException(\"bodyParams is not a valid json\");","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-alert/dolphinscheduler-alert-plugins/dolphinscheduler-alert-http/src/main/java/org/apache/dolphinscheduler/plugin/alert/http/HttpSender.java#L41-L77","documentation":"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.","triggerScenarios":"Creating an HTTP alert instance whose params map has no 'url' key or url='' / whitespace only.","commonSituations":"HTTP alert plugin configured in the UI without the target webhook URL; params JSON edited manually dropping the url field.","solutions":["Set the url field in the HTTP alert instance configuration to the full target endpoint.","Validate the alert params JSON contains HttpAlertConstants.NAME_URL before saving the alert instance.","Test the alert instance from the UI after configuration to fail fast."],"exampleFix":"// before\n{\"requestType\":\"POST\"}\n// after\n{\"url\":\"https://example.com/webhook\", \"requestType\":\"POST\"}","handlingStrategy":"validation","validationCode":"if (paramsMap.get(\"url\") == null || paramsMap.get(\"url\").isBlank()) throw new IllegalArgumentException(\"url is required for http alert\");","typeGuard":null,"tryCatchPattern":"try { new HttpAlert(paramsMap); } catch (IllegalArgumentException e) { log.error(\"http alert config invalid\", e); }","preventionTips":["Always set url when creating HTTP alert instances","Validate params JSON before persisting","Test the alert instance after configuration"],"tags":["configuration","http","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}