opencontainers / distribution-spec

OCI Distribution Specification
https://opencontainers.org
Apache License 2.0
792 stars 199 forks source link

Clarify multiple multiple-error semantics #413

Open rogpeppe opened 1 year ago

rogpeppe commented 1 year ago

The error-codes section allows for multiple errors to be returned, but doesn't clarify how the client should interpret such a return. For example, there might be several different error codes. What if they conflict?

Do any registries return multiple error codes in the real world, and if so, under what circumstances?

sudo-bmitch commented 1 year ago

I suspect a lot of clients throw up their hands and return the error back to the user or logs. I'm only using the http status codes for my own client logic.

sudo-bmitch commented 1 year ago

Here's an example response from distribution/distribution when pushing a manifest list without first pushing the manifests:

{"errors":[
  {"code":"MANIFEST_BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:600cac71919fc686481c9c1d652c493c630ceeb13d207f9ae8c0a7bb9fde4a71"},
  {"code":"MANIFEST_BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:cbb9856571c5127304224b528345cb3a5ea5caf13e7cedfa8c1e6bb9f8414156"},
  {"code":"MANIFEST_BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:52a873d6833e53105450c58321a19677433c74740a81d3a55310a99889b9cb9e"},
  {"code":"MANIFEST_BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:01d6fd6646fed9e6781c953ff80652ce8979a79b1c61cb36a07e240167341f32"},
  {"code":"MANIFEST_BLOB_UNKNOWN","message":"blob unknown to registry","detail":"sha256:361e6c3e59da161f15fd59b68df876e3346e7e043277f4ebdb13bfe7f23aeab6"}
]}