Skip to content

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

Open
@dvschuyl

Description

@dvschuyl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions