jackwener/OpenCLI · error · CommandExecutionError

Instagram private story publish does not support auto-normal

Error message

Instagram private story publish does not support auto-normalizing ${asset.fileName} on ${process.platform}

What it means

Story images outside Instagram's story aspect ratio range must be padded to normalized dimensions using macOS `sips`; on any non-darwin platform automatic story normalization is unsupported and this error is thrown.

Source

Thrown at clis/instagram/_shared/private-publish.js:373

        const detail = [result.error?.message, result.stderr, result.stdout]
            .map((value) => String(value || '').trim())
            .filter(Boolean)
            .join(' ');
        throw new CommandExecutionError(`Instagram private publish failed to normalize ${asset.fileName}`, detail || 'sips padToHeightWidth failed');
    }
    return {
        ...readImageAsset(outputPath),
        cleanupPath: outputPath,
    };
}
export function prepareImageAssetForPrivateStoryUpload(filePath) {
    const asset = readImageAsset(filePath);
    const normalizedDimensions = getInstagramStoryNormalizedDimensions(asset.width, asset.height);
    if (!normalizedDimensions) {
        return asset;
    }
    if (process.platform !== 'darwin') {
        throw new CommandExecutionError(`Instagram private story publish does not support auto-normalizing ${asset.fileName} on ${process.platform}`, `Use images within ${INSTAGRAM_MIN_STORY_ASPECT_RATIO.toFixed(2)}-${INSTAGRAM_MAX_STORY_ASPECT_RATIO.toFixed(2)} aspect ratio, or use the UI route`);
    }
    const outputPath = buildPrivateNormalizedImagePath(filePath);
    const result = spawnSync('sips', [
        '--padToHeightWidth',
        String(normalizedDimensions.height),
        String(normalizedDimensions.width),
        '--padColor',
        INSTAGRAM_PRIVATE_PAD_COLOR,
        filePath,
        '--out',
        outputPath,
    ], {
        encoding: 'utf8',
    });
    if (result.error || result.status !== 0 || !fs.existsSync(outputPath)) {
        const detail = [result.error?.message, result.stderr, result.stdout]
            .map((value) => String(value || '').trim())
            .filter(Boolean)

View on GitHub (pinned to 49907e53dc)

Solutions

  1. Pre-pad/crop the image to the story aspect ratio (9:16) before upload
  2. Use the UI route instead of the private route
  3. Run the publish on macOS where sips-based normalization is available
  4. Adjust your asset-generation pipeline to emit story-sized images

Example fix

// before
await publishStory({ media: 'square.png' }); // fails on linux
// after
// $ magick square.png -background black -gravity center -extent 1080x1920 story.png
await publishStory({ media: 'story.png' });
Defensive patterns

Strategy: validation

Validate before calling

const { width, height } = sizeOf(filePath);
const ratio = width / height;
const ok = ratio >= 0.5625 * 0.9 && ratio <= 0.5625 * 1.1; // ~9:16 story
if (!ok && process.platform !== 'darwin') {
  throw new Error('pad the image to 9:16 first');
}

Try / catch

try {
  await publishStory(cfg);
} catch (e) {
  if (/story publish does not support auto-normalizing/.test(e.message)) {
    cfg.media = padToStoryRatio(cfg.media); // pre-pad to 1080x1920, retry
  } else throw e;
}

Prevention

When it happens

Trigger: prepareImageAssetForPrivateStoryUpload gets non-null getInstagramStoryNormalizedDimensions (ratio outside story range) while process.platform !== 'darwin'.

Common situations: Publishing a square or landscape image as a story on Linux/Windows, CI pipelines producing assets not sized 9:16.

Related errors


AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29). Data as JSON: /api/errors/be9505f59e81fa1d. Report an issue: GitHub.