"Failed to set up container" almost every time around 30s in
Resolved 💬 4 comments Opened Jul 22, 2025 by jaredstutzman Closed Oct 17, 2025
What version of Codex is running?
_No response_
Which model were you using?
_No response_
What platform is your computer?
Darwin 23.6.0 arm64 arm
What steps can reproduce the bug?
go to https://chatgpt.com/codex and just give any prompt to code
What is the expected behavior?
get diff logs and a new branch
What do you see instead?
Failed in 27s
! Failed to set up container
Additional information
It works for others on the same repo.
fails for me almost every time
4 Comments
i'm also getting this anytime i do anything with Codex. It worked for me once and hasn't since
<img width="1711" height="904" alt="Image" src="https://github.com/user-attachments/assets/1ecf2eb1-5abd-4a4b-b554-24e42dd85f3c" />
same here for me.
Title: Codex: “Failed to set up container” before clone on large/branch-heavy private repo
What happens: Task fails at \~30s with
Starting your container → Downloading repo → Failed to set up container. It never reaches git clone or setup.Example failed task:
https://chatgpt.com/codex/tasks/task_b_689a6a6cffe483279fca6982ba492081(private repo, please correlate via backend logs)Repo characteristics: \~4,002 directories (many are build paths), 194 remote branches.
Environment: OpenAI-provided service (no custom Dockerfile). No startup scripts, no env vars.
**What does work: In the Codex “Environment” tab, interactive terminal launches fine; full setup/run also works there. Other repos on the same account succeed in both setup + execution.
Recent attempts:** Removed all env vars/scripts, toggled agent internet permissions, retried across multiple prompts—consistent failure before clone.
Hypothesis: Service is choking on repo metadata enumeration (branches/contents) prior to clone—matches other reports (“error loading branches”, large directory fan-out).
Workarounds considered: 1) prune branches to 3; 2) mirror to a fresh repo with minimal history; 3) reconnect GitHub connector.
Request: Please check backend logs for the task above and confirm whether repo enumeration/branch listing or path fan-out is causing the pre-clone failure.
Update
Pruning the branches and toggling the github connector failed. Mirroring the entire repo and pointing codex to the mirror was successful, but not a good long-term fix.