Skip to content

[Regression] Push to Harbor registry with S3 backend fails in v0.24.0, works in v0.23.2 #6187

@mnar-devo

Description

@mnar-devo

Contributing guidelines and issue reporting guide

Well-formed report checklist

  • I have found a bug that the documentation does not mention anything about my problem
  • I have found a bug that there are no open or closed issues that are related to my problem
  • I have provided version/information about my environment and done my best to provide a reproducer

Description of bug

Description

Since updating our build image from moby/buildkit:v0.23.2-rootless to moby/buildkit:v0.24.0-rootless, our GitLab CI jobs are failing when pushing images to our Harbor registry, which uses an AWS S3 backend for storage. The GitLab CI job fails with a misleading unauthorized error.

The same pipeline, pushing the same application to a different Harbor project, works perfectly fine with moby/buildkit:v0.24.0-rootless. The two Harbor projects appear to have the same configuration.

Steps to reproduce

  1. Use moby/buildkit:v0.24.0-rootless as the build image in a GitLab CI job.
  2. Build a Docker image.
  3. Push the image to a Harbor registry that is configured with an AWS S3 storage backend.

Expected behavior

The push operation should succeed, as it does with moby/buildkit:v0.23.2-rootless.

Actual behavior

The GitLab CI job fails with an unauthorized error. However, the Harbor registry logs show that the authentication was successful, but the registry itself returned an HTTP 500 error. The detailed error message from the registry pod is:
s3aws: RequestCanceled: request context canceled

Logs

Harbor Registry Logs (Failing Harbor Project)
Here are the relevant logs from the harbor-registry pod when the push fails with moby/buildkit:v0.24.0-rootless. We can clearly see the HTTP 500 error caused by the S3 request cancellation:

time="2025-09-04T12:37:49.222Z" level=error msg="response completed with error" auth.user.name=harbor_registry_user err.code=unknown err.detail="s3aws: RequestCanceled: request context canceled\ncaused by: context canceled" err.message="unknown error" go.version=go1.23.7 http.request.host=harbor.example.com http.request.id=e8cbae5c-7ed2-4d2d-8899-fb477708fa15 http.request.method=HEAD http.request.remoteaddr=<REMOTE_IP_ADDRESS> http.request.uri="/v2/my-failing-project/my-app/blobs/sha256:cf466e9ba1cfaf9351b9b793d92033975eb18f8b2ffadf9b5720caea1fcb9f48" http.request.useragent=buildkit/v0.24 http.response.contenttype=application/json http.response.duration=205.279044ms http.response.status=500 http.response.written=147 instance.id=<INSTANCE_ID> service=registry vars.digest="sha256:cf466e9ba1cfaf9351b9b793d92033975eb18f8b2ffadf9b5720caea1fcb9f48" vars.name=my-failing-project/my-app version=3.0.0
<INTERNAL_IP> - - [04/Sep/2025:12:37:49 +0000] "HEAD /v2/my-failing-project/my-app/blobs/sha256:cf466e9ba1cfaf9351b9b793d92033975eb18f8b2ffadf9b5720caea1fcb9f48 HTTP/1.1" 500 147 "" "buildkit/v0.24"
time="2025-09-04T13:18:11.818Z" level=error msg="response completed with error" auth.user.name=harbor_registry_user err.code=unknown err.detail="s3aws: RequestCanceled: request context canceled\ncaused by: context canceled" err.message="unknown error" go.version=go1.23.7 http.request.host=harbor.example.com http.request.id=bafc8dea-1887-4e17-91a0-72c564fd6d5b http.request.method=HEAD http.request.remoteaddr=<REMOTE_IP_ADDRESS> http.request.uri="/v2/my-failing-project/my-app/blobs/sha256:36186c6d9540a596c2e2ab811d7de1bd3c0ff0ec96216cc82d504d049fab108e" http.request.useragent=buildkit/v0.24 http.response.contenttype=application/json http.response.duration=196.42082ms http.response.status=500 http.response.written=147 instance.id=<INSTANCE_ID> service=registry vars.digest="sha256:36186c6d9540a596c2e2ab811d7de1bd3c0ff0ec96216cc82d504d049fab108e" vars.name=my-failing-project/my-app version=3.0.0
<INTERNAL_IP> - - [04/Sep/2025:13:18:11 +0000] "HEAD /v2/my-failing-project/my-app/blobs/sha256:36186c6d9540a596c2e2ab811d7de1bd3c0ff0ec96216cc82d504d049fab108e HTTP/1.1" 500 147 "" "buildkit/v0.24"

Harbor Registry Logs (Working Harbor Project)
For comparison, here are the logs from a successful push to a different Harbor project, on the same Harbor instance (with the same S3 backend), also using buildkit/v0.24.0:

time="2025-09-04T12:15:28.275Z" level=info msg="response completed" auth.user.name=harbor_registry_user go.version=go1.23.7 http.request.contenttype=application/vnd.docker.distribution.manifest.v2+json http.request.host=harbor.example.com http.request.id=9c655e57-c30e-4f89-835c-d0ac5c46aac3 http.request.method=PUT http.request.remoteaddr=<REMOTE_IP_ADDRESS> http.request.uri=/v2/my-working-project/my-api/manifests/1.9.1-feat-snapshot http.request.useragent=buildkit/v0.24 http.response.duration=357.625689ms http.response.status=201 http.response.written=0 instance.id=<INSTANCE_ID> service=registry vars.name=my-working-project/my-api vars.reference=1.9.1-feat-snapshot version=3.0.0
<INTERNAL_IP> - - [04/Sep/2025:12:15:27 +0000] "PUT /v2/my-working-project/my-api/manifests/1.9.1-feat-snapshot HTTP/1.1" 201 0 "" "buildkit/v0.24"
time="2025-09-04T12:15:30.821Z" level=info msg="response completed" auth.user.name=harbor_registry_user go.version=go1.23.7 http.request.contenttype=application/vnd.oci.image.manifest.v1+json http.request.host=harbor.example.com http.request.id=ec4bc5f9-704c-4ab9-b71e-25c7cd256988 http.request.method=PUT http.request.remoteaddr=<REMOTE_IP_ADDRESS> http.request.uri=/v2/my-working-project/my-api/manifests/cache http.request.useragent=buildkit/v0.24 http.response.duration=252.61318ms http.response.status=201 http.response.written=0 instance.id=<INSTANCE_ID> service=registry vars.name=my-working-project/my-api vars.reference=cache version=3.0.0
<INTERNAL_IP> - - [04/Sep/2025:12:15:30 +0000] "PUT /v2/my-working-project/my-api/manifests/cache HTTP/1.1" 201 0 "" "buildkit/v0.24"

Additional information

  • We have confirmed that the robot account credentials have the correct push/pull permissions on both Harbor projects.
  • Clearing the GitLab runner cache does not solve the issue.
  • The issue seems to be related to how moby/buildkit:v0.24.0-rootless performs requests, which might be causing timeouts or throttling issues on our S3 backend for one specific project.

Could there have been any changes in v0.24.0 regarding request parallelism, timeout handling, or the way HEAD requests are sent to the registry that could explain this behavior?

Thank you for your help!

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions