nerdctl push cannot push image which pulled from a private docker registry

Open
#4,306 12 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, go
Domain
devops

Research direction

Start by reproducing the two nerdctl push commands and compare the registry blob-mount requests, especially the /v2/.../blobs/uploads/?mount=...&from=pause request and its 400 response. Trace the push entry point and existing tests for registry blob mounting; done means an image pulled from the private registry can be pushed to the Harbor repository without the invalid repository name error.

Written by the indexing model from the issue text.

Description

bug
  1. nerdctl pushed an image which had downloaded from docker hub, to a local Harbor repository, it succeed as expected
  2. nerdctl pushed an image which had downloaded from local docker registry, to the same Harbor repository, it failed with "400 Bad Request"

nerdctl version 2.0.4

sudo nerdctl -n k8s.io images, I have below images:
busybox:latest
192.168.140.16:5000/pause:3.10

The success image:
sudo nerdctl -n k8s.io tag busybox:latest 192.168.140.16/library/busybox-16:latest-1
sudo nerdctl -n k8s.io push 192.168.140.16/library/busybox-16:latest-1

The failed image:
sudo nerdctl -n k8s.io tag 192.168.140.16:5000/pause:3.10 192.168.140.16/library/pause-5000:3.10
sudo nerdctl -n k8s.io push 192.168.140.16/library/pause-5000:3.10

Failed logs as below:
DEBU[0000] fetch response received digest="sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669" mediatype=application/vnd.docker.image.rootfs.diff.tar.gzip response.header.connection=keep-alive response.header.content-length=133 response.header.content-type="application/json; charset=utf-8" response.header.date="Thu, 05 Jun 2025 12:24:02 GMT" response.header.server=nginx response.header.set-cookie="sid=b4d676795d6c9c9691404ad3834fb26f; Path=/; HttpOnly" response.header.x-request-id=e5aa4024-75f1-4832-992a-d36fce073f6b response.status="404 Not Found" size=316581 url="https://192.168.140.16/v2/library/pause-5000/blobs/sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669"
DEBU[0000] do request digest="sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669" mediatype=application/vnd.docker.image.rootfs.diff.tar.gzip request.header.user-agent=containerd/2.0.4+unknown request.method=POST size=316581 url="https://192.168.140.16/v2/library/pause-5000/blobs/uploads/?mount=sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669&from=pause"
DEBU[0000] fetch response received digest="sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669" mediatype=application/vnd.docker.image.rootfs.diff.tar.gzip response.header.connection=keep-alive response.header.content-length=92 response.header.content-type="application/json; charset=utf-8" response.header.date="Thu, 05 Jun 2025 12:24:02 GMT" response.header.server=nginx response.header.x-request-id=edcef50b-4867-4372-8a0a-df67ec419a9d response.status="400 Bad Request" size=316581 url="https://192.168.140.16/v2/library/pause-5000/blobs/uploads/?mount=sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669&from=pause"
DEBU[0000] unexpected response body="{"errors":[{"code":"BAD_REQUEST","message":"bad request: invalid repository name: pause"}]}\n" digest="sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669" mediatype=application/vnd.docker.image.rootfs.diff.tar.gzip resp="&{400 Bad Request 400 HTTP/1.1 1 1 map[Connection:[keep-alive] Content-Length:[92] Content-Type:[application/json; charset=utf-8] Date:[Thu, 05 Jun 2025 12:24:02 GMT] Server:[nginx] X-Request-Id:[edcef50b-4867-4372-8a0a-df67ec419a9d]] {0xc000192bc0} 92 [] false false map[] 0xc000402f00 0xc0004de000}" size=316581
DEBU[0000] fetch response received digest="sha256:873ed75102791e5b0b8a7fcd41606c92fcec98d56d05ead4ac5131650004c136" mediatype=application/vnd.docker.container.image.v1+json response.header.connection=keep-alive response.header.content-length=92 response.header.content-type="application/json; charset=utf-8" response.header.date="Thu, 05 Jun 2025 12:24:02 GMT" response.header.server=nginx response.header.x-request-id=17401ecd-77ca-4b39-9f51-ad2c055afa50 response.status="400 Bad Request" size=881 url="https://192.168.140.16/v2/library/pause-5000/blobs/uploads/?mount=sha256:873ed75102791e5b0b8a7fcd41606c92fcec98d56d05ead4ac5131650004c136&from=pause"
DEBU[0000] unexpected response body="{"errors":[{"code":"BAD_REQUEST","message":"bad request: invalid repository name: pause"}]}\n" digest="sha256:873ed75102791e5b0b8a7fcd41606c92fcec98d56d05ead4ac5131650004c136" mediatype=application/vnd.docker.container.image.v1+json resp="&{400 Bad Request 400 HTTP/1.1 1 1 map[Connection:[keep-alive] Content-Length:[92] Content-Type:[application/json; charset=utf-8] Date:[Thu, 05 Jun 2025 12:24:02 GMT] Server:[nginx] X-Request-Id:[17401ecd-77ca-4b39-9f51-ad2c055afa50]] {0xc0003302c0} 92 [] false false map[] 0xc0009bd900 0xc0009b4780}" size=881
manifest-sha256:d8c8296a995aa91d1a888d405d98f3c4a317fe2b5790b996051f7ff1184a3694: waiting |--------------------------------------|
layer-sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669: waiting |--------------------------------------|
config-sha256:873ed75102791e5b0b8a7fcd41606c92fcec98d56d05ead4ac5131650004c136: waiting |--------------------------------------|
elapsed: 0.1 s total: 0.0 B (0.0 B/s)
FATA[0000] unexpected status from POST request to https://192.168.140.16/v2/library/pause-5000/blobs/uploads/?mount=sha256:61d9e957431bdf7a34f31cbcb23fe7966ab9da5c1df35138b1e752af15b69669&from=pause: 400 Bad Request

Dominant language
Go
Stars
10.5k
Forks
853
Avg merge
6d 14h
Merged PRs (30d)
38

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • No pull request template
  • No 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.

More from containerd/nerdctl

All issues in containerd/nerdctl

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.