Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal Server Error on pushing to Container Registry when storage type for packages is minio #21320

Closed
dvjn opened this issue Oct 2, 2022 · 29 comments
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea topic/packages
Milestone

Comments

@dvjn
Copy link

dvjn commented Oct 2, 2022

Description

I have configured an s3 bucket to store packages.

[storage]
STORAGE_TYPE = minio
SERVE_DIRECT = true
MINIO_ENDPOINT = s3.ap-south-1.amazonaws.com
MINIO_ACCESS_KEY_ID = ***
MINIO_SECRET_ACCESS_KEY = ***
MINIO_BUCKET = ***
MINIO_LOCATION = ap-south-1
MINIO_BASE_PATH = /data/gitea/misc
MINIO_USE_SSL = true

[storage.packages]
MINIO_BASE_PATH = /data/gitea/packages

When I try to push a container:

  1. Each layer takes a retry to push
The push refers to repository [***/divya.jain/homer]
d79bd6a8365d: Pushed 
e68e7f72b9a6: Pushed 
0dca13ec4143: Pushed 
ad14e0fb5549: Pushed 
4e0001f6ed71: Pushed 
f3c9055b7fd6: Retrying in 4 seconds 
994393dc58e7: Retrying in 4 seconds 
  1. It ends with an internal server error
The push refers to repository [***/divya.jain/homer]
d79bd6a8365d: Pushed 
e68e7f72b9a6: Pushed 
0dca13ec4143: Pushed 
ad14e0fb5549: Pushed 
4e0001f6ed71: Pushed 
f3c9055b7fd6: Pushed 
994393dc58e7: Pushed 
received unexpected HTTP status: 500 Internal Server Error

When I tried to investigate the logs, I found 2 different types of errors for different containers

Type 1 (in container.EndUploadBlob):

2022/10/02 18:33:38 [6339d982] router: completed GET /v2/ for ***:0, 401 Unauthorized in 0.1ms @ container/container.go:113(container.ReqContainerAccess)
2022/10/02 18:33:39 [6339d982-2] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fhomer%3Apush%2Cpull&service=container_registry for ***:0, 200 OK in 95.4ms @ container/container.go:137(container.Authenticate)
2022/10/02 18:33:39 [6339d983-2] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:b9921724b705025663ffedd9ee6058a69630037c7ae4793e8bbfc7ad12727e7a for ***:0, 404 Not Found in 16.7ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:39 [6339d983-5] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:1cfe1c2fcbd63648fd717163e09d641d2556e1a8a4eed8b1b06375db4f9150b2 for ***:0, 404 Not Found in 17.8ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:39 [6339d983-4] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:4b9fb091993f2d3745facb4eaa28865f24e02a88235f03120f02cab2387396ea for ***:0, 404 Not Found in 35.0ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:39 [6339d983-3] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:c2d6d98eb0ad76128702bbaf1c7b1d27800c3ff047bf4c38e2fa63e529fd742f for ***:0, 404 Not Found in 47.0ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:39 [6339d983] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:44e606d5c30ec85bd17cc13a405421639bb47264be32ede155bb5f7f59eb2a4c for ***:0, 404 Not Found in 124.1ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:39 [6339d983-6] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 144.0ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:39 [6339d983-7] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 146.9ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:39 [6339d983-8] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 201.8ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:39 [6339d983-9] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 245.1ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:39 [6339d983-10] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 301.9ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:39 [6339d983-11] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/u5y4g7jhksb0livtd2q71ewyj for ***:0, 202 Accepted in 309.3ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:39 [6339d983-14] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/itaijpzkc1fgq8udcmvko4sds for ***:0, 202 Accepted in 231.7ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:39 [6339d983-13] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/af7mr9wfgbxbdmkkvjbqmdmap for ***:0, 202 Accepted in 346.9ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:39 ...ntainer/container.go:84:apiError() [E] [6339d983-16] close /data/gitea/tmp/package-upload/u5y4g7jhksb0livtd2q71ewyj: file already closed 
2022/10/02 18:33:39 [6339d983-16] router: completed PUT /v2/divya.jain/homer/blobs/uploads/u5y4g7jhksb0livtd2q71ewyj?digest=sha256%3Ab9921724b705025663ffedd9ee6058a69630037c7ae4793e8bbfc7ad12727e7a for ***:0, 500 Internal Server Error in 268.0ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:39 ...ntainer/container.go:84:apiError() [E] [6339d983-18] close /data/gitea/tmp/package-upload/af7mr9wfgbxbdmkkvjbqmdmap: file already closed 
2022/10/02 18:33:39 [6339d983-18] router: completed PUT /v2/divya.jain/homer/blobs/uploads/af7mr9wfgbxbdmkkvjbqmdmap?digest=sha256%3A4b9fb091993f2d3745facb4eaa28865f24e02a88235f03120f02cab2387396ea for ***:0, 500 Internal Server Error in 260.8ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:39 ...ntainer/container.go:84:apiError() [E] [6339d983-17] close /data/gitea/tmp/package-upload/itaijpzkc1fgq8udcmvko4sds: file already closed 
2022/10/02 18:33:39 [6339d983-17] router: completed PUT /v2/divya.jain/homer/blobs/uploads/itaijpzkc1fgq8udcmvko4sds?digest=sha256%3Ac2d6d98eb0ad76128702bbaf1c7b1d27800c3ff047bf4c38e2fa63e529fd742f for ***:0, 500 Internal Server Error in 423.1ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:40 [6339d983-12] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/jovlqnu1hlfn06neqfksq1v3p for ***:0, 202 Accepted in 920.3ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:40 [6339d983-15] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/ctxbod81ws65p7fqgjakmisec for ***:0, 202 Accepted in 689.9ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:40 ...ntainer/container.go:84:apiError() [E] [6339d984] close /data/gitea/tmp/package-upload/jovlqnu1hlfn06neqfksq1v3p: file already closed    
2022/10/02 18:33:40 [6339d984] router: completed PUT /v2/divya.jain/homer/blobs/uploads/jovlqnu1hlfn06neqfksq1v3p?digest=sha256%3A1cfe1c2fcbd63648fd717163e09d641d2556e1a8a4eed8b1b06375db4f9150b2 for ***:0, 500 Internal Server Error in 183.1ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:40 ...ntainer/container.go:84:apiError() [E] [6339d984-2] close /data/gitea/tmp/package-upload/ctxbod81ws65p7fqgjakmisec: file already closed  
2022/10/02 18:33:40 [6339d984-2] router: completed PUT /v2/divya.jain/homer/blobs/uploads/ctxbod81ws65p7fqgjakmisec?digest=sha256%3A44e606d5c30ec85bd17cc13a405421639bb47264be32ede155bb5f7f59eb2a4c for ***:0, 500 Internal Server Error in 317.3ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:44 [6339d988] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 82.2ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:44 [6339d988-2] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/zfgbxqngsz7ajlu9dksd89uep for ***:0, 202 Accepted in 90.0ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:45 [6339d988-3] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 251.3ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:45 [6339d988-4] router: completed PUT /v2/divya.jain/homer/blobs/uploads/zfgbxqngsz7ajlu9dksd89uep?digest=sha256%3Ab9921724b705025663ffedd9ee6058a69630037c7ae4793e8bbfc7ad12727e7a for ***:0, 201 Created in 188.4ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:45 [6339d989] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 217.7ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:45 [6339d989-2] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/adpflbt5kxfjqcturwe5laurk for ***:0, 202 Accepted in 186.0ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:45 [6339d989-3] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:b9921724b705025663ffedd9ee6058a69630037c7ae4793e8bbfc7ad12727e7a for ***:0, 200 OK in 221.9ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:45 [6339d989-4] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/3fwuvvivxx2exy7iqjnmnojny for ***:0, 202 Accepted in 172.3ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:45 [6339d989-5] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 170.5ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:45 [6339d989-7] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:ea9309e8668568f3c1138d9df7b535a98f7f9d37a22f01824c8f1674ae17b662 for ***:0, 404 Not Found in 85.1ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:45 [6339d989-9] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 105.7ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:45 [6339d989-10] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/0lwzdpctgy03htwxhqqouy4ir for ***:0, 202 Accepted in 178.7ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:45 [6339d989-6] router: completed PUT /v2/divya.jain/homer/blobs/uploads/adpflbt5kxfjqcturwe5laurk?digest=sha256%3A4b9fb091993f2d3745facb4eaa28865f24e02a88235f03120f02cab2387396ea for ***:0, 201 Created in 407.7ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:45 [6339d989-8] router: completed PUT /v2/divya.jain/homer/blobs/uploads/3fwuvvivxx2exy7iqjnmnojny?digest=sha256%3Ac2d6d98eb0ad76128702bbaf1c7b1d27800c3ff047bf4c38e2fa63e529fd742f for ***:0, 201 Created in 410.9ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:45 [6339d989-11] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 369.8ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:45 [6339d989-14] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:4b9fb091993f2d3745facb4eaa28865f24e02a88235f03120f02cab2387396ea for 
***:0, 200 OK in 130.6ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:45 [6339d989-12] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/iueuhhkeh652bfrnboszswltk for ***:0, 202 Accepted in 399.6ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:45 [6339d989-17] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49 for 
***:0, 404 Not Found in 74.6ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:46 [6339d989-15] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:c2d6d98eb0ad76128702bbaf1c7b1d27800c3ff047bf4c38e2fa63e529fd742f for 
***:0, 200 OK in 197.2ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:46 [6339d989-13] router: completed PUT /v2/divya.jain/homer/blobs/uploads/0lwzdpctgy03htwxhqqouy4ir?digest=sha256%3A1cfe1c2fcbd63648fd717163e09d641d2556e1a8a4eed8b1b06375db4f9150b2 for ***:0, 201 Created in 412.6ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:46 [6339d98a-2] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 142.8ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:46 [6339d98a-3] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:1cfe1c2fcbd63648fd717163e09d641d2556e1a8a4eed8b1b06375db4f9150b2 for ***:0, 200 OK in 80.4ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:46 [6339d98a] router: completed PUT /v2/divya.jain/homer/blobs/uploads/iueuhhkeh652bfrnboszswltk?digest=sha256%3A44e606d5c30ec85bd17cc13a405421639bb47264be32ede155bb5f7f59eb2a4c for ***:0, 201 Created in 243.6ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:46 [6339d989-16] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/vhkbqbjwbq9fnyihy5ydvxwjt for ***:0, 202 Accepted in 468.7ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:46 [6339d98a-5] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:44e606d5c30ec85bd17cc13a405421639bb47264be32ede155bb5f7f59eb2a4c for ***:0, 200 OK in 138.4ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:46 ...ntainer/container.go:84:apiError() [E] [6339d98a-6] close /data/gitea/tmp/package-upload/vhkbqbjwbq9fnyihy5ydvxwjt: file already closed  
2022/10/02 18:33:46 [6339d98a-6] router: completed PUT /v2/divya.jain/homer/blobs/uploads/vhkbqbjwbq9fnyihy5ydvxwjt?digest=sha256%3Aea9309e8668568f3c1138d9df7b535a98f7f9d37a22f01824c8f1674ae17b662 for ***:0, 500 Internal Server Error in 275.2ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:46 [6339d98a-4] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/pcnob23a7qm5fzskq1x7q8cps for ***:0, 202 Accepted in 570.2ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:46 ...ntainer/container.go:84:apiError() [E] [6339d98a-7] close /data/gitea/tmp/package-upload/pcnob23a7qm5fzskq1x7q8cps: file already closed  
2022/10/02 18:33:46 [6339d98a-7] router: completed PUT /v2/divya.jain/homer/blobs/uploads/pcnob23a7qm5fzskq1x7q8cps?digest=sha256%3A213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49 for ***:0, 500 Internal Server Error in 223.0ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:50 [6339d98e] router: completed GET / for 10.0.0.220:44548, 303 See Other in 0.7ms @ web/home.go:26(web.Home)
2022/10/02 18:33:50 [6339d98e-2] router: completed GET / for 10.0.0.4:58942, 303 See Other in 0.6ms @ web/home.go:26(web.Home)
2022/10/02 18:33:51 [6339d98f] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 87.8ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:52 [6339d98f-3] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 81.4ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:52 [6339d98f-2] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/erfntmtoaauh4rjz90ioifdmo for ***:0, 202 Accepted in 409.8ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:52 [6339d990-2] router: completed PUT /v2/divya.jain/homer/blobs/uploads/erfntmtoaauh4rjz90ioifdmo?digest=sha256%3Aea9309e8668568f3c1138d9df7b535a98f7f9d37a22f01824c8f1674ae17b662 for ***:0, 201 Created in 106.0ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:52 [6339d990-3] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:ea9309e8668568f3c1138d9df7b535a98f7f9d37a22f01824c8f1674ae17b662 for ***:0, 200 OK in 75.4ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:52 [6339d990] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/fdebhsree52kmconxf9gzafi7 for ***:0, 202 Accepted in 540.3ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:52 [6339d990-4] router: completed PUT /v2/divya.jain/homer/blobs/uploads/fdebhsree52kmconxf9gzafi7?digest=sha256%3A213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49 for ***:0, 201 Created in 128.4ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:33:52 [6339d990-5] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:213ec9aee27d8be045c6a92b7eac22c9a64b44558193775a1a7f626352392b49 for ***:0, 200 OK in 67.7ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:52 [6339d990-6] router: completed HEAD /v2/divya.jain/homer/blobs/sha256:13ea515c1e29df3db03803c690e76ccce343744889ceae2b9f21f0d3801b1eb6 for ***:0, 404 Not Found in 39.4ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:33:52 [6339d990-7] router: completed POST /v2/divya.jain/homer/blobs/uploads/ for ***:0, 202 Accepted in 80.6ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:33:53 [6339d990-8] router: completed PATCH /v2/divya.jain/homer/blobs/uploads/ec3y6dwghbvgzubgv7whbdiy5 for ***:0, 202 Accepted in 105.4ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:33:53 ...ntainer/container.go:84:apiError() [E] [6339d991] close /data/gitea/tmp/package-upload/ec3y6dwghbvgzubgv7whbdiy5: file already closed    
2022/10/02 18:33:53 [6339d991] router: completed PUT /v2/divya.jain/homer/blobs/uploads/ec3y6dwghbvgzubgv7whbdiy5?digest=sha256%3A13ea515c1e29df3db03803c690e76ccce343744889ceae2b9f21f0d3801b1eb6 for ***:0, 500 Internal Server Error in 175.1ms @ container/container.go:297(container.EndUploadBlob)

Type 2 (in container.UploadManifest):

2022/10/02 18:43:44 [6339dbe0] router: completed GET /v2/ for ***:0, 401 Unauthorized in 0.1ms @ container/container.go:113(container.ReqContainerAccess)
2022/10/02 18:43:44 [6339dbe0-2] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&service=container_registry for ***:0, 200 OK in 97.2ms @ container/container.go:137(container.Authenticate)
2022/10/02 18:43:44 [6339dbe0-3] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:2fe460a2a5a17b934b9a339dbf7c155ac69414bd4e5bb9d35770b7dfe695d317 for ***:0, 404 Not Found in 41.0ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:44 [6339dbe0-5] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:df31f910d6917e56e80da012bd8f369817b028ab514a0704fec022a1f9f494cb for ***:0, 404 Not Found in 56.1ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:44 [6339dbe0-4] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:1b3c38b45ba2790f5f260b583a29a44f87770b51c81cf9f75afcbae5a184ff04 for ***:0, 404 Not Found in 78.9ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:44 [6339dbe0-6] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&scope=repository%3Adivya.jain%2Ftest-repo%3Apull&service=container_registry for ***:0, 200 OK in 101.8ms @ container/container.go:137(container.Authenticate) 
2022/10/02 18:43:44 [6339dbe0-7] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=divya.jain%2Ftest-repo&mount=sha256%3A2fe460a2a5a17b934b9a339dbf7c155ac69414bd4e5bb9d35770b7dfe695d317 for ***:0, 202 Accepted in 106.8ms @ container/container.go:190(container.InitiateUploadBlob) 
2022/10/02 18:43:44 [6339dbe0-8] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&scope=repository%3Adivya.jain%2Ftest-repo%3Apull&service=container_registry for ***:0, 200 OK in 176.1ms @ container/container.go:137(container.Authenticate) 
2022/10/02 18:43:44 [6339dbe0-9] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=divya.jain%2Ftest-repo&mount=sha256%3Adf31f910d6917e56e80da012bd8f369817b028ab514a0704fec022a1f9f494cb for ***:0, 202 Accepted in 98.3ms @ container/container.go:190(container.InitiateUploadBlob)  
2022/10/02 18:43:44 [6339dbe0-10] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&scope=repository%3Adivya.jain%2Ftest-repo%3Apull&service=container_registry for ***:0, 200 OK in 166.7ms @ container/container.go:137(container.Authenticate)2022/10/02 18:43:45 [6339dbe0-12] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=divya.jain%2Ftest-repo&mount=sha256%3A1b3c38b45ba2790f5f260b583a29a44f87770b51c81cf9f75afcbae5a184ff04 for ***:0, 202 Accepted in 84.5ms @ container/container.go:190(container.InitiateUploadBlob) 
2022/10/02 18:43:45 [6339dbe0-11] router: completed PATCH /v2/divya.jain/plugins-gitea-release/blobs/uploads/v5ekmb2kov8z4pfxlumz19aii for ***:0, 202 
Accepted in 192.8ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:43:45 [6339dbe0-13] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&scope=repository%3Aseclore-admin%2Ftrp%3Apull&service=container_registry for ***:0, 200 OK in 230.9ms @ container/container.go:137(container.Authenticate)   
2022/10/02 18:43:45 [6339dbe1] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=seclore-admin%2Ftrp&mount=sha256%3Adf31f910d6917e56e80da012bd8f369817b028ab514a0704fec022a1f9f494cb for ***:0, 202 Accepted in 108.0ms @ container/container.go:190(container.InitiateUploadBlob)      
2022/10/02 18:43:45 [6339dbe1-2] router: completed GET /v2/token?account=divya.jain&scope=repository%3Adivya.jain%2Fplugins-gitea-release%3Apush%2Cpull&scope=repository%3Aseclore-admin%2Ftrp%3Apull&service=container_registry for ***:0, 200 OK in 178.9ms @ container/container.go:137(container.Authenticate)    
2022/10/02 18:43:45 [6339dbe1-4] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=seclore-admin%2Ftrp&mount=sha256%3A1b3c38b45ba2790f5f260b583a29a44f87770b51c81cf9f75afcbae5a184ff04 for ***:0, 202 Accepted in 56.2ms @ container/container.go:190(container.InitiateUploadBlob)     
2022/10/02 18:43:45 [6339dbe1-3] router: completed DELETE /v2/divya.jain/plugins-gitea-release/blobs/uploads/bejuguo259ikm0pk8kvpdlgaw for ***:0, 404 
Not Found in 71.4ms @ packages/api.go:292(packages.ContainerRoutes.func2.2)
2022/10/02 18:43:45 [6339dbe1-6] router: completed DELETE /v2/divya.jain/plugins-gitea-release/blobs/uploads/fthsy8hats3omtfpv1mgwyhj9 for ***:0, 404 
Not Found in 26.1ms @ packages/api.go:292(packages.ContainerRoutes.func2.2)
2022/10/02 18:43:45 [6339dbe1-5] router: completed PUT /v2/divya.jain/plugins-gitea-release/blobs/uploads/v5ekmb2kov8z4pfxlumz19aii?digest=sha256%3A2fe460a2a5a17b934b9a339dbf7c155ac69414bd4e5bb9d35770b7dfe695d317 for ***:0, 201 Created in 209.5ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:43:45 [6339dbe1-9] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:2fe460a2a5a17b934b9a339dbf7c155ac69414bd4e5bb9d35770b7dfe695d317 for ***:0, 200 OK in 14.9ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:45 [6339dbe1-7] router: completed PATCH /v2/divya.jain/plugins-gitea-release/blobs/uploads/binee7wsxiksm0tpgvwkzostr for ***:0, 202 Accepted in 247.4ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:43:45 [6339dbe1-10] router: completed PUT /v2/divya.jain/plugins-gitea-release/blobs/uploads/binee7wsxiksm0tpgvwkzostr?digest=sha256%3Adf31f910d6917e56e80da012bd8f369817b028ab514a0704fec022a1f9f494cb for ***:0, 201 Created in 177.2ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:43:45 [6339dbe1-11] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:df31f910d6917e56e80da012bd8f369817b028ab514a0704fec022a1f9f494cb for ***:0, 200 OK in 66.6ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:46 [6339dbe1-8] router: completed PATCH /v2/divya.jain/plugins-gitea-release/blobs/uploads/xqstbjn9zlzbowfhqgqhgxf8b for ***:0, 202 Accepted in 1081.3ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:43:46 [6339dbe2] router: completed PUT /v2/divya.jain/plugins-gitea-release/blobs/uploads/xqstbjn9zlzbowfhqgqhgxf8b?digest=sha256%3A1b3c38b45ba2790f5f260b583a29a44f87770b51c81cf9f75afcbae5a184ff04 for ***:0, 201 Created in 156.0ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:43:46 [6339dbe2-2] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:1b3c38b45ba2790f5f260b583a29a44f87770b51c81cf9f75afcbae5a184ff04 for ***:0, 200 OK in 71.2ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:46 [6339dbe2-3] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:a5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc for ***:0, 404 Not Found in 46.9ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:46 [6339dbe2-4] router: completed POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/ for ***:0, 202 Accepted in 81.5ms @ container/container.go:190(container.InitiateUploadBlob)
2022/10/02 18:43:47 [6339dbe2-5] router: completed PATCH /v2/divya.jain/plugins-gitea-release/blobs/uploads/j0oal96ubzybn8eandfoskmdm for ***:0, 202 Accepted in 109.6ms @ container/container.go:252(container.UploadBlob)
2022/10/02 18:43:47 [6339dbe3] router: completed PUT /v2/divya.jain/plugins-gitea-release/blobs/uploads/j0oal96ubzybn8eandfoskmdm?digest=sha256%3Aa5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc for ***:0, 201 Created in 154.4ms @ container/container.go:297(container.EndUploadBlob)
2022/10/02 18:43:47 [6339dbe3-2] router: completed HEAD /v2/divya.jain/plugins-gitea-release/blobs/sha256:a5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc for ***:0, 200 OK in 77.1ms @ container/container.go:372(container.HeadBlob)
2022/10/02 18:43:47 ...ntainer/container.go:84:apiError() [E] [6339dbe3-3] EOF
2022/10/02 18:43:47 [6339dbe3-3] router: completed PUT /v2/divya.jain/plugins-gitea-release/manifests/latest for ***:0, 500 Internal Server Error in 84.8ms @ container/container.go:440(container.UploadManifest)

All these problems disappear as soon as I switch to local storage.

Gitea Version

1.17

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Official Gitea Docker Image

Database

SQLite

@dvjn dvjn added the type/bug label Oct 2, 2022
@wxiaoguang wxiaoguang added this to the 1.17.3 milestone Oct 3, 2022
@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 3, 2022

The close /data/gitea/tmp/package-upload/ec3y6dwghbvgzubgv7whbdiy5: file already closed errors are strange because the path is the local temporary upload copy. There should be no difference when using another storage type.

Do you get this error every time? Do all seven layers fail or just some of them?

@dvjn
Copy link
Author

dvjn commented Oct 3, 2022

@KN4CK3R all layers are failing but only for certain images, some images are being pushed without a problem.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 3, 2022 via email

@dvjn
Copy link
Author

dvjn commented Oct 3, 2022

Could you test if it's the same problem as in #19586 (comment)

Tested it, this is not the same problem. It is still retrying, now just one layer at a time.

Is one of the failing images public so I could test it?

Yes, I've just retagged existing public images to test it.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 3, 2022 via email

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 5, 2022

I can't reproduce it. Which docker cli version do you use? Your client makes multiple calls to the authenticate endpoint which my client does not. That's not the reason for the error but we use different clients then.

@dvjn
Copy link
Author

dvjn commented Oct 5, 2022

I can't reproduce it.

:(

Which docker cli version do you use?

Docker version 20.10.17, build 100c701

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 5, 2022

I have the same version. Wondering why your client behaves differently. My client does not send the mount (POST /v2/divya.jain/plugins-gitea-release/blobs/uploads/?from=divya.jain%2Ftest-repo&mount=sha256:2fe460a2a5a17b934b9a339dbf7c155ac69414bd4e5bb9d35770b7dfe695d317) or upload delete (DELETE /v2/divya.jain/plugins-gitea-release/blobs/uploads/bejuguo259ikm0pk8kvpdlgaw) requests.

Anyway, the EOF error should be a missing config layer. For plugins/gitea-release:latest the digest is a5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc. Could you please check this file is present in your storage? The path should be /data/gitea/packages/a5/05/a5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc. There is a valid upload log for this file (PUT /v2/divya.jain/plugins-gitea-release/blobs/uploads/j0oal96ubzybn8eandfoskmdm?digest=sha256:a5051cea39fab804969e46c21fefc4f8c75b4bfd29c9ef2da37407a97f5d9dbc for ***:0, 201 Created) but better check it. The content should be a valid JSON document.

@dvjn
Copy link
Author

dvjn commented Oct 5, 2022

Yes I checked the file, it is a valid JSON document.

@dvjn
Copy link
Author

dvjn commented Oct 5, 2022

Can the mount and delete requests have something to do with me already having tried to push the same image multiple times unsuccessfully?

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 5, 2022

Maybe, but that should not be a problem. From the log, the mount is ignored and a new upload is instantiated. Do you have the same errors if you use a (local) minio server instance instead of AWS? I have no idea how the EOF error could occur if all 4 files got uploaded. I could create a PR which adds more logging but I'm not sure if this helps in this case.

@dvjn
Copy link
Author

dvjn commented Oct 5, 2022

Will test that as soon as I get a chance

@dvjn
Copy link
Author

dvjn commented Oct 5, 2022

Meanwhile, can you please point me to the part of the code where the file is uploaded to minio server. Maybe I'd be able to help in debugging.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 5, 2022

The EOF error should occur here inside ParseImageConfig:

configReader, err := packages_module.NewContentStore().Get(packages_module.BlobHash256Key(configDescriptor.Blob.HashSHA256))
if err != nil {
return err
}
defer configReader.Close()
metadata, err := container_module.ParseImageConfig(manifest.Config.MediaType, configReader)
if err != nil {
return err
}

There the config file is read from the storage and parsed. configReader is the reader for the AWS file.

@dvjn
Copy link
Author

dvjn commented Oct 6, 2022

Do you have the same errors if you use a (local) minio server instance instead of AWS?

Yes :(

PS: I am not able to reproduce the EOF error in UploadManifest, will try again with a new setup.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 6, 2022 via email

@dvjn
Copy link
Author

dvjn commented Oct 6, 2022

I did some digging and from my limited understanding, the api request is returning 500 at the following place, when uploader.Close() is called which calls close function of the internal file.

if err := uploader.Close(); err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return
}

Just a thought:
Is it okay to ignore the file already closed error and not fail the API request, as closing the file is the intended action?
Can we verify this by creating a new image with this change and check if the issue is resolved?

@dvjn
Copy link
Author

dvjn commented Oct 6, 2022

I created a minimal configuration in which I am encountering the bug.

Steps:

  • Create folder structure
    minio/
    data/gitea/conf/app.ini
    docker-compose.yml
    
  • chown -R 1001:1001 minio
  • docker compose up -d
  • Log into localhost:9091 with admin and password
  • create a public bucket gitea-bucket
  • docker compose down && docker compose up -d

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 6, 2022

What's the content of your gitea.env file?

@dvjn
Copy link
Author

dvjn commented Oct 6, 2022

My bad, I updated the compose file with inline environment variables.

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 6, 2022

Thank you, I can reproduce the file already closed error now 👍

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 6, 2022

If I use gitea/gitea:dev the error is gone. Gitea 1.17 is build with Go 1.18 and Gitea 1.18 with Go 1.19. Maybe there was a Go bug or something. Could you test it with :dev again?

@dvjn
Copy link
Author

dvjn commented Oct 6, 2022

Yeah, the error is gone.

Any idea timelines for v1.18 stable release?

@KN4CK3R
Copy link
Member

KN4CK3R commented Oct 6, 2022

Feature freeze is in one week. Then there will be the RC versions. My guess would be 4-5 weeks after that.

There were no relevant changes to the container code since 1.17, so sadly I don't know if I could help you for 1.17.

@stevefan1999-personal
Copy link

I was on 1.18 RC1 but I saw this

2022/11/11 13:20:17 ...ntainer/container.go:84:apiError() [E] [636e4c11-24] readObjectStart: expect { or n, but found 1, error found in #1 byte of ...|1173;chunk-|..., bigger context ...|1173;chunk-signature=07fb4250f5b2ba19c884144f6978ce|...
2022/11/11 13:20:17 [636e4c11-24] router: completed PUT /v2/<redacted>/helper-bots/<redacted>/manifests/latest for 10.244.199.45:38684, 500 Internal Server Error in 5.5ms @ packages/api.go:358(packages.ContainerRoutes.func2.2)

And the problem still persists. I will try to wipe the data first

@KN4CK3R
Copy link
Member

KN4CK3R commented Nov 11, 2022

Looks like it's not a valid JSON document...?

@stevefan1999-personal
Copy link

stevefan1999-personal commented Nov 11, 2022

@KN4CK3R I took some time to download the offending files, so it seems like it's an affirmative, because the file, it looks like this
image

which is obviously not a JSON

this coincides with the error shown here:
image

@stevefan1999-personal
Copy link

stevefan1999-personal commented Nov 11, 2022

hmmmmmmmmmmmm maybe its a bug from OpenStack Swift that the QuObjects from QNAP was using an ancient version for? But I think this kind of bug is egregious and I don't believe the bugtracker for OpenStack didn't have any mention about chunk-signature...

edit: Bingo

@KN4CK3R
Copy link
Member

KN4CK3R commented Nov 11, 2022

From your first screenshot it looks like QuObjects saved the chunked upload into the file without removing the chunk parts. Maybe you can configure something to allow chunked uploads? Otherwise I don't know if we can help you.

edit: Looks like you found the problem.

If you can compile Gitea you may try this (minio.go):

func (m *MinioStorage) Save(path string, r io.Reader, size int64) (int64, error) {
	uploadInfo, err := m.client.PutObject(
		m.ctx,
		m.bucket,
		m.buildMinioPath(path),
		r,
		size,
- 		minio.PutObjectOptions{ContentType: "application/octet-stream"},
+ 		minio.PutObjectOptions{ContentType: "application/octet-stream", DisableContentSha256: true},
	)
	if err != nil {
		return 0, convertMinioErr(err)
	}
	return uploadInfo.Size, nil
}

That may disable the signature for uploads.

https://github.com/minio/minio-go/blob/36e5116001d9e05dc27e8ecc790d261bd1632906/api.go#L841

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
@delvh delvh added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed reviewed/invalid labels Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea topic/packages
Projects
None yet
Development

No branches or pull requests

5 participants