{"record":{"id":"99cfb26131addeda","repo":"flowable/flowable-engine","slug":"file-must-be-of-type-event-channel","errorCode":null,"errorMessage":"File must be of type .event, .channel","messagePattern":"File must be of type \\.event, \\.channel","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":400,"severity":"error","filePath":"modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java","lineNumber":199,"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            EventDeploymentBuilder deploymentBuilder = repositoryService.createDeployment();\n            String fileName = file.getOriginalFilename();\n            if (StringUtils.isEmpty(fileName) || !(fileName.endsWith(\".event\") || fileName.endsWith(\".channel\"))) {\n                fileName = file.getName();\n            }\n\n            if (fileName.endsWith(\".event\") || fileName.endsWith(\".channel\")) {\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 .event, .channel\");\n            }\n\n            if (!decodedQueryStrings.containsKey(\"deploymentName\") || StringUtils.isEmpty(decodedQueryStrings.get(\"deploymentName\"))) {\n                String fileNameWithoutExtension = fileName.split(\"\\\\.\")[0];\n\n                if (StringUtils.isNotEmpty(fileNameWithoutExtension)) {\n                    fileName = fileNameWithoutExtension;\n                }\n\n                deploymentBuilder.name(fileName);\n                \n            } else {\n                deploymentBuilder.name(decodedQueryStrings.get(\"deploymentName\"));\n            }\n\n            if (decodedQueryStrings.containsKey(\"category\") || StringUtils.isNotEmpty(decodedQueryStrings.get(\"category\"))) {\n                deploymentBuilder.category(decodedQueryStrings.get(\"category\"));\n            }","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-event-registry-rest/src/main/java/org/flowable/eventregistry/rest/service/api/repository/DeploymentCollectionResource.java#L181-L217","documentation":"Flowable's event-registry REST deployment endpoint only accepts files ending in .event or .channel. Any other file extension is rejected with FlowableIllegalArgumentException during deployment upload. This guards the registry from storing resources it cannot interpret.","triggerScenarios":"POSTing a multipart file to the deployment collection endpoint whose filename lacks the .event or .channel extension (e.g. .xml, .json, .event.bak).","commonSituations":"Uploading generic model JSON instead of the exported event/channel file; renaming files before upload; using uppercase extensions like .EVENT; script wrappers that append timestamps to filenames.","solutions":["Rename the uploaded file so it ends with .event or .channel (lowercase).","Ensure the export/download pipeline preserves the original extension (no suffixes appended).","Check the multipart filename sent by the client, since the check uses the submitted file name not the content.","If the resource is genuinely not an event/channel definition, use the appropriate deployment endpoint (e.g. process/DMN) instead."],"exampleFix":"// before\ncurl -F \"file=@event-model.json\" .../repository/deployments\n// after\ncurl -F \"file=@event-model.event\" .../repository/deployments","handlingStrategy":"validation","validationCode":"if (!fileName.endsWith(\".event\") && !fileName.endsWith(\".channel\")) {\n    throw new IllegalArgumentException(\"Rename file to .event or .channel before upload: \" + fileName);\n}","typeGuard":"boolean isDeployable(String name) {\n    return name != null && (name.endsWith(\".event\") || name.endsWith(\".channel\"));\n}","tryCatchPattern":"try {\n    uploadDeployment(file);\n} catch (FlowableIllegalArgumentException e) {\n    logger.error(\"Unsupported file type for event registry deployment\", e);\n}","preventionTips":["Keep original extensions through export/pipeline steps","Check filename extension client-side before upload","Avoid appending suffixes (timestamps, env) to uploaded filenames"],"tags":["rest","validation","event-registry"],"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"}