jackwener/OpenCLI · error · CommandExecutionError
Instagram private publish video cover upload failed for ${pr
Error message
Instagram private publish video cover upload failed for ${prepared.asset.fileName} What it means
After the video upload succeeds, the cover image is uploaded via rupload_igphoto with video-cover headers; if that response's status is not 'ok' this error is thrown at clis/instagram/_shared/private-publish.js:833. The video itself was accepted, but its cover frame was rejected, so the publish cannot proceed.
Source
Thrown at clis/instagram/_shared/private-publish.js:833
const videoResponse = await fetchPrivateUploadWithRetry(fetcher, `https://i.instagram.com/rupload_igvideo/fb_uploader_${uploadId}`, {
method: 'POST',
headers: mode === 'story'
? buildStoryVideoRuploadHeaders(prepared.asset, uploadId, context)
: buildVideoRuploadHeaders(prepared.asset, uploadId, context),
body: prepared.asset.bytes,
});
const videoJson = await parseJsonResponse(videoResponse, 'video upload');
if (String(videoJson?.status || '') !== 'ok') {
throw new CommandExecutionError(`Instagram private publish video upload failed for ${prepared.asset.fileName}`);
}
const coverResponse = await fetchPrivateUploadWithRetry(fetcher, `https://i.instagram.com/rupload_igphoto/fb_uploader_${uploadId}`, {
method: 'POST',
headers: buildVideoCoverRuploadHeaders(prepared.asset, uploadId, context),
body: prepared.asset.coverImage.bytes,
});
const coverJson = await parseJsonResponse(coverResponse, 'video cover upload');
if (String(coverJson?.status || '') !== 'ok') {
throw new CommandExecutionError(`Instagram private publish video cover upload failed for ${prepared.asset.fileName}`);
}
}
async function publishSidecarWithRetry(input) {
const waitMs = input.waitMs ?? sleep;
const requestInit = {
method: 'POST',
headers: {
...buildPrivateApiHeaders(input.apiContext),
'Content-Type': 'application/json',
},
body: JSON.stringify(input.payload),
};
for (let attempt = 0; attempt < INSTAGRAM_PRIVATE_SIDECAR_TRANSCODE_ATTEMPTS; attempt += 1) {
const response = await input.fetcher('https://www.instagram.com/api/v1/media/configure_sidecar/', requestInit);
const text = await response.text();
let json = {};
try {
json = text ? JSON.parse(text) : {};View on GitHub (pinned to 49907e53dc)
Solutions
- Verify the cover image is a valid non-empty JPEG (check file size and open it locally) before publishing
- Regenerate the cover (or supply your own) and retry the publish
- Retry after a short backoff if the video upload succeeded — this stage is often transiently throttled
- Read the response body's message field for the specific rejection reason
Example fix
// before
const cover = await coverImage(videoPath); // may silently produce tiny/corrupt frame
await publish({ ..., coverImage: cover });
// after
const cover = await coverImage(videoPath);
if (fs.statSync(cover.cleanupPath).size < 1024) throw new Error('generated cover is corrupt; regenerate or supply one');
await publish({ ..., coverImage: cover }); Defensive patterns
Strategy: retry
Validate before calling
const coverStat = fs.statSync(coverPath);
if (coverStat.size < 1024) throw new Error('generated cover looks corrupt — regenerate or supply one'); Try / catch
try { return await publish(input); }
catch (e) {
if (/video cover upload failed for/.test(e.message)) {
await sleep(10000);
return publish({ ...input, coverImage: regenerateCover(input.videoPath) }); // video already accepted
}
throw e;
} Prevention
- Verify generated covers are valid non-empty JPEGs before publishing
- Supply a hand-picked cover when automatic frame extraction is flaky
- Back off and retry — the video upload succeeded so only the cover stage failed
When it happens
Trigger: POST of prepared.asset.coverImage.bytes to https://i.instagram.com/rupload_igphoto/fb_uploader_<uploadId> returns JSON with status other than 'ok' — cover bytes empty/corrupt, cover generated on a platform where extraction partially failed, or cover headers mismatched.
Common situations: Cover generation produced a zero-byte or corrupt JPEG (e.g. AVFoundation frame extraction edge case); cover image dimensions outside allowed range; transient Instagram-side error during the second upload; rate limiting kicking in mid-publish.
Related errors
- Instagram private publish upload failed for ${prepared.asset
- Instagram private publish ${stage} returned invalid JSON
- Failed to upload image to ChatGPT: ${err instanceof Error ?
- Failed to upload image to ChatGPT
- Failed to upload file to ChatGPT project knowledge: ${err in
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a0b097491572d64c.
Report an issue: GitHub.