{"record":{"id":"831ce489c0ccd03b","repo":"flowable/flowable-engine","slug":"invalid-message-conversion-exception-error-id","errorCode":null,"errorMessage":"Invalid Message conversion exception. Error ID: {}. Message: {}, Request: {} {}","messagePattern":"Invalid Message conversion exception\\. Error ID: (.+?)\\. Message: (.+?), Request: (.+?) (.+?)","errorType":"console","errorClass":null,"httpStatus":400,"severity":"warning","filePath":"modules/flowable-common-rest/src/main/java/org/flowable/common/rest/exception/BaseExceptionHandlerAdvice.java","lineNumber":121,"sourceCode":"    public ErrorInfo handleIllegalState(FlowableIllegalStateException e, HttpServletRequest request) {\n        if (logger.isDebugEnabled()) {\n            logger.debug(\"Illegal state. Message: {}, Request: {} {}\", e.getMessage(), request.getMethod(), request.getRequestURI());\n        }\n        return new ErrorInfo(\"Bad request\", e);\n    }\n\n    @ResponseStatus(HttpStatus.BAD_REQUEST) // 400\n    @ExceptionHandler(HttpMessageConversionException.class)\n    @ResponseBody\n    public ErrorInfo handleBadMessageConversion(HttpMessageConversionException e, HttpServletRequest request) {\n        if (sendFullErrorException) {\n            if (logger.isDebugEnabled()) {\n                logger.debug(\"Invalid message conversion. Message: {}, Request: {} {}\", e.getMessage(), request.getMethod(), request.getRequestURI());\n            }\n            return new ErrorInfo(\"Bad request\", e);\n        } else {\n            String errorIdentifier = UUID.randomUUID().toString();\n            logger.warn(\"Invalid Message conversion exception. Error ID: {}. Message: {}, Request: {} {}\", errorIdentifier, e.getMessage(), request.getMethod(), request.getRequestURI());\n            ErrorInfo errorInfo = new ErrorInfo(\"Bad request\", null);\n            errorInfo.setException(\"Invalid HTTP message. Error ID: \" + errorIdentifier);\n            return errorInfo;\n        }\n    }\n\n    @ResponseStatus(HttpStatus.CONFLICT) // 409\n    @ExceptionHandler(FlowableTaskAlreadyClaimedException.class)\n    @ResponseBody\n    public ErrorInfo handleTaskAlreadyClaimed(FlowableTaskAlreadyClaimedException e, HttpServletRequest request) {\n        if (logger.isDebugEnabled()) {\n            logger.debug(\"Task was already claimed. Message: {}, Request: {} {}\", e.getMessage(), request.getMethod(), request.getRequestURI());\n        }\n        return new ErrorInfo(\"Task was already claimed\", e);\n    }\n\n    // Fall back\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-common-rest/src/main/java/org/flowable/common/rest/exception/BaseExceptionHandlerAdvice.java#L103-L139","documentation":"handleBadMessageConversion in BaseExceptionHandlerAdvice logs this warning and returns a generic 'Bad request' ErrorInfo when an HttpMessageConversionException occurs handling a REST request. In non-debug mode the client only receives an anonymous 'Invalid HTTP message. Error ID: <uuid>' so the real cause stays server-side for correlation via the logged Error ID.","triggerScenarios":"A REST client sends a request body that cannot be converted to the endpoint's expected type — malformed JSON, wrong Content-Type, or a payload violating Jackson binding — and the exception is not an HttpMediaTypeNotSupportedException subclass.","commonSituations":"Sending invalid JSON to REST API endpoints (e.g. Flowable REST task/process APIs); missing or wrong Content-Type header; payload using unsupported field types or date formats.","solutions":["Validate the request body is well-formed JSON matching the endpoint's expected DTO.","Set the correct Content-Type header (application/json) and matching HTTP method.","Check server logs for the logged Error ID to find the underlying conversion message.","If a serializer upgrade caused it, align client field names/date formats with the server's Jackson configuration."],"exampleFix":"// before\ncurl -X POST http://host/flowable-rest/tasks -d '{bad json' -H 'Content-Type: text/plain'\n// after\ncurl -X POST http://host/flowable-rest/tasks -d '{\"name\":\"My task\"}' -H 'Content-Type: application/json'","handlingStrategy":"try-catch","validationCode":"// client-side pre-validation\nJSON.parse(requestBody); // must not throw\nif (!requestBody.trim().startsWith(\"{\")) throw new Error(\"Body must be a JSON object\");","typeGuard":"function isJsonObject(body) { try { return typeof JSON.parse(body) === \"object\"; } catch { return false; } }","tryCatchPattern":"try { const res = await fetch(url, { headers: { \"Content-Type\": \"application/json\" }, body }); } catch (e) { console.error(\"Bad request payload\", e); }","preventionTips":["Always send Content-Type: application/json with JSON bodies.","Validate payloads against the REST API's DTO schema before sending.","Correlate returned Error IDs with server logs when debugging."],"tags":["rest","http","json","message-conversion","bad-request"],"backgroundTag":"invalid-json-response","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"}