{"record":{"id":"d0590d45481e41f9","repo":"apache/dolphinscheduler","slug":"contenttype-is-not-a-valid-value","errorCode":null,"errorMessage":"contentType is not a valid value","messagePattern":"contentType is not a valid value","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":91,"sourceCode":"        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\");\n            }\n        } else {\n            bodyParams = new HashMap<>();\n        }\n\n        try {\n            requestType = HttpRequestMethod.valueOf(paramsMap.get(HttpAlertConstants.NAME_REQUEST_TYPE));\n        } catch (IllegalArgumentException e) {\n            throw new IllegalArgumentException(\"requestType is not a valid value\");\n        }\n\n        contentType = OkHttpRequestHeaderContentType.fromValue(paramsMap.get(HttpAlertConstants.NAME_CONTENT_TYPE));\n        if (contentType == null) {\n            throw new IllegalArgumentException(\"contentType is not a valid value\");\n        }\n\n        timeout = (StringUtils.isNotBlank(paramsMap.get(HttpAlertConstants.NAME_TIMEOUT))\n                ? Integer.parseInt(paramsMap.get(HttpAlertConstants.NAME_TIMEOUT))\n                : HttpAlertConstants.DEFAULT_TIMEOUT) * 1000;\n    }\n\n    AlertResult send(String msg) {\n\n        AlertResult alertResult = new AlertResult();\n        OkHttpResponse okHttpResponse;\n\n        try {\n            okHttpResponse = sendHttpRequest(msg);\n        } catch (RuntimeException e) {\n            throw new RuntimeException(e);\n        }\n","sourceCodeStart":73,"sourceCodeEnd":109,"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#L73-L109","documentation":"paramsValidator resolves contentType via OkHttpRequestHeaderContentType.fromValue; if the value is not a known content type, fromValue returns null and IllegalArgumentException('contentType is not a valid value') is thrown.","triggerScenarios":"contentType param is absent or set to a string not matching any OkHttpRequestHeaderContentType constant (e.g. 'application/x-www-form-urlencoded' when only JSON/other fixed values are supported).","commonSituations":"User enters a full MIME type that the enum does not define; contentType field left empty while sending a JSON body.","solutions":["Set contentType to one of the values supported by OkHttpRequestHeaderContentType in your version (e.g. the JSON content type constant).","Check the enum source in your DolphinScheduler version for the exact accepted strings.","Upgrade if a needed content type was added in a newer release."],"exampleFix":"// before\ncontentType=text/html\n// after\ncontentType=application/json","handlingStrategy":"validation","validationCode":"String ct = paramsMap.get(\"contentType\");\nif (OkHttpRequestHeaderContentType.fromValue(ct) == null) throw new IllegalArgumentException(\"unsupported contentType: \" + ct);","typeGuard":null,"tryCatchPattern":"try { new HttpAlert(paramsMap); } catch (IllegalArgumentException e) { log.error(\"invalid contentType\", e); }","preventionTips":["Use a content type value supported by OkHttpRequestHeaderContentType","Consult the enum source for exact accepted strings","Prefer the UI dropdown values over free-text MIME types"],"tags":["http","content-type","enum"],"backgroundTag":"invalid-enum-value","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"}