Stale blob upload should return 204
Stale blob upload should return 204 (1/8 failures)
Summary
When a client is checking the state of a stale upload using GET /v2/<name>/blobs/uploads/<uuid>?_state=
we sometimes -see note section for explanation- return a 404
. According to the spec we need to return a 204
.
- The response to an active upload MUST be a 204 No Content response code
Failure logs
Failures
DEBUG
==============================================================================
~~~ REQUEST ~~~
GET /v2/oci-conformance/repo-a/blobs/uploads/7e35c9e7-de63-42ac-895e-d02cd016cb13?_state=p-eVY-J3jTU1QWGdEemony8dUqzzf_1dD5fz-y4v9Ed7Ik5hbWUiOiJvY2ktY29uZm9ybWFuY2UvcmVwby1hIiwiVVVJRCI6IjdlMzVjOWU3LWRlNjMtNDJhYy04OTVlLWQwMmNkMDE2Y2IxMyIsIk9mZnNldCI6MCwiU3RhcnRlZEF0IjoiMjAyNC0wMi0xNVQyMzo1MToyMC43ODE2NDUyODJaIn0%3D HTTP/1.1
HOST : localhost:5000
HEADERS:
User-Agent: distribution-spec-conformance-tests
BODY :
***** NO CONTENT *****
------------------------------------------------------------------------------
~~~ RESPONSE ~~~
STATUS : 404 Not Found
PROTO : HTTP/1.1
RECEIVED AT : 2024-02-15T23:51:20.811100644Z
TIME DURATION: 3.31417ms
HEADERS :
Content-Length: 76
Content-Type: application/json
Date: Thu, 15 Feb 2024 23:51:20 GMT
Docker-Distribution-Api-Version: registry/2.0
BODY :
{
"errors": [
{
"code": "BLOB_UPLOAD_INVALID",
"message": "blob upload invalid"
}
]
}
==============================================================================
• [FAILED] [0.004 seconds]
OCI Distribution Conformance Tests Push Blob Upload Chunked [It] Get on stale blob upload should return 204 with a range and location
/builds/gitlab-org/container-registry/distribution-spec/conformance/02_push_test.go:218
[FAILED] Expected
<int>: 404
to equal
<int>: 204
In [It] at: /builds/gitlab-org/container-registry/distribution-spec/conformance/02_push_test.go:223 @ 02/15/24 23:51:20.811
------------------------------
Notes
The reason for this failure is because on a prior request we end up canceling an active upload if said prior request was erroneous (i.e the size of a part of the upload does not match the upload offset). Rather than cancelling the request, we need to only return a 416
while keeping the request upload active as highlighted in #1200 (comment 1786650580)
Edited by Suleimi Ahmed