docker / docker/docker-py

Pushing a non existent tag doesn't raise an exception

Open
#2,226 9 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement level/docker-engine level/dockerclient
Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

I get this error in the error output but no exception is raised:

{"status":"The push refers to repository [485757098324.dkr.ecr.us-east-1.amazonaws.com/ssh_proxy]"}
{"errorDetail":{"message":"An image does not exist locally with the tag: 485757098324.dkr.ecr.us-east-1.amazonaws.com/ssh_proxy"},"error":"An image does not exist locally with the tag: 485757098324.dkr.ecr.us-east-1.amazonaws.com/ssh_proxy"}

Unlike related issue #1772 there's really no excuse here, since this error can be detected even if trying to push to a black box, while #1772 requires understanding the output of a repo server.

Also worth mentioning that the docker push command WILL return an error code in this case. So actually the docker push command gives MORE info than the SDK function. Since the docker push command gives output + error code. While the SDK function only gives output :(

(Not saying the function needs to BC break and return two values, just that it needs to raise exceptions when appropriate)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the SDK function used for docker push and tracing how its streamed error output is handled. Reproduce the case with a nonexistent local tag and compare the SDK result with docker push's nonzero exit behavior. Done means the SDK raises an exception for this client-detectable error while preserving the existing output behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.