{"record":{"id":"1864d9e46ca0dbd7","repo":"flowable/flowable-engine","slug":"unsupported-multipart-mode-mode-supported-val-1864d9","errorCode":null,"errorMessage":"Unsupported multipart mode: ${mode}. Supported values are: STRICT, BROWSER_COMPATIBLE, LEGACY, EXTENDED","messagePattern":"Unsupported multipart mode: (.+?)\\. Supported values are: STRICT, BROWSER_COMPATIBLE, LEGACY, EXTENDED","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/apache/client5/ApacheHttpComponents5FlowableHttpClient.java","lineNumber":173,"sourceCode":"\n    public ApacheHttpComponents5FlowableHttpClient(HttpAsyncClient client, int socketTimeout, int connectTimeout,\n            int connectionRequestTimeout) {\n        this.client = client;\n        this.multipartMode = HttpMultipartMode.STRICT;\n        this.socketTimeout = socketTimeout;\n        this.connectTimeout = connectTimeout;\n        this.connectionRequestTimeout = connectionRequestTimeout;\n    }\n\n    protected static HttpMultipartMode resolveMultipartMode(String mode) {\n        if (mode == null) {\n            return HttpMultipartMode.STRICT;\n        }\n        return switch (mode.toUpperCase()) {\n            case \"BROWSER_COMPATIBLE\", \"LEGACY\" -> HttpMultipartMode.LEGACY;\n            case \"STRICT\" -> HttpMultipartMode.STRICT;\n            case \"EXTENDED\" -> HttpMultipartMode.EXTENDED;\n            default -> throw new FlowableIllegalArgumentException(\"Unsupported multipart mode: \" + mode\n                    + \". Supported values are: STRICT, BROWSER_COMPATIBLE, LEGACY, EXTENDED\");\n        };\n    }\n\n    public void close() {\n        if (closeClient && client instanceof ModalCloseable) {\n            ((ModalCloseable) client).close(CloseMode.GRACEFUL);\n        }\n    }\n\n    @Override\n    public AsyncExecutableHttpRequest prepareRequest(HttpRequest requestInfo) {\n        try {\n            AsyncRequestBuilder request;\n            URI uri = createUri(requestInfo.getUrl());\n            switch (requestInfo.getMethod()) {\n                case \"GET\": {\n                    request = AsyncRequestBuilder.get(uri);","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-http-common/src/main/java/org/flowable/http/common/impl/apache/client5/ApacheHttpComponents5FlowableHttpClient.java#L155-L191","documentation":"The HttpClient 5.x Flowable client resolves an optional configured multipart mode into Apache's `HttpMultipartMode` enum. When the configured `mode` string (upper-cased) does not map to STRICT, BROWSER_COMPATIBLE, LEGACY, or EXTENDED, `resolveMultipartMode` throws this `FlowableIllegalArgumentException`.","triggerScenarios":"Constructing/configuring `ApacheHttpComponents5FlowableHttpClient` with a multipart mode option set to an unrecognized value such as \"RFC6532\", \"browser\", \"strict \" (trailing space), or any misspelling.","commonSituations":"Copy-pasting multipart-mode settings from HttpClient 4.x docs that mention modes not in this switch; typos or wrong casing plus stray whitespace in YAML/properties config.","solutions":["Set the multipart mode to exactly one of STRICT, BROWSER_COMPATIBLE, LEGACY, or EXTENDED (case-insensitive, no extra characters).","Remove the multipart-mode setting entirely to get the default (STRICT).","Trim/normalize the config value at load time if it comes from user-supplied properties."],"exampleFix":"// before (config)\nmultipart-mode=RFC6532\n\n// after\nmultipart-mode=STRICT","handlingStrategy":"validation","validationCode":"Set<String> allowed = Set.of(\"STRICT\", \"BROWSER_COMPATIBLE\", \"LEGACY\", \"EXTENDED\");\nif (mode != null && !allowed.contains(mode.trim().toUpperCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"multipart mode must be one of \" + allowed + \", got: \" + mode);\n}","typeGuard":null,"tryCatchPattern":"try {\n    client = new ApacheHttpComponents5FlowableHttpClient(builder.build());\n} catch (FlowableIllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Unsupported multipart mode\")) {\n        log.error(\"Fix multipart-mode config to STRICT|BROWSER_COMPATIBLE|LEGACY|EXTENDED\");\n    }\n    throw e;\n}","preventionTips":["Keep multipart-mode values in a constant/enum in your configuration layer.","Trim and upper-case config values before passing them to the client.","Prefer omitting the setting to get the STRICT default."],"tags":["config","enum","multipart","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-18T11:17:12.947Z"}