distribution-spec icon indicating copy to clipboard operation
distribution-spec copied to clipboard

Clarify multiple multiple-error semantics

Open rogpeppe opened this issue 2 years ago • 2 comments

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?

rogpeppe avatar May 21 '23 20:05 rogpeppe

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 avatar May 30 '23 00:05 sudo-bmitch

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"}
]}

sudo-bmitch avatar Jul 01 '23 22:07 sudo-bmitch