gitroomhq/postiz-app · error · BadBody

TikTok refused to publish your post

Error message

TikTok refused to publish your post

What it means

After uploading a video, post polls TikTok's publish status but never reaches a published state within the allowed polling attempts, so it assumes TikTok refused to publish. Note the typo'd code 'titok-error-upload'.

Source

Thrown at libraries/nestjs-libraries/src/integrations/social/tiktok.provider.ts:929

            id: response.id,
            releaseURL: check.releaseURL,
            postId: String(check.postId),
            status: 'success',
          },
        ];
      }

      // Cap below the 10-minute activity timeout of the old workflows using
      // this method: failing here (non-retryable) is safe, timing the activity
      // out is not - a retried activity would publish the post again.
      if (Date.now() - started > 8 * 60 * 1000) {
        break;
      }

      await timer(20000);
    }

    throw new BadBody(
      'titok-error-upload',
      JSON.stringify({}),
      Buffer.from(JSON.stringify({})),
      'TikTok refused to publish your post'
    );
  }

  async analytics(
    id: string,
    accessToken: string,
    date: number
  ): Promise<AnalyticsData[]> {
    const today = dayjs().format('YYYY-MM-DD');

    try {
      // Get user stats (follower_count, following_count, likes_count, video_count)
      const userStatsResponse = await fetch(
        'https://open.tiktokapis.com/v2/user/info/?fields=follower_count,following_count,likes_count,video_count',

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Check the TikTok developer dashboard / caption content for policy violations (music, claims, hashtags)
  2. Retry the post — transient TikTok processing failures are common for large files
  3. Verify the uploaded video meets TikTok's requirements (codec H.264, size < 4GB(advertised limits), aspect/metadata)
  4. If reproducible for one channel only, reconnect the channel and re-upload
Defensive patterns

Strategy: retry

Try / catch

catch (e) { if (e instanceof BadBody && e.code === 'titok-error-upload') { /* safe: tweet/post not created; surface to user or retry once */ } throw e; }

Prevention

When it happens

Trigger: TikTok's /v2/post/publish/status/task endpoint keeps returning PUBLISH_IN_PROGRESS or reports FAILED/failed status loops for every poll; the loop exhausts (after timer(20000) waits) and falls through to the throw.

Common situations: Videos stuck in TikTok moderation/review; invalid caption or claim metadata causing silent failure; capacity issues on TikTok's side for large videos; poll responses that never include a success code.

Related errors


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