[GH-ISSUE #1866] Cache server EHOSTUNREACH #908

Open
opened 2026-03-01 21:47:20 +03:00 by kerem · 14 comments
Owner

Originally created by @yknx4 on GitHub (Jun 15, 2023).
Original GitHub issue: https://github.com/nektos/act/issues/1866

Bug report info

act version:            0.2.46
GOOS:                   linux
GOARCH:                 amd64
NumCPU:                 16
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
Config files:
        /home/yknx4/.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.20.4
        Module path:           command-line-arguments
        Main version:
        Main path:
        Main checksum:
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.46
                CGO_ENABLED:          1
                CGO_CFLAGS:
                CGO_CPPFLAGS:
                CGO_CXXFLAGS:
                CGO_LDFLAGS:
                GOARCH:               amd64
                GOOS:                 linux
                GOAMD64:              v1
Docker Engine:
        Engine version:        24.0.2
        Engine runtime:        runc
        Cgroup version:        1
        Cgroup driver:         cgroupfs
        Storage driver:        overlay2
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:
        OS arch:               x86_64
        OS kernel:             5.15.90.1-microsoft-standard-WSL2
        OS CPU:                16
        OS memory:             15614 MB
        Security options:
                name=seccomp,profile=builtin

Command used with act

act -s GITHUB_TOKEN="$(gh auth token)"

Describe issue

Cache is not working on WSL2, it cannot reach the server and thus all cache actions always fail.

No response

Workflow content

name: deps
on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]
jobs:
  deps:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: apt update
        run: sudo apt-get update
        shell: bash
      - uses: awalsh128/cache-apt-pkgs-action@latest
        with:
          packages: libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libuuid1 libx11-6 libx11-xcb1 libxcb-dri3-0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxss1 libxtst6
          version: 1.0

Relevant log output

[tests/deps] [DEBUG] type=remote-action actionDir=/home/yknx4/.cache/act/actions-cache-restore@v3 actionPath=restore workdir=/home/yknx4/src/zoobean/beanstack2 actionCacheDir=/home/yknx4/.cache/act actionName=actions-cache-restore@v3/restore containerActionDir=/var/run/act/actions/actions-cache-restore@v3/restore
[tests/deps] [DEBUG] Removing /home/yknx4/.cache/act/actions-cache-restore@v3/.gitignore before docker cp
[tests/deps] [DEBUG] /var/run/act/actions/actions-cache-restore@v3/
[tests/deps]   🐳  docker cp src=/home/yknx4/.cache/act/actions-cache-restore@v3/ dst=/var/run/act/actions/actions-cache-restore@v3/
[tests/deps] [DEBUG] Writing tarball /tmp/act2930208774 from /home/yknx4/.cache/act/actions-cache-restore@v3/
[tests/deps] [DEBUG] Stripping prefix:/home/yknx4/.cache/act/actions-cache-restore@v3/ src:/home/yknx4/.cache/act/actions-cache-restore@v3/
[tests/deps] [DEBUG] Extracting content from '/tmp/act2930208774' to '/var/run/act/actions/actions-cache-restore@v3/'
[tests/deps] [DEBUG] executing remote job container: [node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js]
[tests/deps]   🐳  docker exec cmd=[node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js] user= workdir=
[tests/deps] [DEBUG] Exec command '[node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js]'
[tests/deps] [DEBUG] Working directory '/home/yknx4/src/zoobean/beanstack2'
[tests/deps]   💬  ::debug::Resolved Keys:
[tests/deps]   💬  ::debug::["cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72"]
[tests/deps]   💬  ::debug::Checking zstd --quiet --version
[tests/deps]   💬  ::debug::1.4.8
[tests/deps]   💬  ::debug::zstd version: 1.4.8
[tests/deps]   💬  ::debug::Resource Url: http://172.17.143.138:42599/_apis/artifactcache/cache?keys=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72&version=9b20c9814e5d39ed5fb2bca3e82b64cef01cbcd6d355d0711cce04946822a7bd
[tests/deps]   💬  ::debug::getCacheEntry - Attempt 1 of 2 failed with error: connect EHOSTUNREACH 172.17.143.138:42599
[tests/deps]   💬  ::debug::Resource Url: http://172.17.143.138:42599/_apis/artifactcache/cache?keys=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72&version=9b20c9814e5d39ed5fb2bca3e82b64cef01cbcd6d355d0711cce04946822a7bd
[tests/deps]   💬  ::debug::getCacheEntry - Attempt 2 of 2 failed with error: connect EHOSTUNREACH 172.17.143.138:42599
[tests/deps]   🚧  ::warning::Failed to restore: getCacheEntry failed: connect EHOSTUNREACH 172.17.143.138:42599
[tests/deps]   💬  ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink ''
| Cache not found for input keys: cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72
[tests/deps]   ✅  Success - Main actions/cache/restore@v3
[tests/deps]   ⚙  ::set-output:: cache-primary-key=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72

Additional information

This is running in Windows with WSL2

Originally created by @yknx4 on GitHub (Jun 15, 2023). Original GitHub issue: https://github.com/nektos/act/issues/1866 ### Bug report info ```plain text act version: 0.2.46 GOOS: linux GOARCH: amd64 NumCPU: 16 Docker host: DOCKER_HOST environment variable is not set Sockets found: /var/run/docker.sock Config files: /home/yknx4/.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.20.4 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -buildmode: exe -compiler: gc -ldflags: -X main.version=0.2.46 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: linux GOAMD64: v1 Docker Engine: Engine version: 24.0.2 Engine runtime: runc Cgroup version: 1 Cgroup driver: cgroupfs Storage driver: overlay2 Registry URI: https://index.docker.io/v1/ OS: Docker Desktop OS type: linux OS version: OS arch: x86_64 OS kernel: 5.15.90.1-microsoft-standard-WSL2 OS CPU: 16 OS memory: 15614 MB Security options: name=seccomp,profile=builtin ``` ### Command used with act ```sh act -s GITHUB_TOKEN="$(gh auth token)" ``` ### Describe issue Cache is not working on WSL2, it cannot reach the server and thus all cache actions always fail. ### Link to GitHub repository _No response_ ### Workflow content ```yml name: deps on: push: branches: [ main ] pull_request: branches: [ main ] jobs: deps: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: apt update run: sudo apt-get update shell: bash - uses: awalsh128/cache-apt-pkgs-action@latest with: packages: libasound2 libatk-bridge2.0-0 libatk1.0-0 libatspi2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libdrm2 libexpat1 libgbm1 libglib2.0-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libuuid1 libx11-6 libx11-xcb1 libxcb-dri3-0 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxkbcommon0 libxrandr2 libxrender1 libxshmfence1 libxss1 libxtst6 version: 1.0 ``` ### Relevant log output ```sh [tests/deps] [DEBUG] type=remote-action actionDir=/home/yknx4/.cache/act/actions-cache-restore@v3 actionPath=restore workdir=/home/yknx4/src/zoobean/beanstack2 actionCacheDir=/home/yknx4/.cache/act actionName=actions-cache-restore@v3/restore containerActionDir=/var/run/act/actions/actions-cache-restore@v3/restore [tests/deps] [DEBUG] Removing /home/yknx4/.cache/act/actions-cache-restore@v3/.gitignore before docker cp [tests/deps] [DEBUG] /var/run/act/actions/actions-cache-restore@v3/ [tests/deps] 🐳 docker cp src=/home/yknx4/.cache/act/actions-cache-restore@v3/ dst=/var/run/act/actions/actions-cache-restore@v3/ [tests/deps] [DEBUG] Writing tarball /tmp/act2930208774 from /home/yknx4/.cache/act/actions-cache-restore@v3/ [tests/deps] [DEBUG] Stripping prefix:/home/yknx4/.cache/act/actions-cache-restore@v3/ src:/home/yknx4/.cache/act/actions-cache-restore@v3/ [tests/deps] [DEBUG] Extracting content from '/tmp/act2930208774' to '/var/run/act/actions/actions-cache-restore@v3/' [tests/deps] [DEBUG] executing remote job container: [node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js] [tests/deps] 🐳 docker exec cmd=[node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js] user= workdir= [tests/deps] [DEBUG] Exec command '[node /var/run/act/actions/actions-cache-restore@v3/dist/restore-only/index.js]' [tests/deps] [DEBUG] Working directory '/home/yknx4/src/zoobean/beanstack2' [tests/deps] 💬 ::debug::Resolved Keys: [tests/deps] 💬 ::debug::["cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72"] [tests/deps] 💬 ::debug::Checking zstd --quiet --version [tests/deps] 💬 ::debug::1.4.8 [tests/deps] 💬 ::debug::zstd version: 1.4.8 [tests/deps] 💬 ::debug::Resource Url: http://172.17.143.138:42599/_apis/artifactcache/cache?keys=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72&version=9b20c9814e5d39ed5fb2bca3e82b64cef01cbcd6d355d0711cce04946822a7bd [tests/deps] 💬 ::debug::getCacheEntry - Attempt 1 of 2 failed with error: connect EHOSTUNREACH 172.17.143.138:42599 [tests/deps] 💬 ::debug::Resource Url: http://172.17.143.138:42599/_apis/artifactcache/cache?keys=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72&version=9b20c9814e5d39ed5fb2bca3e82b64cef01cbcd6d355d0711cce04946822a7bd [tests/deps] 💬 ::debug::getCacheEntry - Attempt 2 of 2 failed with error: connect EHOSTUNREACH 172.17.143.138:42599 [tests/deps] 🚧 ::warning::Failed to restore: getCacheEntry failed: connect EHOSTUNREACH 172.17.143.138:42599 [tests/deps] 💬 ::debug::Failed to delete archive: Error: ENOENT: no such file or directory, unlink '' | Cache not found for input keys: cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72 [tests/deps] ✅ Success - Main actions/cache/restore@v3 [tests/deps] ⚙ ::set-output:: cache-primary-key=cache-apt-pkgs_91edd1e3afe94ade0b2f1b8baaebca72 ``` ### Additional information This is running in Windows with WSL2
Author
Owner

@wolfogre commented on GitHub (Jun 16, 2023):

In some environments, act cannot detect the correct IP to bind for the cache server (and artifact server).

"The correct IP" means it's accessible from Docker containers. I'm not familiar with WSL2, but I think you could try other IPs of your sub Linux system and specify it manually via act --cache-server-addr <IP>.

<!-- gh-comment-id:1593972255 --> @wolfogre commented on GitHub (Jun 16, 2023): In some environments, act cannot detect the correct IP to bind for the cache server (and artifact server). "The correct IP" means it's accessible from Docker containers. I'm not familiar with WSL2, but I think you could try other IPs of your sub Linux system and specify it manually via `act --cache-server-addr <IP>`.
Author
Owner

@yknx4 commented on GitHub (Jun 16, 2023):

@wolfogre Hey, I looked at it and it seems it is a little more complicated than that. It seems a docker container can't communicate with a WSL instance (The windows VM) it can only do it to the Windows host. so it can never reach the act process running locally. I'm looking for ways to fix this, either on the wsl side or maybe on the docker side. I'll let you know if I found something relevant to the project and probably add a PR to the Readme to make it run on WSL2 properly

<!-- gh-comment-id:1594018278 --> @yknx4 commented on GitHub (Jun 16, 2023): @wolfogre Hey, I looked at it and it seems it is a little more complicated than that. It seems a docker container can't communicate with a WSL instance (The windows VM) it can only do it to the Windows host. so it can never reach the act process running locally. I'm looking for ways to fix this, either on the wsl side or maybe on the docker side. I'll let you know if I found something relevant to the project and probably add a PR to the Readme to make it run on WSL2 properly
Author
Owner

@ChristopherHX commented on GitHub (Jun 16, 2023):

I had this problem over a year ago, (not with act, but similar kind of network issue)

  • I disabled the wsl backend and switched to hyper-V
  • After I switched back to wsl backend the problem has fixed itself.

I think in my case was docker.host.internal also broken at the same time.

Somewhat offtopic, windows container would need a windows firewall rule due to network adapter setup

The wsl problem seem to be different...

host.docker.internal has a different ip inside wsl2

<!-- gh-comment-id:1594393650 --> @ChristopherHX commented on GitHub (Jun 16, 2023): I had this problem over a year ago, (not with act, but similar kind of network issue) - I disabled the wsl backend and switched to hyper-V - After I switched back to wsl backend the problem has fixed itself. I think in my case was docker.host.internal also broken at the same time. _Somewhat offtopic, windows container would need a windows firewall rule due to network adapter setup_ The wsl problem seem to be different... `host.docker.internal` has a different ip inside wsl2
Author
Owner

@mikicho commented on GitHub (Sep 3, 2023):

@yknx4 I have the same problem. Did you find something?

<!-- gh-comment-id:1704293914 --> @mikicho commented on GitHub (Sep 3, 2023): @yknx4 I have the same problem. Did you find something?
Author
Owner

@StefanLobbenmeierObjego commented on GitHub (Sep 29, 2023):

I also ran into this issue on macOS, but was able to solve this using

--cache-server-addr host.docker.internal

Might make sense to have that be the default on macOS?

<!-- gh-comment-id:1740916286 --> @StefanLobbenmeierObjego commented on GitHub (Sep 29, 2023): I also ran into this issue on macOS, but was able to solve this using --cache-server-addr host.docker.internal Might make sense to have that be the default on macOS?
Author
Owner

@github-actions[bot] commented on GitHub (Mar 28, 2024):

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

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

@mikicho commented on GitHub (Mar 28, 2024):

don't

<!-- gh-comment-id:2025473038 --> @mikicho commented on GitHub (Mar 28, 2024): don't
Author
Owner

@mikicho commented on GitHub (Apr 10, 2024):

My solution was to stop using the docker desktop. I didn't use the GUI anyway..

<!-- gh-comment-id:2048291530 --> @mikicho commented on GitHub (Apr 10, 2024): My solution was to stop using the docker desktop. I didn't use the GUI anyway..
Author
Owner

@leotm commented on GitHub (Jul 25, 2024):

had similar issue on macOS

[CI/task] 💬 ::debug::getCacheEntry - Attempt 2 of 2 failed with error: connect ECONNREFUSED 172.16.0.2:55712

I also ran into this issue on macOS, but was able to solve this using

--cache-server-addr host.docker.internal

Might make sense to have that be the default on macOS?

☝️ works

<!-- gh-comment-id:2250414551 --> @leotm commented on GitHub (Jul 25, 2024): had similar issue on macOS `[CI/task] 💬 ::debug::getCacheEntry - Attempt 2 of 2 failed with error: connect ECONNREFUSED 172.16.0.2:55712` > I also ran into this issue on macOS, but was able to solve this using > > --cache-server-addr host.docker.internal > > Might make sense to have that be the default on macOS? ☝️ works
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2025):

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

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

@tjhiggins commented on GitHub (Jan 28, 2025):

Ran into this issue on WSL2. Fix was to not use the default docker network=host

act --network="bridge" --artifact-server-addr="host.docker.internal" --cache-server-addr="host.docker.internal" ...

.wslconfig

[wsl2]
localhostForwarding=true
networkingMode=mirrored
dnsTunneling=true
autoProxy=true
<!-- gh-comment-id:2617525966 --> @tjhiggins commented on GitHub (Jan 28, 2025): Ran into this issue on WSL2. Fix was to not use the default docker network=host ```bash act --network="bridge" --artifact-server-addr="host.docker.internal" --cache-server-addr="host.docker.internal" ... ``` .wslconfig ``` [wsl2] localhostForwarding=true networkingMode=mirrored dnsTunneling=true autoProxy=true ```
Author
Owner

@lars18th commented on GitHub (Mar 5, 2025):

act --network="bridge" --artifact-server-addr="host.docker.internal" --cache-server-addr="host.docker.internal" ...

I recommend to put this on some document. It's necessary to overcome the timeouts using WSL2

<!-- gh-comment-id:2701918103 --> @lars18th commented on GitHub (Mar 5, 2025): > act --network="bridge" --artifact-server-addr="host.docker.internal" --cache-server-addr="host.docker.internal" ... I recommend to put this on some document. It's necessary to overcome the timeouts using WSL2
Author
Owner

@MuhammadSawalhy commented on GitHub (Apr 11, 2025):

.wslconfig

I have hard time with this bug :(
Where should I put .wslconfig?

Edit: found the answer using the AI :)
It should be here C:\Users\<YourUsername>\.wslconfig. Thanks for the solution <3

<!-- gh-comment-id:2797994201 --> @MuhammadSawalhy commented on GitHub (Apr 11, 2025): > .wslconfig I have hard time with this bug :( Where should I put `.wslconfig`? **Edit:** found the answer using the AI :) It should be here `C:\Users\<YourUsername>\.wslconfig`. Thanks for the solution <3
Author
Owner

@stickeegreg commented on GitHub (Aug 21, 2025):

Hopefully this will be fixed by #5912 (works with default WSL settings)

<!-- gh-comment-id:3210450951 --> @stickeegreg commented on GitHub (Aug 21, 2025): Hopefully this will be fixed by #5912 (works with default WSL settings)
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#908
No description provided.