Skip to content

ctr push image which saved by docker will failed: unexpected status: 400 Bad Request #4215

@yylt

Description

@yylt

Steps to reproduce the issue:

  1. use docker save image , docker save -o b.tar hub.my.io/foo:foo
  2. copy image into other node which containerd running
  3. use ctr i import and ctr i push

Describe the results you received:
push failed for reason 400 Bad Request

[root@node-1 tmp]# ctr i push -k hub.my.io/foo:foo
manifest-sha256:ec28d5a57391587c95964c6b614eae8cb55032ce5bc3f0ec604c5365d2ef7cf7: done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:42785a1c597f0fcc1fe8b97f3bae112661afc4ed187c96b49a2ffdb357ff0856:    done           |++++++++++++++++++++++++++++++++++++++| 
config-sha256:183fc71e95f40e60fd9e18ccaac5ee7785b837fad6f5acd5b3741a2667b69ce2:   done           |++++++++++++++++++++++++++++++++++++++| 
layer-sha256:fc7f74839ca9af3f77f876fe4a5c02fc147580d38f67352eb9860ac75359bd0e:    done           |++++++++++++++++++++++++++++++++++++++| 
elapsed: 0.1 s                                                                    total:  579.0  (5.6 KiB/s)                                       
ctr: failed commit on ref "manifest-sha256:ec28d5a57391587c95964c6b614eae8cb55032ce5bc3f0ec604c5365d2ef7cf7": unexpected status: 400 Bad Request

registry log info :

level=error msg="response completed with error" err.code="manifest invalid" err.detail="if present, mediaType in manifest should be 'application/vnd.oci.image.manifest.v1+json' not 'application/vnd.docker.distribution.manifest.v2+json'" err.message="manifest invalid" go.version=go1.11.2 http.request.contenttype="application/vnd.oci.image.manifest.v1+json" http.request.host=hub.my.io http.request.id=b2352bbc-8e4d-49cb-a581-a54df857d6e0 http.request.method=PUT http.request.remoteaddr="10.232.0.1:35036" http.request.uri="..." http.request.useragent="containerd/1.3.3" http.response.contenttype="application/json; charset=utf-8" http.response.duration=3.27407ms http.response.status=400 http.response.written=82 vars.name=foo vars.reference=foo

and i test use image which export by ctr , it's ok, something different

1. import image which saved by docker
[root@node-1 tmp]# ctr i ls
REF                      TYPE                                       
hub.easystack.io/foo:foo application/vnd.oci.image.manifest.v1+json

2. import image which exported by ctr
[root@node-1 tmp]# ctr i ls
REF                      TYPE                                       
hub.easystack.io/foo:foo application/vnd.docker.distribution.manifest.v2+json

I am not sure it's contiainerd bug or it is expected?

Describe the results you expected:
push success

Output of containerd --version:

[root@node-1 tmp]# ctr version
Client:
  Version:  1.3.3
  Revision: 

Server:
  Version:  1.3.3
  Revision: 
  UUID: e35fbdf5-fa2b-4a5f-82c7-40fea2421ebc

/ # registry -v
registry github.com/docker/distribution v2.7.1

Any other relevant information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions