Skip to content

Specifying gitlab.com in build-contexts causes the build to fail. #1450

@aetos382

Description

@aetos382

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Specifying https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git in build-contexts will result in an error.

Expected behaviour

Build succeeded.

Actual behaviour

#4 [internal] load git source https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git
#4 0.632 fatal: could not read Username for 'https://gitlab.eclipse.org/': terminal prompts disabled
#4 ERROR: error fetching default branch for repository https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git: git stderr:
fatal: could not read Username for 'https://gitlab.eclipse.org/': terminal prompts disabled
: exit status 128
------
 > [internal] load git source https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git:
0.632 fatal: could not read Username for 'https://gitlab.eclipse.org/': terminal prompts disabled
------
ERROR: failed to build: failed to solve: failed to load cache key: error fetching default branch for repository https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git: git stderr:
fatal: could not read Username for 'https://gitlab.eclipse.org/': terminal prompts disabled
: exit status 128

Repository URL

https://github.com/aetos382/DockerGitContext

Workflow run URL

https://github.com/aetos382/DockerGitContext/actions/runs/21486869782

YAML workflow

name: CloneInWorkflow

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  execute:
    runs-on: ubuntu-latest
    env:
      ACTIONS_STEP_DEBUG: true

    steps:
      - uses: docker/setup-buildx-action@v3
        with:
          buildkitd-flags: --debug

      - name: just clone repository
        run: |
          git clone https://github.com/aetos382/DockerGitContext.git
          git clone https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git
          ls -laR

      - name: build-with-additional-context-gitlab
        uses: docker/build-push-action@v6
        if: always()
        with:
          file: build-with-additional-context.dockerfile
          build-contexts: |
            additional-context=https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git
          load: true
          tags: build-with-additional-context-gitlab:latest

Workflow logs

logs_55819438215.zip

BuildKit logs

/usr/bin/docker logs buildx_buildkit_builder-db5fb9ce-3abc-45e5-8a55-b38abe74174c0
  time="2026-01-29T16:47:58Z" level=info msg="auto snapshotter: using overlayfs"
  time="2026-01-29T16:47:58Z" level=warning msg="using host network as the default"
  time="2026-01-29T16:47:58Z" level=info msg="found worker \"jmwr5bc1kjsi369jz9xm65mf0\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:1d83742a590d org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/amd64/v4 linux/386]"
  time="2026-01-29T16:47:58Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
  time="2026-01-29T16:47:58Z" level=info msg="found 1 workers, default=\"jmwr5bc1kjsi369jz9xm65mf0\""
  time="2026-01-29T16:47:58Z" level=warning msg="currently, only the default worker can be used."
  time="2026-01-29T16:47:58Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
  time="2026-01-29T16:48:00Z" level=debug msg="session started" spanID=1bb11dcddb41239b traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:00Z" level=debug msg="session finished: <nil>" spanID=1bb11dcddb41239b traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:00Z" level=debug msg="session started" spanID=fb91d08a3aa8cb98 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:00Z" level=debug msg="resolve exporter docker with map[name:build-with-additional-context-gitlab:latest]" spanID=80cd56ea521f467e traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:00Z" level=debug msg="checked for cached auth handler namespace" cached=false key="docker.io/library/ubuntu::pull" name=docker.io/library/ubuntu scope=pull
  time="2026-01-29T16:48:00Z" level=debug msg=resolving span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:00Z" level=debug msg="do request" request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/v0.26 request.method=HEAD span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" response.header.connection=keep-alive response.header.content-length=157 response.header.content-type=application/json response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=172.183.94.242 response.header.strict-transport-security="max-age=31536000" response.header.www-authenticate="***"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/ubuntu:pull\"" response.status="401 Unauthorized" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=Unauthorized header="***"https://auth.docker.io/token\",service=\"registry.docker.io\",scope=\"repository:library/ubuntu:pull\"" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="do request" request.header.accept="application/vnd.docker.distribution.manifest.v2+json, application/vnd.docker.distribution.manifest.list.v2+json, application/vnd.oci.image.manifest.v1+json, application/vnd.oci.image.index.v1+json, */*" request.header.user-agent=buildkit/v0.26 request.method=HEAD span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" response.header.connection=keep-alive response.header.content-length=6688 response.header.content-type=application/vnd.oci.image.index.v1+json response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.docker-content-digest="sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=59aa2839-97c5-4781-8b76-14f597fd2a04 response.header.etag="\"sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b\"" response.header.strict-transport-security="max-age=31536000" response.status="200 OK" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=resolved desc.digest="sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=fetch span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetching layer" chunk_size=0 initial_parallelism=0 offset=0 parallelism=1 span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="do request" request.header.accept="application/vnd.oci.image.index.v1+json, */*" request.header.accept-encoding="zstd;q=1.0, gzip;q=0.8, deflate;q=0.5" request.header.user-agent=buildkit/v0.26 request.method=GET span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" response.header.connection=keep-alive response.header.content-length=6688 response.header.content-type=application/vnd.oci.image.index.v1+json response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.docker-content-digest="sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=59aa2839-97c5-4781-8b76-14f597fd2a04 response.header.etag="\"sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b\"" response.header.strict-transport-security="max-age=31536000" response.status="200 OK" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=fetch span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetching layer" chunk_size=0 initial_parallelism=0 offset=0 parallelism=1 span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="do request" request.header.accept="application/vnd.oci.image.manifest.v1+json, */*" request.header.accept-encoding="zstd;q=1.0, gzip;q=0.8, deflate;q=0.5" request.header.user-agent=buildkit/v0.26 request.method=GET span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" response.header.connection=keep-alive response.header.content-length=424 response.header.content-type=application/vnd.oci.image.manifest.v1+json response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.docker-content-digest="sha256:a4453623f2f8319cfff65c43da9be80fe83b1a7ce689579b475867d69495b782" response.header.docker-distribution-api-version=registry/2.0 response.header.docker-ratelimit-source=59aa2839-97c5-4781-8b76-14f597fd2a04 response.header.etag="\"sha256:a4453623f2f8319cfff65c43da9be80fe83b1a7ce689579b475867d69495b782\"" response.header.strict-transport-security="max-age=31536000" response.status="200 OK" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=fetch span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetching layer" chunk_size=0 initial_parallelism=0 offset=0 parallelism=1 span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="do request" request.header.accept="application/vnd.oci.image.config.v1+json, */*" request.header.accept-encoding="zstd;q=1.0, gzip;q=0.8, deflate;q=0.5" request.header.user-agent=buildkit/v0.26 request.method=GET span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" response.header.accept-ranges=bytes response.header.age=1190148 response.header.cache-control="public, max-age=14400" response.header.cf-cache-status=HIT response.header.cf-ray=9c5a36f91aec1107-ORD response.header.connection=keep-alive response.header.content-length=2297 response.header.content-type=application/octet-stream response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.etag="\"e4345cafcc7caec1bbdd11c6df988803\"" response.header.expires="Thu, 29 Jan 2026 20:48:01 GMT" response.header.last-modified="Tue, 13 Jan 2026 06:35:41 GMT" response.header.server=cloudflare response.header.vary=Accept-Encoding response.header.x-amz-id-2=rRv7hAaEwyqjbyAlKQuqvkhTx+o+R0o91Idm0Ed1RfpXQ7cROeJdrOgIxn2AWGTE8JVRlvQP6/Ro+hn+TYIvYuMOKjOJ/7Y+ response.header.x-amz-request-id=326AHN91E08WD3ZC response.header.x-amz-server-side-encryption=AES256 response.header.x-amz-version-id=7gA0VfuJFD2j0PlleNEhXle7HJj4kRCy response.status="200 OK" span="resolving docker.io/library/ubuntu:latest" spanID=8b3769d9ac6639c3 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="checked for cached auth handler namespace" cached=true key="docker.io/library/ubuntu::pull" name=docker.io/library/ubuntu scope=pull
  time="2026-01-29T16:48:01Z" level=debug msg=fetch digest="sha256:cd1dba651b3080c3686ecf4e3c4220f026b521fb76978881737d24f200828b2b" mediatype=application/vnd.oci.image.index.v1+json size=6688 spanID=80cd56ea521f467e traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=fetch digest="sha256:a4453623f2f8319cfff65c43da9be80fe83b1a7ce689579b475867d69495b782" mediatype=application/vnd.oci.image.manifest.v1+json size=424 spanID=80cd56ea521f467e traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg=fetch digest="sha256:493218ed0f404132311952996fea8ce85e50c49f5a717f26f25c52a25fcb2e56" mediatype=application/vnd.oci.image.config.v1+json size=2297 spanID=80cd56ea521f467e traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="checked for cached auth handler namespace" cached=true key="docker.io/library/ubuntu::pull" name=docker.io/library/ubuntu scope=pull
  time="2026-01-29T16:48:01Z" level=debug msg="checked for cached auth handler namespace" cached=true key="docker.io/library/ubuntu::pull" name=docker.io/library/ubuntu scope=pull
  time="2026-01-29T16:48:01Z" level=debug msg=fetch digest="sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114" mediatype=application/vnd.oci.image.layer.v1.tar+gzip size=29726011 spanID=b6be522319d68909 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="fetching layer" chunk_size=0 digest="sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114" initial_parallelism=0 mediatype=application/vnd.oci.image.layer.v1.tar+gzip offset=0 parallelism=1 size=29726011 spanID=b6be522319d68909 traceID=e369d19354d5c74c7d42af430183111a
  time="2026-01-29T16:48:01Z" level=debug msg="do request" digest="sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114" mediatype=application/vnd.oci.image.layer.v1.tar+gzip request.header.accept="application/vnd.oci.image.layer.v1.tar+gzip, */*" request.header.accept-encoding="zstd;q=1.0, gzip;q=0.8, deflate;q=0.5" request.header.user-agent=buildkit/v0.26 request.method=GET size=29726011 spanID=b6be522319d68909 traceID=e369d19354d5c74c7d42af430183111a url="https://registry-1.docker.io/v2/library/ubuntu/blobs/sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114"
  time="2026-01-29T16:48:01Z" level=debug msg="fetch response received" digest="sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114" mediatype=application/vnd.oci.image.layer.v1.tar+gzip response.header.accept-ranges=bytes response.header.age=1193393 response.header.cache-control="public, max-age=14400" response.header.cf-cache-status=HIT response.header.cf-ray=9c5a36fafcc81107-ORD response.header.connection=keep-alive response.header.content-length=29726011 response.header.content-type=application/octet-stream response.header.date="Thu, 29 Jan 2026 16:48:01 GMT" response.header.etag="\"438286ffe475b29a1d9f7bb25755d3c4\"" response.header.expires="Thu, 29 Jan 2026 20:48:01 GMT" response.header.last-modified="Tue, 13 Jan 2026 06:35:38 GMT" response.header.server=cloudflare response.header.vary=Accept-Encoding response.header.x-amz-id-2="2VVrK3RFolyXK+9Caqq3zQgg19HicXLY1WIC3vM8eNnQwrz3+XfgbRszEnv82ubwDUuZl5Srjt2AWITnc+RnFygbrOKyIRSM/rflDHz1xac=" response.header.x-amz-request-id=ZN080RX87X6AZF3B response.header.x-amz-server-side-encryption=AES256 response.header.x-amz-storage-class=INTELLIGENT_TIERING response.header.x-amz-version-id=W7xfiP.J.jvu7kZNYcvMUoMxYmVyZ.kG response.status="200 OK" size=29726011 spanID=b6be522319d68909 traceID=e369d19354d5c74c7d42af430183111a url="https://registry-1.docker.io/v2/library/ubuntu/blobs/sha256:a3629ac5b9f4680dc2032439ff2354e73b06aecc2e68f0035a2d7c001c8b4114"
  time="2026-01-29T16:48:02Z" level=error msg="/moby.buildkit.v1.Control/Solve returned error: rpc error: code = Unknown desc = failed to load cache key: error fetching default branch for repository https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git: git stderr:\nfatal: could not read Username for 'https://gitlab.eclipse.org': terminal prompts disabled\n: exit status 128" spanID=80cd56ea521f467e traceID=e369d19354d5c74c7d42af430183111a
  failed to load cache key: error fetching default branch for repository https://gitlab.eclipse.org/eclipse/asciidoc-lang/asciidoc-tck.git: git stderr:
  fatal: could not read Username for 'https://gitlab.eclipse.org': terminal prompts disabled
  : exit status 128
  7 v0.26.3 buildkitd --debug --allow-insecure-entitlement=network.host
  github.com/moby/buildkit/util/gitutil.(*GitCLI).Run
  	/src/util/gitutil/git_cli.go:240
  github.com/moby/buildkit/source/git.getDefaultBranch
  	/src/source/git/source.go:1216
  github.com/moby/buildkit/source/git.(*gitSourceHandler).resolveMetadata
  	/src/source/git/source.go:545
  github.com/moby/buildkit/source/git.(*gitSourceHandler).CacheKey
  	/src/source/git/source.go:668
  github.com/moby/buildkit/solver/llbsolver/ops.(*SourceOp).CacheMap
  	/src/solver/llbsolver/ops/source.go:83
  github.com/moby/buildkit/solver.(*sharedOp).CacheMap.func2
  	/src/solver/jobs.go:1101
  github.com/moby/buildkit/util/flightcontrol.(*call[...]).run
  	/src/util/flightcontrol/flightcontrol.go:122
  sync.(*Once).doSlow
  	/usr/local/go/src/sync/once.go:78
  sync.(*Once).Do
  	/usr/local/go/src/sync/once.go:69
  runtime.goexit
  	/usr/local/go/src/runtime/asm_amd64.s:1693
  
  7 v0.26.3 buildkitd --debug --allow-insecure-entitlement=network.host
  main.unaryInterceptor
  	/src/cmd/buildkitd/main.go:735
  google.golang.org/grpc.NewServer.chainUnaryServerInterceptors.chainUnaryInterceptors.func1
  	/src/vendor/google.golang.org/grpc/server.go:1234
  github.com/moby/buildkit/api/services/control._Control_Solve_Handler
  	/src/api/services/control/control_grpc.pb.go:289
  google.golang.org/grpc.(*Server).processUnaryRPC
  	/src/vendor/google.golang.org/grpc/server.go:1431
  google.golang.org/grpc.(*Server).handleStream
  	/src/vendor/google.golang.org/grpc/server.go:1842
  google.golang.org/grpc.(*Server).serveStreams.func2.1
  	/src/vendor/google.golang.org/grpc/server.go:1061
  runtime.goexit
  	/usr/local/go/src/runtime/asm_amd64.s:1693
  
  7 v0.26.3 buildkitd --debug --allow-insecure-entitlement=network.host
  github.com/moby/buildkit/solver.(*edge).unpark.func1
  	/src/solver/edge.go:345
  github.com/moby/buildkit/solver/internal/pipe.NewWithFunction[...].func2
  	/src/solver/internal/pipe/pipe.go:78
  runtime.goexit
  	/usr/local/go/src/runtime/asm_amd64.s:1693
  
  7 v0.26.3 buildkitd --debug --allow-insecure-entitlement=network.host
  github.com/moby/buildkit/source/git.getDefaultBranch
  	/src/source/git/source.go:1218
  github.com/moby/buildkit/source/git.(*gitSourceHandler).resolveMetadata
  	/src/source/git/source.go:545
  
  time="2026-01-29T16:48:02Z" level=debug msg="session finished: <nil>" spanID=fb91d08a3aa8cb98 traceID=e369d19354d5c74c7d42af430183111a

Additional info

Searching revealed several past cases where similar issues occurred when repositories contained private submodules.
But the repository specified in the additional context is public, and executing the git clone command within the workflow succeeds.
Therefore, it should also be usable as an additional context.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions