Field note · built in May 2026

Container Publication failed: we traced it to file size and fixed it.

We built a pipeline that takes videos from a cloud folder, has Claude write the captions and schedules them as Instagram Reels through Postiz. At first every publish came back with Meta's generic "Container Publication failed". One account finally gave the real reason: "Media download has failed: HTTP error code 413. Payload too large." The video was 54 MB. Compressed to about 5 MB, it published on the first try, in Postiz and in Metricool. The pipeline later ran nine straight days and published 48 Reels without a single failure.

30 min · Fixed quote before we build · Projects from $2,500

What we built

Each Instagram account gets one cloud folder. Any video dropped into it is published to that account as a Reel, with a caption and on a sensible schedule, without anyone touching it. The setup had to scale to thirty accounts, so the folder name is the account handle and there is nothing else to configure per account.

StepWhat does itWhy this choice
StorageBox, one folder per accountThe team already worked in it, and the folders are the only configuration
OrchestrationClaude Code on a daily scheduleIt follows a plain-text runbook, so changing the pipeline means editing a file, not code
CaptionsWritten by Claude from a style guide in the runbookThree caption styles with examples, rotated from one video to the next
Compressionffmpeg, on every file, before anything elseThe step that resolved the publishing error described below
HostingA public URL for each videoPostiz and Instagram fetch the file from a URL rather than accepting an upload
PublishingPostiz, through its MCP serverOne call per post, or a whole day scheduled in one batch
ArchiveThe file moves to a posted folderAn empty folder means everything has been published

The first full run compressed nine videos, uploaded them and scheduled the rest of that day and the next morning in a single batch.

Why "Container Publication failed" is hard to trace

Instagram publishes a Reel in two steps. First Meta creates a media container: its servers download the video from the URL you supplied and check it. Then the container is published. When the download step fails, the error can come back as nothing more than "Container Publication failed", with no reason attached, and every part of the stack becomes a suspect.

We changed one thing at a time and kept the same video throughout:

What we testedFinding
The caption, from a long promotional one down to three plain wordsNot the cause
The host: Box, a temporary file host, a Google Drive direct linkNot the cause
The platform: Postiz, then MetricoolNot the cause
The Instagram account: two different onesNot the cause
A third, freshly connected accountThe real reason: "Media download has failed: HTTP error code 413. Payload too large"

The fix: compress before you upload

Every file now goes through ffmpeg at a constant rate factor of 28 before it goes anywhere else. The first test file came out at about 5 MB and published on the first attempt, on Postiz and on Metricool, with the same long promotional caption we had tested earlier.

With compression built in, the pipeline ran unattended from 6 to 14 May and published 48 Reels to Instagram without a single failure. When your source footage changes, a new camera or a new export setting, publish one test post before scheduling a batch.

Serving the video from a public URL

Postiz schedules Instagram posts from a URL, and its MCP tools do not take a file upload. Instagram then fetches that URL on its own schedule, so the URL has to return the raw video, publicly and without a login, until Meta has finished with it. This is where most of the setup work goes.

  • Box on a free plan does not serve direct links: its shared static link returns "This user is not allowed to use direct links". The download endpoint in its API returns a temporary signed link, but that link expires and serves the video as a download, so Postiz cannot build a preview from it.
  • A Google Drive link ending in /view serves a web page, not the video. The uc?export=download form of the same link serves the file.
  • Free temporary file hosts are not built for this job. Links expire, large uploads are not always stored intact, and some hosts start refusing requests once Meta's servers begin fetching.

What we recommend: object storage you control, such as an S3-compatible bucket with public read access on a single folder and a long-lived URL for each file. At this volume it costs cents a month, and hosting stops being something to check.

Notes on Postiz

  • Postiz connects to Instagram in two ways: through a Facebook Business connection, or through a standalone flow that signs in to the Instagram account directly. Both are official Meta routes, and both need a Meta for Developers account. Our pipeline published all of its Reels through the standalone connection.
  • One difference matters for Reels: according to Postiz's documentation, adding music is only available through the Facebook Business connection.
  • Posts cannot be deleted through the Postiz MCP tools, so tidy up test posts in the Postiz app. On a live account, space test posts out rather than sending several within a few minutes.
  • A post with no thumbnail in the Postiz dashboard is an early sign that the video URL is not serving the raw file. Fix the URL before scheduling anything else.

If you use Metricool instead

  • API access requires the Advanced or Custom plan.
  • Send media as a flat list of URL strings. Sent as a list of objects, the post is created without its video.
  • Its documented Instagram limits are 50 posts per account in 24 hours and 2,200 characters of caption, and a Reel must be a 9:16 MP4 or MOV between 3 seconds and 15 minutes long.
  • Metricool accepts files up to 500 MB, but a file Metricool accepts can still be too large for Meta's download step. Compress first: with the smaller file, Metricool published the same video on the first attempt.

If your file is already small

File size was the cause in our case. If your video is already small and the error persists, check these next, in this order:

  • The URL returns the raw file. Opened in a private window, the video should play or download rather than show a page.
  • The format matches a Reel: 9:16, H.264 video, AAC audio, between 3 seconds and 15 minutes.
  • The host answers Meta reliably and keeps the link alive until the post goes out.
  • The connection has publishing rights. When connecting through Facebook, the Instagram content publishing permission has to be granted.
  • The account has not just received a burst of failed attempts. If it has, wait before trying again.

We build automations like this for clients, video included. See our AI video ads work and our AI automation agency page.

Questions, answered.

What does "Container Publication failed" mean on Instagram?

Meta publishes Reels in two steps: it downloads your video from the URL you provide into a media container, then publishes that container. The message means one of those steps did not complete. It does not say which one or why, so the cause has to be found by elimination.

Is there a file size limit for Instagram Reels through the API?

In practice, yes, at the step where Meta downloads your file from its URL. Our 54 MB video was rejected with HTTP 413, Payload too large, and the same video compressed to about 5 MB published straight away. Compressing before upload is the dependable fix.

Can the caption cause "Container Publication failed"?

Not in our case. A three-word caption produced the same error, and a long promotional caption with hashtags published without trouble once the file was small.

Can Postiz upload a video file directly?

Not through its MCP tools. A post takes a public URL to the media, and Instagram fetches the file itself. Your part is making that URL return the raw file, reliably, until publishing is complete.

Postiz or Metricool for automating Instagram?

Both published our Reels once the file was small. We kept Postiz because its MCP server lets Claude schedule a post in a single call. Metricool's API requires its Advanced plan.

What does ffmpeg CRF 28 do?

It re-encodes the video at a constant quality level. Lower numbers keep more detail and make larger files. At 28, our 54 MB test file came out at about 5 MB with no visible loss on phone footage.

Tell us what's slowing you down. We'll show you what to automate first.

Free · 30 min · Projects from $2,500

contact@aistrikeforce.com