[GH-ISSUE #1916] Docker gha cache exporter fails #923

Closed
opened 2026-03-01 21:47:27 +03:00 by kerem · 6 comments
Owner

Originally created by @zacps on GitHub (Jul 16, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1916

Bug report info

act version:            0.2.48
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:           
        /home/zac/.actrc:
                -P ubuntu-latest=catthehacker/ubuntu:act-latest
                -P ubuntu-22.04=catthehacker/ubuntu:act-22.04
                -P ubuntu-20.04=catthehacker/ubuntu:act-20.04
                -P ubuntu-18.04=catthehacker/ubuntu:act-18.04
Build info:
        Go version:            go1.18.10
        Module path:           github.com/nektos/act
        Main version:          (devel)
        Main path:             github.com/nektos/act
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -s -w -X main.version=0.2.48 -X main.commit=3a0a6425a80f3405670d8d7b11ed18ea56a09af4 -X main.date=2023-07-10T20:04:04Z -X main.builtBy=goreleaser
                CGO_ENABLED:          0
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
                vcs:                  git
                vcs.revision:         3a0a6425a80f3405670d8d7b11ed18ea56a09af4
                vcs.time:             2023-07-10T20:03:46Z
                vcs.modified:         false
Docker Engine:
        Engine version:        24.0.2
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         systemd
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Ubuntu 22.04.2 LTS
        OS type:               linux
        OS version:            22.04
        OS arch:               x86_64
        OS kernel:             5.19.0-46-generic
        OS CPU:                16
        OS memory:             31811 MB
        Security options:
                name=apparmor
                name=seccomp,profile=builtin
                name=cgroupns

Command used with act

act pull_request --pull=false -r -e event.json --artifact-server-path ~/.artifacts/

Describe issue

The gha cache style would either work or silently be ignored, instead the job fails if it is configured.

The other parts of the workflow file are sensitive.

No response

Workflow content

- name: Build
        uses: docker/build-push-action@v4
        with:
          context: "path/to/context"
          push: false
          cache-from: type=gha
          cache-to: type=gha,mode=max
          tags: "a-tag"
          outputs: type=docker,dest=/tmp/model-path
          ssh: default=${{ env.SSH_AUTH_SOCK }}

Relevant log output

[CI/build-1      ]   ❗  ::error::buildx failed with: ERROR: failed to solve: failed to configure gha cache exporter: token contains an invalid number of segments

Additional information

No response

Originally created by @zacps on GitHub (Jul 16, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1916 ### Bug report info ```plain text act version: 0.2.48 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/zac/.actrc: -P ubuntu-latest=catthehacker/ubuntu:act-latest -P ubuntu-22.04=catthehacker/ubuntu:act-22.04 -P ubuntu-20.04=catthehacker/ubuntu:act-20.04 -P ubuntu-18.04=catthehacker/ubuntu:act-18.04 Build info: Go version: go1.18.10 Module path: github.com/nektos/act Main version: (devel) Main path: github.com/nektos/act Main checksum: Build settings: -compiler: gc -ldflags: -s -w -X main.version=0.2.48 -X main.commit=3a0a6425a80f3405670d8d7b11ed18ea56a09af4 -X main.date=2023-07-10T20:04:04Z -X main.builtBy=goreleaser CGO_ENABLED: 0 GOARCH: amd64 GOOS: linux GOAMD64: v1 vcs: git vcs.revision: 3a0a6425a80f3405670d8d7b11ed18ea56a09af4 vcs.time: 2023-07-10T20:03:46Z vcs.modified: false Docker Engine: Engine version: 24.0.2 Engine runtime: runc Cgroup version: 2 Cgroup driver: systemd Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Ubuntu 22.04.2 LTS OS type: linux OS version: 22.04 OS arch: x86_64 OS kernel: 5.19.0-46-generic OS CPU: 16 OS memory: 31811 MB Security options: name=apparmor name=seccomp,profile=builtin name=cgroupns ``` ### Command used with act ```sh act pull_request --pull=false -r -e event.json --artifact-server-path ~/.artifacts/ ``` ### Describe issue The `gha` cache style would either work or silently be ignored, instead the job fails if it is configured. The other parts of the workflow file are sensitive. ### Link to GitHub repository _No response_ ### Workflow content ```yml - name: Build uses: docker/build-push-action@v4 with: context: "path/to/context" push: false cache-from: type=gha cache-to: type=gha,mode=max tags: "a-tag" outputs: type=docker,dest=/tmp/model-path ssh: default=${{ env.SSH_AUTH_SOCK }} ``` ### Relevant log output ```sh [CI/build-1 ] ❗ ::error::buildx failed with: ERROR: failed to solve: failed to configure gha cache exporter: token contains an invalid number of segments ``` ### Additional information _No response_
kerem 2026-03-01 21:47:27 +03:00
Author
Owner

@JoshMcCullough commented on GitHub (Sep 30, 2023):

Same here. Is there a workaround?

<!-- gh-comment-id:1741786300 --> @JoshMcCullough commented on GitHub (Sep 30, 2023): Same here. Is there a workaround?
Author
Owner

@JoshMcCullough commented on GitHub (Nov 23, 2023):

@zacps I finally got back on this project, where I was stuck with this issue and I resolved it as follows:

Add an input e.g. use-cache:

use-cache:
  type: boolean
  description: Whether or not to use the Docker action's cache feature.
  default: true

Optionally configure the cache options when calling the docker-build-push workflow:

with:
  cache-from: ${{ inputs.use-cache == 'true' && 'type=gha' || 'type=local,src=/tmp' }}
  cache-to: ${{ inputs.use-cache == 'true' && 'type=gha, mode=max' || 'type=local,dest=/tmp' }}

Make sure you pass the input forward from your test YAML!

<!-- gh-comment-id:1823783672 --> @JoshMcCullough commented on GitHub (Nov 23, 2023): @zacps I finally got back on this project, where I was stuck with this issue and I resolved it as follows: Add an input e.g. `use-cache`: ```yaml use-cache: type: boolean description: Whether or not to use the Docker action's cache feature. default: true ``` Optionally configure the cache options when calling the `docker-build-push` workflow: ```yaml with: cache-from: ${{ inputs.use-cache == 'true' && 'type=gha' || 'type=local,src=/tmp' }} cache-to: ${{ inputs.use-cache == 'true' && 'type=gha, mode=max' || 'type=local,dest=/tmp' }} ``` Make sure you pass the input forward from your test YAML!
Author
Owner

@github-actions[bot] commented on GitHub (May 22, 2024):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:2123621701 --> @github-actions[bot] commented on GitHub (May 22, 2024): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@bennesp commented on GitHub (May 28, 2024):

This is not a valid solution to me, since it requires changing the workflow. Has anyone succeeded in having GHA Cache working in act?

<!-- gh-comment-id:2134684942 --> @bennesp commented on GitHub (May 28, 2024): This is not a valid solution to me, since it requires changing the workflow. Has anyone succeeded in having GHA Cache working in `act`?
Author
Owner

@github-actions[bot] commented on GitHub (Nov 25, 2024):

Issue is stale and will be closed in 14 days unless there is new activity

<!-- gh-comment-id:2496441250 --> @github-actions[bot] commented on GitHub (Nov 25, 2024): Issue is stale and will be closed in 14 days unless there is new activity
Author
Owner

@shay-dahan commented on GitHub (Nov 20, 2025):

Is there any updates?

<!-- gh-comment-id:3556385716 --> @shay-dahan commented on GitHub (Nov 20, 2025): Is there any updates?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#923
No description provided.