gitroomhq/postiz-app · error · Error

File upload failed

Error message

File upload failed

What it means

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.

Source

Thrown at libraries/nestjs-libraries/src/integrations/social/whop.provider.ts:327

            throw new Error('File upload timed out');
          }

          const fileStatus = await (
            await this.fetch(
              `https://api.whop.com/api/v1/files/${createFileResponse.id}`,
              {
                headers: {
                  Authorization: `Bearer ${accessToken}`,
                },
              },
              'check file status',
              0,
              true
            )
          ).json();
          uploadStatus = fileStatus.upload_status;
          if (uploadStatus === 'failed') {
            throw new Error('File upload failed');
          }
          if (uploadStatus !== 'ready') {
            await timer(5000);
          }
        }
      }

      attachments.push({ id: createFileResponse.id });
    }

    return attachments;
  }

  async post(
    id: string,
    accessToken: string,
    postDetails: PostDetails<WhopDto>[],
    integration: Integration

View on GitHub (pinned to 0f1647f749)

Solutions

  1. Verify the media plays locally and is a common format (mp4 H.264/AAC, jpg/png)
  2. Re-upload the media to storage and retry the post
  3. Confirm the PUT Content-Length exactly matched the streamed bytes
  4. If all files fail, check Whop's status page / API for pipeline issues
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-validate common formats before uploading
const ok = ['video/mp4', 'image/jpeg', 'image/png', 'image/webp'].includes(media.mimetype);
if (!ok) { /* convert media first */ }

Type guard

const isWhopSupportedMedia = (m: { mimetype: string }) => /^(video\/mp4|image\/(jpeg|png|webp))$/.test(m.mimetype);

Try / catch

catch (e) { if (e instanceof Error && e.message === 'File upload failed') { /* permanent: re-encode media, do not blind-retry */ } throw e; }

Prevention

When it happens

Trigger: Whop's file pipeline reports upload_status === 'failed': unsupported/corrupt media, virus scan rejection, size limit, or processing error after the PUT.

Common situations: Uploading unusual codecs or corrupted files; truncated upload due to a Content-Length mismatch; Whop-side processing outage.

Related errors


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