{"record":{"id":"884774516b3a8a25","repo":"gitroomhq/postiz-app","slug":"file-upload-failed","errorCode":null,"errorMessage":"File upload failed","messagePattern":"File upload failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/whop.provider.ts","lineNumber":327,"sourceCode":"            throw new Error('File upload timed out');\n          }\n\n          const fileStatus = await (\n            await this.fetch(\n              `https://api.whop.com/api/v1/files/${createFileResponse.id}`,\n              {\n                headers: {\n                  Authorization: `Bearer ${accessToken}`,\n                },\n              },\n              'check file status',\n              0,\n              true\n            )\n          ).json();\n          uploadStatus = fileStatus.upload_status;\n          if (uploadStatus === 'failed') {\n            throw new Error('File upload failed');\n          }\n          if (uploadStatus !== 'ready') {\n            await timer(5000);\n          }\n        }\n      }\n\n      attachments.push({ id: createFileResponse.id });\n    }\n\n    return attachments;\n  }\n\n  async post(\n    id: string,\n    accessToken: string,\n    postDetails: PostDetails<WhopDto>[],\n    integration: Integration","sourceCodeStart":309,"sourceCodeEnd":345,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/whop.provider.ts#L309-L345","documentation":"While polling Whop's file status, the upload_status came back as 'failed', meaning Whop rejected or failed to process the uploaded file. Thrown as a plain Error, so it fails the current attempt immediately.","triggerScenarios":"Whop's file pipeline reports upload_status === 'failed': unsupported/corrupt media, virus scan rejection, size limit, or processing error after the PUT.","commonSituations":"Uploading unusual codecs or corrupted files; truncated upload due to a Content-Length mismatch; Whop-side processing outage.","solutions":["Verify the media plays locally and is a common format (mp4 H.264/AAC, jpg/png)","Re-upload the media to storage and retry the post","Confirm the PUT Content-Length exactly matched the streamed bytes","If all files fail, check Whop's status page / API for pipeline issues"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// pre-validate common formats before uploading\nconst ok = ['video/mp4', 'image/jpeg', 'image/png', 'image/webp'].includes(media.mimetype);\nif (!ok) { /* convert media first */ }","typeGuard":"const isWhopSupportedMedia = (m: { mimetype: string }) => /^(video\\/mp4|image\\/(jpeg|png|webp))$/.test(m.mimetype);","tryCatchPattern":"catch (e) { if (e instanceof Error && e.message === 'File upload failed') { /* permanent: re-encode media, do not blind-retry */ } throw e; }","preventionTips":["Upload standard codecs/containers (H.264 MP4, JPEG/PNG)","Ensure uploads are complete and not truncated (Content-Length match)","Keep copies of source media so re-encoding is possible when processing fails"],"tags":["whop","file-processing","upload-failed"],"backgroundTag":"social-media-upload-rejected","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}