{"record":{"id":"030b6ed001d99817","repo":"flowable/flowable-engine","slug":"error-adding-model-editor-source-extra-030b6e","errorCode":null,"errorMessage":"Error adding model editor source extra","messagePattern":"Error adding model editor source extra","errorType":"http","errorClass":"FlowableException","httpStatus":500,"severity":"error","filePath":"modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelSourceResource.java","lineNumber":96,"sourceCode":"    @ResponseStatus(HttpStatus.NO_CONTENT)\n    public void setModelSource(@ApiParam(name = \"modelId\") @PathVariable String modelId, HttpServletRequest request) {\n        Model model = getModelFromRequest(modelId);\n        if (!(request instanceof MultipartHttpServletRequest)) {\n                throw new FlowableIllegalArgumentException(\"Multipart request is required\");\n        }\n\n        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;\n\n        if (multipartRequest.getFileMap().size() == 0) {\n            throw new FlowableIllegalArgumentException(\"Multipart request with file content is required\");\n        }\n\n        MultipartFile file = multipartRequest.getFileMap().values().iterator().next();\n\n        try {\n            repositoryService.addModelEditorSource(model.getId(), file.getBytes());\n        } catch (Exception e) {\n            throw new FlowableException(\"Error adding model editor source extra\", e);\n        }\n    }\n}\n","sourceCodeStart":78,"sourceCodeEnd":100,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelSourceResource.java#L78-L100","documentation":"Generic FlowableException wrapping any failure while persisting the model editor source via repositoryService.addModelEditorSource. Despite the message saying 'extra', this endpoint stores the plain source; the cause carries the real error.","triggerScenarios":"addModelEditorSource throws — database connectivity/transaction failures, the model being deleted concurrently, failures reading the uploaded bytes, or storage size limits exceeded.","commonSituations":"DB outage during CI deploys; very large source files exceeding column or servlet limits; concurrent model deletion in race conditions.","solutions":["Check the 'Caused by' chain in the server log for the root cause","Verify DB health and that the model still exists (GET /repository/models/{modelId})","Reduce payload size or raise max-file-size/column limits as appropriate","Retry after resolving the underlying database/IO issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { setModelSource(...); } catch (FlowableException e) { log.error(\"addModelEditorSource failed\", e.getCause()); /* retry after DB recovery */ }","preventionTips":["Check the wrapped cause for the real error","Ensure the model exists before writing source","Watch for size limits on uploads","Add retry logic for transient DB errors"],"tags":["flowable","rest","database","internal-error"],"backgroundTag":"database-write-failed","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"}