{"record":{"id":"139f06fc659de8e8","repo":"gitroomhq/postiz-app","slug":"file-upload-timed-out","errorCode":null,"errorMessage":"File upload timed out","messagePattern":"File upload timed out","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/whop.provider.ts","lineNumber":309,"sourceCode":"          duplex: 'half',\n        } as any);\n        // A rejected PUT leaves the file pending forever - fail fast instead\n        // of burning the ~9 minute status poll below.\n        if (!uploadResponse.ok) {\n          throw new BadBody(\n            this.identifier,\n            await uploadResponse.text().catch(() => '{}'),\n            '{}',\n            'Failed to upload the media file'\n          );\n        }\n\n        let uploadStatus = 'pending';\n        let attempts = 0;\n        const maxAttempts = 108; // ~9 minutes at 5s interval\n        while (uploadStatus !== 'ready') {\n          if (attempts++ >= maxAttempts) {\n            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');","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/whop.provider.ts#L291-L327","documentation":"After PUTting media to Whop, uploadMediaToWhop polls the file's upload_status every 5s; if it is not 'ready' after 108 attempts (~9 minutes) it throws 'File upload timed out'.","triggerScenarios":"Whop's file processing stays 'pending'/'processing' beyond the 9-minute window: very large files, slow Whop-side processing, or a stuck file state.","commonSituations":"Large videos on congested Whop pipelines; polling endpoint throttling; file whose processing silently stalled after a partially-successful PUT.","solutions":["Retry the post — most slow-processing files succeed on a second attempt","Reduce media size/resolution before uploading","Check the Whop file status manually via GET /api/v1/files/{id} to see if it eventually became ready or 'failed'","If consistently timing out, report to Whop support with the file id"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof Error && e.message === 'File upload timed out') { /* check file status via GET /api/v1/files/{id}; retry post once */ } throw e; }","preventionTips":["Compress media so Whop finishes processing within ~9 minutes","Treat a timeout as unknown-state: verify on Whop before retrying","Schedule large uploads with headroom, not at the last minute"],"tags":["whop","upload-timeout","polling","file-processing"],"backgroundTag":"social-media-publish-timeout","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}