{"record":{"id":"3b778b081e04bd4d","repo":"gitroomhq/postiz-app","slug":"x-took-too-long-to-process-the-media-please-try-a","errorCode":null,"errorMessage":"X took too long to process the media, please try again","messagePattern":"X took too long to process the media, please try again","errorType":"exception","errorClass":"BadBody","httpStatus":null,"severity":"error","filePath":"libraries/nestjs-libraries/src/integrations/social/x.provider.ts","lineNumber":1281,"sourceCode":"  ): Promise<PostResponse[]> {\n    const [response] = await this.postPending(\n      id,\n      accessToken,\n      postDetails,\n      integration\n    );\n\n    let pendingData = response.pendingData;\n    const started = Date.now();\n\n    // eslint-disable-next-line no-constant-condition\n    while (true) {\n      // Cap below the 10-minute activity timeout of the old workflows using\n      // this method: failing here is safe (the tweet is only created once the\n      // media is ready), timing the activity out is not - a retried activity\n      // would upload and publish again.\n      if (Date.now() - started > 8 * 60 * 1000) {\n        throw new BadBody(\n          this.identifier,\n          '{}',\n          Buffer.from('{}'),\n          'X took too long to process the media, please try again'\n        );\n      }\n\n      const check = await this.checkPostStatus(\n        accessToken,\n        pendingData,\n        integration\n      );\n\n      if (check.status === 'pending') {\n        pendingData = check.pendingData;\n        await timer(20000);\n        continue;\n      }","sourceCodeStart":1263,"sourceCodeEnd":1299,"githubUrl":"https://github.com/gitroomhq/postiz-app/blob/0f1647f7491a217d43eb5ae7a480484bdf0aff3e/libraries/nestjs-libraries/src/integrations/social/x.provider.ts#L1263-L1299","documentation":"A media processing wait loop in XProvider exceeded 8 minutes without the media reaching a ready state. The cap is deliberately below the 10-minute activity timeout: failing safely here is better than a Temporal timeout, because a retried activity would re-upload and re-publish, risking duplicates.","triggerScenarios":"Date.now() - started > 8*60*1000 while media is still processing: slow X transcode of large videos or STATUS polling that keeps returning pending.","commonSituations":"Very large or long videos near X limits; X transcoder backlogs; repeated polling throttled by rate limits stretching the wait.","solutions":["Compress/shorten the video and retry — smaller files process well within the cap","Check whether the media eventually succeeded on X before retrying, to avoid duplicates","Retry the post: the tweet is only created after media is ready, so this failure is safe to retry","If consistently slow, schedule posts earlier relative to send time so media processing has headroom"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// estimate processing time by size; reject oversized media up front\nif (videoSizeMB > 200) { /* compress before scheduling */ }","typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof BadBody && e.message.includes('too long to process')) { /* safe to retry: tweet not created yet */ } throw e; }","preventionTips":["Compress videos well under X limits so processing finishes in <8 min","Keep activities under the 8-minute internal cap — never let Temporal retry creates","Retry these failures: the post is only created after media is ready"],"tags":["x-twitter","media-processing","timeout","video-upload"],"backgroundTag":"social-media-publish-timeout","analyzedSha":"0f1647f7491a217d43eb5ae7a480484bdf0aff3e","analyzedAt":"2026-08-27T12:09:55.020Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}