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: IntegrationView on GitHub (pinned to 0f1647f749)
Solutions
- Verify the media plays locally and is a common format (mp4 H.264/AAC, jpg/png)
- Re-upload the media to storage and retry the post
- Confirm the PUT Content-Length exactly matched the streamed bytes
- 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
- Upload standard codecs/containers (H.264 MP4, JPEG/PNG)
- Ensure uploads are complete and not truncated (Content-Length match)
- Keep copies of source media so re-encoding is possible when processing fails
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
- File upload timed out
- Could not determine the media size for upload
- Failed to fetch media: ${fileResponse.statusText}
- Failed to upload the media file
AI-assisted analysis of gitroomhq/postiz-app@0f1647f749 (2026-08-27).
Data as JSON: /api/errors/884774516b3a8a25.
Report an issue: GitHub.