gitroomhq/postiz-app · error · BadBody

The media took too long to process, please try again

Error message

The media took too long to process, please try again

What it means

Mastodon media polling (waiting for the uploaded attachment's processing to finish before creating the status) exceeded an 8-minute cap. The cap sits below the 10-minute Temporal activity timeout on purpose: the status is only created once media is ready, so failing cleanly avoids a retry that would upload and publish twice.

Source

Thrown at libraries/nestjs-libraries/src/integrations/social/mastodon.provider.ts:461

      } else if (check.status === 'completed') {
        return [
          {
            id: response.id,
            postId: check.postId,
            releaseURL: check.releaseURL,
            status: 'completed',
          },
        ];
      } else {
        pendingData = check.pendingData;
      }

      // Cap below the 10-minute activity timeout of the old workflows using
      // this method: failing here is safe (the status is only created once the
      // media is ready), timing the activity out is not - a retried activity
      // would upload and publish again.
      if (Date.now() - started > 8 * 60 * 1000) {
        throw new BadBody(
          this.identifier,
          '{}',
          '{}',
          'The media took too long to process, please try again'
        );
      }

      await timer(20000);
    }
  }

  async dynamicComment(
    id: string,
    postId: string,
    lastCommentId: string | undefined,
    accessToken: string,
    url: string,
    postDetails: PostDetails[]

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Retry the post (safe: status not yet created)
  2. Compress/downsize the video before scheduling
  3. If persistent, check the instance's media processing health or use a different instance
Defensive patterns

Strategy: retry

Try / catch

if (/media took too long/.test(err.message)) { /* status not created, safe retry */ }

Prevention

When it happens

Trigger: Polling GET /api/v1/media/:id returns video/video_status='processing' for more than 8 minutes before dynamicPost creates the status.

Common situations: Heavy video uploads on busy instances, large files, or instances with slow ffmpeg processing queues.

Related errors


AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27). Data as JSON: /api/errors/8b4aa7294ac23d29. Report an issue: GitHub.