{"record":{"id":"c9e587f27419543c","repo":"conductor-oss/conductor","slug":"file-is-not-accepting-content-uploads","errorCode":null,"errorMessage":"File is not accepting content uploads: {}","messagePattern":"File is not accepting content uploads: (.+?)","errorType":"exception","errorClass":"ConflictException","httpStatus":409,"severity":"warning","filePath":"core/src/main/java/org/conductoross/conductor/core/storage/FileStorageServiceImpl.java","lineNumber":143,"sourceCode":"                    \"File not yet uploaded: \" + fileId + \", status=\" + model.getUploadStatus());\n        }\n        String downloadUrl =\n                fileStorage.generateDownloadUrl(\n                        model.getStoragePath(), properties.getSignedUrlExpiration());\n        long expiresAt = Instant.now().plus(properties.getSignedUrlExpiration()).toEpochMilli();\n\n        FileDownloadUrlResponse response = new FileDownloadUrlResponse();\n        response.setFileHandleId(FileIdToFileHandleIdConverter.toFileHandleId(fileId));\n        response.setDownloadUrl(downloadUrl);\n        response.setExpiresAt(expiresAt);\n        return response;\n    }\n\n    @Override\n    public void uploadContent(String workflowId, String fileId, InputStream content) {\n        FileModel model = getOwnedFile(workflowId, fileId);\n        if (model.getUploadStatus() != FileUploadStatus.UPLOADING) {\n            throw new ConflictException(\"File is not accepting content uploads: \" + fileId);\n        }\n        fileStorage.writeContent(model.getStoragePath(), content);\n    }\n\n    @Override\n    public FileContent downloadContent(String workflowId, String fileId) {\n        // Family-accessible, like getDownloadUrl: for the Conductor backend that URL is this\n        // endpoint, so requiring the exact owner here would 403 a URL we just handed out.\n        FileModel model = getFamilyAccessibleFile(workflowId, fileId);\n        if (model.getUploadStatus() != FileUploadStatus.UPLOADED) {\n            throw new IllegalArgumentException(\"File has not been uploaded: \" + fileId);\n        }\n        return new FileContent(\n                fileStorage.readContent(model.getStoragePath()),\n                model.getContentType(),\n                model.getStorageContentSize());\n    }\n","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/conductor-oss/conductor/blob/cf7c3e4a8adfb158be778ab1ec525323c363cd3a/core/src/main/java/org/conductoross/conductor/core/storage/FileStorageServiceImpl.java#L125-L161","documentation":"Thrown by FileStorageServiceImpl.uploadContent when the file's upload status is not UPLOADING. Streaming content is only accepted while the file is in the active upload state; once confirmed (UPLOADED) or otherwise advanced, further content uploads are rejected as ConflictException (HTTP 409).","triggerScenarios":"Calling uploadContent after confirmUpload already marked the file UPLOADED; attempting to overwrite content of an already-completed file; the record was advanced out of UPLOADING by another path.","commonSituations":"Client retrying uploadContent after a confirm succeeded; duplicate upload attempts; overwrite attempt on an immutable completed file.","solutions":["Upload content only while status is UPLOADING (i.e. right after createFile and before confirmUpload).","To replace content, create a new file record rather than reusing a completed one.","Treat 409 here as 'already complete' if the prior upload succeeded."],"exampleFix":"// before - uploading to an already-completed file\nfileStorageService.uploadContent(wfId, fileId, in); // throws ConflictException\n\n// after - create a new file to replace content\nFileUploadResponse r = fileStorageService.createFile(req);\nfileStorageService.uploadContent(wfId, r.getFileId(), in);","handlingStrategy":"validation","validationCode":"FileHandle meta = fileStorageService.getFileMetadata(wfId, fileId);\nboolean canUpload = meta.getUploadStatus() == FileUploadStatus.UPLOADING;","typeGuard":null,"tryCatchPattern":"try {\n    fileStorageService.uploadContent(wfId, fileId, in);\n} catch (ConflictException e) {\n    // not in UPLOADING state; create a new file to replace content\n}","preventionTips":["Only stream content while status is UPLOADING","Create a new file record rather than overwriting a completed one"],"tags":["file-storage","upload","state","conflict","conductor","java"],"backgroundTag":null,"analyzedSha":"cf7c3e4a8adfb158be778ab1ec525323c363cd3a","analyzedAt":"2026-08-14T03:33:19.897Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}