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

Including workflow services crashes with invalid memory address or nil pointer dereference for dry-run #2607

Open
dvschuyl opened this issue Jan 7, 2025 · 2 comments
Labels
kind/bug Something isn't working

Comments

@dvschuyl
Copy link

dvschuyl commented Jan 7, 2025

Bug report info

act version:            0.2.71
GOOS:                   darwin
GOARCH:                 arm64
NumCPU:                 11
Docker host:            DOCKER_HOST environment variable is not set
Sockets found:
        /var/run/docker.sock
        $HOME/.docker/run/docker.sock
Config files:           
        /Users/XXXXXX/Library/Application Support/act/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.23.4
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -buildmode:           exe
                -compiler:            gc
                -ldflags:             -X main.version=0.2.71
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               arm64
                GOOS:                 darwin
                GOARM64:              v8.0
Docker Engine:
        Engine version:        27.4.0
        Engine runtime:        runc
        Cgroup version:        2
        Cgroup driver:         cgroupfs
        Storage driver:        overlayfs
        Registry URI:          https://index.docker.io/v1/
        OS:                    Docker Desktop
        OS type:               linux
        OS version:            
        OS arch:               aarch64
        OS kernel:             6.10.14-linuxkit
        OS CPU:                11
        OS memory:             7837 MB
        Security options:
                name=seccomp,profile=unconfined
                name=cgroupns

Command used with act

act -n --container-architecture linux/arm64

Describe issue

Running the command should perform a dry-run, however, it always crashes on the same line.

So far, I found to *temporary* solutions:

  1. Removing the services from the workflow:
name: CI
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Echo
        run: 'echo DONE'
  1. Removing the dry-run -n flag from the command (aka not performing a dry-run)
act --container-architecture linux/arm64

Both producing expected output:

INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
[CI/test] 🚀  Start image=catthehacker/ubuntu:act-latest
[CI/test]   🐳  docker pull image=postgres:15-alpine platform=linux/arm64 username= forcePull=true
[CI/test]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/arm64 username= forcePull=true
[CI/test] Cleaning up services for job test
[CI/test] Cleaning up network for job test, and network name is: act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network
[CI/test]   🐳  docker pull image=postgres:15-alpine platform=linux/arm64 username= forcePull=false
[CI/test]   🐳  docker create image=postgres:15-alpine platform=linux/arm64 entrypoint=[] cmd=[] network="act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network"
[CI/test]   🐳  docker run image=postgres:15-alpine platform=linux/arm64 entrypoint=[] cmd=[] network="act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network"
[CI/test]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/test]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
[CI/test]   🐳  docker exec cmd=[node --no-warnings -e console.log(process.execPath)] user= workdir=
[CI/test] ⭐ Run Main Checkout
[CI/test]   🐳  docker cp src=/Users/XXXXXX/Documents/GitHub/backend/. dst=/Users/XXXXXX/Documents/GitHub/backend
[CI/test]   ✅  Success - Main Checkout
[CI/test] ⭐ Run Main Echo
[CI/test]   🐳  docker exec cmd=[bash -e /var/run/act/workflow/1] user= workdir=
| DONE
[CI/test]   ✅  Success - Main Echo
[CI/test] Cleaning up container for job test
[CI/test] Cleaning up services for job test
[CI/test] Cleaning up network for job test, and network name is: act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network
[CI/test] 🏁  Job succeeded

Link to GitHub repository

No response

Workflow content

name: CI
on: push

jobs:
  test:
    runs-on: ubuntu-latest
    services:
      postgres:
        image: postgres:15-alpine
        ports:
          - 5432:5432
        env:
          POSTGRES_PASSWORD: XXXXXX
          POSTGRES_DB: XXXXXX
          POSTGRES_USER: XXXXXX
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Echo
        run: 'echo DONE'

Relevant log output

INFO[0000] Using docker host 'unix:///var/run/docker.sock', and daemon socket 'unix:///var/run/docker.sock' 
*DRYRUN* [CI/test] 🚀  Start image=catthehacker/ubuntu:act-latest
*DRYRUN* [CI/test]   🐳  docker pull image=postgres:15-alpine platform=linux/arm64 username= forcePull=true
*DRYRUN* [CI/test]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform=linux/arm64 username= forcePull=true
*DRYRUN* [CI/test] Cleaning up services for job test
*DRYRUN* [CI/test] Cleaning up network for job test, and network name is: act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network
*DRYRUN* [CI/test]   🐳  docker pull image=postgres:15-alpine platform=linux/arm64 username= forcePull=false
*DRYRUN* [CI/test]   🐳  docker create image=postgres:15-alpine platform=linux/arm64 entrypoint=[] cmd=[] network="act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network"
*DRYRUN* [CI/test]   🐳  docker run image=postgres:15-alpine platform=linux/arm64 entrypoint=[] cmd=[] network="act-CI-test-7587b47f572787ca4bc647c2581a917f05f439a38e66ca9abce9eb5337031daf-test-network"
*DRYRUN* [CI/test]   🐳  docker create image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
*DRYRUN* [CI/test]   🐳  docker run image=catthehacker/ubuntu:act-latest platform=linux/arm64 entrypoint=["tail" "-f" "/dev/null"] cmd=[] network="host"
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0xc8 pc=0x10340eb90]

goroutine 10 [running]:
github.com/nektos/act/pkg/container.(*containerReference).GetHealth(0x140000c0700, {0x10381d3d0, 0x14000196540})
        /private/tmp/act-20241231-4787-evpep8/act-0.2.71/pkg/container/docker_run.go:173 +0x30
github.com/nektos/act/pkg/runner.(*RunContext).waitForServiceContainers.func1.(*RunContext).waitForServiceContainer.1({0x10381d328?, 0x140003f1890?})
        /private/tmp/act-20241231-4787-evpep8/act-0.2.71/pkg/runner/run_context.go:573 +0xe0
github.com/nektos/act/pkg/runner.(*RunContext).waitForServiceContainers.func1.NewParallelExecutor.2.1(0x140001963f0, 0x140001964d0)
        /private/tmp/act-20241231-4787-evpep8/act-0.2.71/pkg/common/executor.go:107 +0x50
created by github.com/nektos/act/pkg/runner.(*RunContext).waitForServiceContainers.func1.NewParallelExecutor.2 in goroutine 58
        /private/tmp/act-20241231-4787-evpep8/act-0.2.71/pkg/common/executor.go:105 +0xd4

Additional information

I already tried running without --container-architecture linux/arm64, that also does not work.

@dvschuyl dvschuyl added the kind/bug Something isn't working label Jan 7, 2025
@sebastien-perpignane
Copy link
Contributor

Hi,

See this: #2561 (comment)

Not sure it will solve your issue but at least, the syntax for the --container-architecture option will be the one expected :)

@dvschuyl
Copy link
Author

dvschuyl commented Jan 9, 2025

Thank you for your suggestion!
Sadly, I tried it but it didn't solve the issue.
The strange thing is, it works just fine when running the workflow normally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants