{"record":{"id":"523f365301ee9fe7","repo":"flowable/flowable-engine","slug":"error-adding-model-editor-source-extra","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/ModelSourceExtraResource.java","lineNumber":96,"sourceCode":"        Model model = getModelFromRequest(modelId);\n        try {\n\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            repositoryService.addModelEditorSourceExtra(model.getId(), file.getBytes());\n\n        } catch (Exception e) {\n            throw new FlowableException(\"Error adding model editor source extra\", e);\n        }\n    }\n\n}\n","sourceCodeStart":78,"sourceCodeEnd":101,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-rest/src/main/java/org/flowable/rest/service/api/repository/ModelSourceExtraResource.java#L78-L101","documentation":"Generic FlowableException wrapping any exception raised while storing the extra editor source (repositoryService.addModelEditorSourceExtra). The original cause is attached and typically indicates a database or IO problem rather than a client error.","triggerScenarios":"addModelEditorSourceExtra throws — e.g. database connection failure, model id deleted between the lookup and the write, transaction/rollback issues, or errors reading the uploaded file bytes (file.getBytes()).","commonSituations":"DB down or locked during deploy scripts; model deleted concurrently; oversized upload exceeding DB column or container limits; disk/memory failures in the servlet container.","solutions":["Inspect the wrapped cause ('Caused by') in the server log for the real failure","Verify database connectivity and that ACT_RE_MODEL still contains the model id","Check upload size limits (server max-file-size, DB column size) and retry with a smaller payload","Retry the request once the underlying DB/IO issue is fixed"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { setModelSource(...); } catch (FlowableException e) { log.error(\"storage failed\", e.getCause()); /* inspect cause: DB/IO */ }","preventionTips":["Monitor database health during deploys","Keep upload sizes within DB column and server limits","Retry writes after transient DB failures","Log the full cause chain"],"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"}