{"record":{"id":"1ca89b6d47e9e2aa","repo":"flowable/flowable-engine","slug":"file-must-be-of-type-dmn","errorCode":null,"errorMessage":"File must be of type .dmn","messagePattern":"File must be of type \\.dmn","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DmnDeploymentCollectionResource.java","lineNumber":187,"sourceCode":"            throw new FlowableIllegalArgumentException(\"Multipart request with file content is required\");\n        }\n\n        MultipartFile file = multipartRequest.getFileMap().values().iterator().next();\n\n        try {\n            DmnDeploymentBuilder deploymentBuilder = dmnRepositoryService.createDeployment();\n            String fileName = file.getOriginalFilename();\n            if (StringUtils.isEmpty(fileName) || !DmnResourceUtil.isDmnResource(fileName)) {\n                fileName = file.getName();\n            }\n\n            if (DmnResourceUtil.isDmnResource(fileName)) {\n                try (final InputStream fileInputStream = file.getInputStream()) {\n                    deploymentBuilder.addInputStream(fileName, fileInputStream);\n                }\n                \n            } else {\n                throw new FlowableIllegalArgumentException(\"File must be of type .dmn\");\n            }\n            \n            deploymentBuilder.name(fileName);\n\n            if (tenantId != null) {\n                deploymentBuilder.tenantId(tenantId);\n            }\n\n            if (restApiInterceptor != null) {\n                restApiInterceptor.enhanceDeployment(deploymentBuilder);\n            }\n\n            DmnDeployment deployment = deploymentBuilder.deploy();\n\n            return dmnRestResponseFactory.createDmnDeploymentResponse(deployment);\n\n        } catch (Exception e) {\n            if (e instanceof FlowableException) {","sourceCodeStart":169,"sourceCodeEnd":205,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-dmn-rest/src/main/java/org/flowable/dmn/rest/service/api/repository/DmnDeploymentCollectionResource.java#L169-L205","documentation":"The uploaded deployment file's name failed DmnResourceUtil.isDmnResource(name), i.e. it does not end with the .dmn (or accepted DMN) extension. Flowable only accepts files recognized as DMN resources when creating a deployment via this REST endpoint and throws FlowableIllegalArgumentException otherwise.","triggerScenarios":"Uploading a file with extension .xml, .txt, .bpmn, or .dmn.xml-variant not matched by isDmnResource to POST /dmn-repository/deployments.","commonSituations":"Renaming BPMN files to deploy into the DMN app, exporting models with wrong extensions, uploading zipped files (.zip/.bar) where the endpoint expects a single .dmn resource, or missing file extension after download.","solutions":["Rename the file so it ends in .dmn before uploading.","Verify the content is DMN XML, not BPMN or another format.","If deploying a package (.bar/.zip) with mixed resources, use the appropriate deployment path or split it.","Check DmnResourceUtil.isDmnResource for the exact accepted suffixes in your Flowable version."],"exampleFix":"// before\ncurl -F 'file=@decision.xml' http://host/dmn-repository/deployments\n// after\ncp decision.xml decision.dmn\ncurl -F 'file=@decision.dmn' http://host/dmn-repository/deployments","handlingStrategy":"validation","validationCode":"if (!fileName.toLowerCase().endsWith('.dmn')) throw new Error('only .dmn files are accepted for DMN deployments');","typeGuard":null,"tryCatchPattern":"try { return await deploy(file); }\ncatch (e) { if (/must be of type .dmn/.test(e.message)) { console.error(`rename ${file.name} to ${file.name}.dmn`); } throw e; }","preventionTips":["Ensure exported models carry the .dmn extension","Do not upload BPMN or zip files to the DMN deployments endpoint","Validate file extension client-side before upload","Check the accepted suffixes for your Flowable version"],"tags":["rest-api","file-extension","validation","dmn"],"backgroundTag":"invalid-argument-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"}