{"record":{"id":"d33b3e2d3143343d","repo":"makeplane/plane","slug":"asset-upload-failed-please-try-again-later","errorCode":null,"errorMessage":"Asset upload failed. Please try again later.","messagePattern":"Asset upload failed\\. Please try again later\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/space/store/issue-detail.store.ts","lineNumber":249,"sourceCode":"    } catch (_error) {\n      console.log(\"Failed to add issue vote\");\n    }\n  };\n\n  uploadCommentAsset = async (file: File, anchor: string, commentID?: string) => {\n    try {\n      const res = await this.fileService.uploadAsset(\n        anchor,\n        {\n          entity_identifier: commentID ?? \"\",\n          entity_type: EFileAssetType.COMMENT_DESCRIPTION,\n        },\n        file\n      );\n      return res;\n    } catch (error) {\n      console.log(\"Error in uploading comment asset:\", error);\n      throw new Error(\"Asset upload failed. Please try again later.\");\n    }\n  };\n\n  uploadIssueAsset = async (file: File, anchor: string, commentID?: string) => {\n    try {\n      const res = await this.fileService.uploadAsset(\n        anchor,\n        {\n          entity_identifier: commentID ?? \"\",\n          entity_type: EFileAssetType.ISSUE_DESCRIPTION,\n        },\n        file\n      );\n      return res;\n    } catch (error) {\n      console.log(\"Error in uploading comment asset:\", error);\n      throw new Error(\"Asset upload failed. Please try again later.\");\n    }","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/makeplane/plane/blob/1c8a60f858d8472aa56e29994ec1c7926da2c6ce/apps/space/store/issue-detail.store.ts#L231-L267","documentation":"Thrown by uploadCommentAsset in the Space (public-issue-view) issue-detail store when fileService.uploadAsset rejects during a comment attachment upload. The original error is console.logged and then replaced with a user-facing 'Asset upload failed. Please try again later.' The entity_type is COMMENT_DESCRIPTION and entity_identifier is the commentID (or empty string when absent).","triggerScenarios":"Calling uploadCommentAsset with a file whose upload the backend rejects: file too large (size limit), unsupported MIME type, expired/missing anchor (publish anchor token), the publish settings for that anchor revoked, network drop mid-upload, or S3/presigned-URL failure surfaced as a non-2xx from uploadAsset. Also triggered when commentID is omitted for a flow that requires it (entity_identifier becomes empty string).","commonSituations":"Public viewer attaching a screenshot to a comment on a published issue; anchor (the public-access token in the URL) expired between page load and upload; reverse proxy limiting body size below Plane's asset size cap; user on a flaky mobile network.","solutions":["Check the console: the original error is logged as `Error in uploading comment asset:` immediately before the re-throw — open devtools to see the real HTTP status.","Confirm the publish anchor passed in is still valid (reload the public page to get a fresh anchor) before retrying.","Reduce the file size / change format and retry; most uploadAsset failures on Space are size or type rejections.","If the error persists, verify the Space backend asset endpoint and S3/asset storage are healthy."],"exampleFix":"// before: original cause discarded\n} catch (error) {\n  console.log(\"Error in uploading comment asset:\", error);\n  throw new Error(\"Asset upload failed. Please try again later.\");\n}\n// after: surface the cause so the caller can react (size vs auth vs network)\n} catch (error) {\n  throw new Error(`Asset upload failed: ${error instanceof Error ? error.message : \"unknown\"}`);\n}","handlingStrategy":"validation","validationCode":"// Validate file + anchor before calling uploadCommentAsset\nconst MAX = 5 * 1024 * 1024; // 5MB example\nconst allowed = ['image/png','image/jpeg','image/gif','image/webp'];\nif (file.size > MAX) throw new Error('File too large');\nif (!allowed.includes(file.type)) throw new Error('Unsupported type');\nif (!anchor) throw new Error('Missing publish anchor');","typeGuard":"const hasPublishAnchor = (a: unknown): a is string => typeof a === 'string' && a.length > 0;","tryCatchPattern":"try { await uploadCommentAsset(file, anchor, commentID); }\ncatch (e) { setUploadError('Attachment upload failed. Check size and try again.'); }","preventionTips":["Validate file size/type at the dropzone before invoking the store action.","Reload the public page if the anchor may be stale before attaching.","Inspect the console 'Error in uploading comment asset:' line for the real HTTP status."],"tags":["assets","upload","space","comments","publish"],"backgroundTag":null,"analyzedSha":"1c8a60f858d8472aa56e29994ec1c7926da2c6ce","analyzedAt":"2026-08-12T14:44:31.636Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}