Repository navigation
Description
Problem Description
devops sandbox deploy fails when the sandbox image is not on the local engine. It does not pull the image, and the error is the raw Docker API reply. The default image is python:3.14-slim, so the first deploy on a fresh engine fails.
DockerEngineService creates the container with containers.create (src/devops_cli/docker/engine.py), and no code under src/devops_cli/sandbox/ or src/devops_cli/docker/ pulls an image first.
Reproduction Steps
- Make sure the engine has no
python:3.14-slimimage. - Run
uv run devops sandbox deploy --name check --network-mode isolated.
Expected vs Actual Behavior
- Expected: the command pulls the image (or, if the design refuses pulls, stops with a message that names the image and the command that pulls it), then deploys.
- Actual:
✗ Failed deploying sandbox: Failed deploying sandbox container: Container creation failed: 404 Client Error for http+docker://localhost/v1.56/containers/create: Not Found ("No such image: python:3.14-slim"), exit 1.
Environment Diagnostics
- devops-cli on origin/main d156ce7 (2026-10-28).
- Docker Engine 29.9.2, docker SDK 7.2.0.
Logs, Traces, or Terminal Output
After docker pull python:3.14-slim, the same deploy works, and devops sandbox logs returns stdout and stderr apart (#2520).
Existing Tool Considered
The docker SDK has images.pull, and containers.run pulls a missing image itself. Nothing new is built.
Proposed design
Problem statement
devops sandbox deploy fails with a raw Docker API 404 error when the sandbox image is not on the local engine. The command does not pull the image before it creates the container. The first deploy on a fresh engine always fails. The default image is python:3.14-slim.
Acceptance criteria
Requirement: Pull missing image before container creation
When the sandbox image is not present on the local engine, the deploy command SHALL pull the image before it creates the container.
Scenario: Deploy with a missing image
- WHEN The engine has no image matching the sandbox image reference
- THEN The command pulls the image and then creates the container without a 404 error
Requirement: Skip pull when image exists locally
When the sandbox image is already present on the local engine, the deploy command SHALL NOT issue a registry pull request.
Scenario: Deploy with an existing image
- WHEN The engine already has an image matching the sandbox image reference
- THEN The command creates the container without a network pull call
Requirement: Name the image in a pull failure error
When the image pull fails, the error message SHALL contain the image reference and the reason for the failure.
Scenario: Pull fails due to a registry error
- WHEN The image pull fails because the registry is unreachable or the image does not exist in the registry
- THEN The error message contains the image reference and the failure reason
Existing Tool Considered
docker-py (v7.2.0, already a project dependency) provides client.images.pull(repository, tag) to pull an image and client.images.get(name) to check if one exists locally. The project wraps the SDK through DockerEngineService but does not call either method in the sandbox deploy path. The fix adds one pull_image method to DockerEngineService and calls it from the sandbox deploy code. No new library is introduced.
Key questions
- Where should the pull happen: inside DockerEngineService.create_container or in the sandbox deploy caller?: In the sandbox deploy caller, before it calls create_container. (best practice) [sources: src/devops_cli/docker/engine.py]
- Rejected: Pull inside DockerEngineService.create_container. Rejected. This would add a network check to every container creation, including callers that use locally-built images.
- Chosen: Pull in the sandbox deploy caller before create_container. Chosen. The sandbox deploy is the path that needs a registry image. The pull is scoped to where it is needed.
- Rejected: Replace containers.create with containers.run. Rejected. containers.run starts the container immediately, which changes the create-then-start flow the sandbox deploy uses.
- Should the code check if the image exists locally before pulling?: Yes. Check with images.get first. Pull only when the image is absent. (best practice) [sources: src/devops_cli/docker/engine.py]
- Rejected: Always pull. Rejected. A pull makes a network request even when the image is local, adding latency to every deploy.
- Chosen: Check locally then pull if absent. Chosen. The image is local in the common case. A local check avoids the network round-trip.
- What is the default sandbox image reference?: python:3.14-slim [sources: src/devops_cli/docker/sandbox.py]
- Does the DockerEngineFake in tests already support a pull call?: The fake holds alpine:3 and scripts container behavior. It does not record a pull call. The test for this fix must add a pull call to the fake and assert it is called when the image is absent. [sources: docs/TESTING.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 28, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The deploy command fails on a fresh engine because it does not pull the image, which is a defect in the existing flow.It blocks the first deploy on a fresh engine, but a manual docker pull is a workaround.It removes a first-use failure for every new user who has not pre-pulled the default image.The fix is one images.pull call before containers.create, or a clearer error message naming the image.Both fix a sandbox command that fails on a real Docker engine in the same service file, but #2520 fixes the logs call while this fixes the deploy call.devops-cli-service commentedon Oct 29, 2026
Status set to Ready at 0f7bc26 (see proposed design in issue body).
devops-cli-service commentedon Nov 1, 2026
Staged: branch
fix/2554-devops-sandbox-deploy-fails-with-a, draft pull request #2996. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
docs(openspec): plan #2554 Pull sandbox image before deploy (#2996)
94 remaining items
devops-cli-service commentedon Nov 5, 2026
The runner Job devops-cli-runner-20261104-235519-dd3d ended: succeeded.
Image digest: sha256:b161a617dc04fdc13d2c96b33b2a4acbfe6bebfae21942588aa7201250eb6e29
The last lines of its log:
feat(roadmap): ask for a smaller edit after a parser failure (#3737)
[-]fix(sandbox): devops sandbox deploy fails with a raw 404 when the sandbox image is not on the engine[/-][+]fix(sandbox): Pull the sandbox image before container creation[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 86 characters, and the limit is 60. The type and the scope stay.
fix(sandbox): devops sandbox deploy fails with a raw 404 when the sandbox image is not on the enginefix(sandbox): Pull the sandbox image before container creationdevops-cli-service commentedon Nov 10, 2026
Released in v0.108.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.108.2
devops-cli-service commentedon Nov 10, 2026
Live since 2026-11-10 20:48 UTC