[GH-ISSUE #1306] SIGSEGV when having secrets not defined locally #708

Closed
opened 2026-03-01 21:45:42 +03:00 by kerem · 5 comments
Owner

Originally created by @ikamensh on GitHub (Aug 16, 2022).
Original GitHub issue: https://github.com/nektos/act/issues/1306

Bug report info

act version:            0.2.30
GOOS:                   darwin
GOARCH:                 amd64
NumCPU:                 12
Docker host:            DOCKER_HOST environment variable is unset/empty.
Sockets found:
        /var/run/docker.sock
Config files:           
        /Users/kai7rng/.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.4
        Module path:           command-line-arguments
        Main version:          
        Main path:             
        Main checksum:         
        Build settings:
                -compiler:            gc
                -ldflags:             -X main.version=0.2.30
                CGO_ENABLED:          1
                CGO_CFLAGS:           
                CGO_CPPFLAGS:         
                CGO_CXXFLAGS:         
                CGO_LDFLAGS:          
                GOARCH:               amd64
                GOOS:                 darwin
                GOAMD64:              v1
Docker Engine:
        Engine version:        20.10.17
        Engine runtime:        runc
        Cgroup version:        2
        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.10.104-linuxkit
        OS CPU:                6
        OS memory:             7859 MB
        Security options:
                name=seccomp,profile=default
                name=cgroupns

Command used with act

act

Describe issue

Not user friendly way of failing on unknown secrets.

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea]

goroutine 38 [running]:

No response

Workflow content

Relevant is only that I have following in my .yaml:

${{ secrets.RESOURCE_USER_NAME }}

Relevant log output

[ci-pipeline/documentation] [DEBUG] evaluating expression 'format('{0}', secrets.RESOURCE_USER_NAME)'
[ci-pipeline/documentation] [DEBUG] expression 'format('{0}', secrets.RESOURCE_USER_NAME)' evaluated to '%!t(string=)'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea]

Additional information

No response

Originally created by @ikamensh on GitHub (Aug 16, 2022). Original GitHub issue: https://github.com/nektos/act/issues/1306 ### Bug report info ```plain text act version: 0.2.30 GOOS: darwin GOARCH: amd64 NumCPU: 12 Docker host: DOCKER_HOST environment variable is unset/empty. Sockets found: /var/run/docker.sock Config files: /Users/kai7rng/.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.4 Module path: command-line-arguments Main version: Main path: Main checksum: Build settings: -compiler: gc -ldflags: -X main.version=0.2.30 CGO_ENABLED: 1 CGO_CFLAGS: CGO_CPPFLAGS: CGO_CXXFLAGS: CGO_LDFLAGS: GOARCH: amd64 GOOS: darwin GOAMD64: v1 Docker Engine: Engine version: 20.10.17 Engine runtime: runc Cgroup version: 2 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.10.104-linuxkit OS CPU: 6 OS memory: 7859 MB Security options: name=seccomp,profile=default name=cgroupns ``` ### Command used with act ```sh act ``` ### Describe issue Not user friendly way of failing on unknown secrets. ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea] goroutine 38 [running]: ``` ### Link to GitHub repository _No response_ ### Workflow content ```yml Relevant is only that I have following in my .yaml: ${{ secrets.RESOURCE_USER_NAME }} ``` ### Relevant log output ```sh [ci-pipeline/documentation] [DEBUG] evaluating expression 'format('{0}', secrets.RESOURCE_USER_NAME)' [ci-pipeline/documentation] [DEBUG] expression 'format('{0}', secrets.RESOURCE_USER_NAME)' evaluated to '%!t(string=)' panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea] ``` ### Additional information _No response_
kerem 2026-03-01 21:45:42 +03:00
  • closed this issue
  • added the
    kind/bug
    label
Author
Owner

@egidijus commented on GitHub (Aug 23, 2022):

@ikamensh

  1. are you on an M1 mac? (I see GOARCH=amd64)
  2. did you recently install monterey v 12.5.1 ?
  3. are you running act binary? or in a docker?
  4. if binary, did you install from brew or download a release bin from repo?

for context I have similar problem.
My environment:

  1. OSX M1 Monterey 12.5.1
  2. this forces all docker containers to run linux/amd64 containers/images DOCKER_DEFAULT_PLATFORM=linux/amd64
  3. act v 0.2.30 installed via brew
<!-- gh-comment-id:1223713216 --> @egidijus commented on GitHub (Aug 23, 2022): @ikamensh 1. are you on an M1 mac? (I see `GOARCH=amd64`) 2. did you recently install monterey v 12.5.1 ? 3. are you running act binary? or in a docker? 4. if binary, did you install from brew or download a release bin from repo? for context I have similar problem. My environment: 1. OSX M1 Monterey 12.5.1 2. this forces all docker containers to run linux/amd64 containers/images `DOCKER_DEFAULT_PLATFORM=linux/amd64` 3. act v 0.2.30 installed via brew
Author
Owner

@ikamensh commented on GitHub (Aug 23, 2022):

  1. No, it's intel macbook pro
  2. Macos version is 11.6 Big Sur
  3. I did brew install act, I at least do nothing to run it in a docker.
<!-- gh-comment-id:1223759832 --> @ikamensh commented on GitHub (Aug 23, 2022): 1. No, it's intel macbook pro 2. Macos version is 11.6 Big Sur 3. I did `brew install act`, I at least do nothing to run it in a docker.
Author
Owner

@ChristopherHX commented on GitHub (Aug 23, 2022):

Please provide the stacktrace ( you cut the most important part of the log ) and a sample workflow.

I cannot reproduce this without additional information requested by the issue template, because I don't get a dump if the secret is not defined. You also omited where in the workflow you referenced the secret there are a lot of possible locations.

<!-- gh-comment-id:1224245479 --> @ChristopherHX commented on GitHub (Aug 23, 2022): Please provide the stacktrace ( you cut the most important part of the log ) and a sample workflow. I cannot reproduce this without additional information requested by the issue template, because I don't get a dump if the secret is not defined. You also omited where in the workflow you referenced the secret there are a lot of possible locations.
Author
Owner

@ikamensh commented on GitHub (Sep 5, 2022):

Here is example yaml that causes the crash:

name: ci-pipeline
on: ["push"]

jobs:
  py38-lin:
    runs-on: [self-hosted, Linux, docker]
    container:
      image: python:3.8-slim
      credentials:
        username: ${{ secrets.RESOURCE_USER_NAME }}
        password: ${{ secrets.BDC_ARTIFACTORY_RESOURCE_TOKEN }}
    steps:
      - name: Configure
        if: ${{ !startsWith(runner.name, 'bla') }}
        run: echo "HELLO"

Here is the stack trace:

DEBU[0000] Loading environment from /Users/kai7rng/PycharmProjects/try_act/.env 
DEBU[0000] Loading secrets from /Users/kai7rng/PycharmProjects/try_act/.secrets 
DEBU[0000] Loading workflows from '/Users/kai7rng/PycharmProjects/try_act/.github/workflows' 
DEBU[0000] Loading workflows recursively                
DEBU[0000] Found workflow 'ci.yaml' in '/Users/kai7rng/PycharmProjects/try_act/.github/workflows/ci.yaml' 
DEBU[0000] Reading workflow '/Users/kai7rng/PycharmProjects/try_act/.github/workflows/ci.yaml' 
DEBU[0000] Planning event: push                         
DEBU[0000] Loading slug from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' 
DEBU[0000] Loading revision from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' 
DEBU[0000] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 
DEBU[0000] HEAD points to 'cf976886cf529d70aae21c5238c6c33a4b217f28' 
DEBU[0000] using github ref: refs/heads/feature/boom    
DEBU[0000] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 
[ci-pipeline/py38-lin] [DEBUG] evaluating expression 'success()'
[ci-pipeline/py38-lin] [DEBUG] expression 'success()' evaluated to 'true'
[ci-pipeline/py38-lin] [DEBUG] Loading slug from git directory '/Users/kai7rng/PycharmProjects/try_act/.git'
[ci-pipeline/py38-lin] [DEBUG] Loading revision from git directory '/Users/kai7rng/PycharmProjects/try_act/.git'
[ci-pipeline/py38-lin] [DEBUG] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28
[ci-pipeline/py38-lin] [DEBUG] HEAD points to 'cf976886cf529d70aae21c5238c6c33a4b217f28'
[ci-pipeline/py38-lin] [DEBUG] using github ref: refs/heads/feature/boom
[ci-pipeline/py38-lin] [DEBUG] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28
[ci-pipeline/py38-lin] [DEBUG] expression '${{ secrets.RESOURCE_USER_NAME }}' rewritten to 'format('{0}', secrets.RESOURCE_USER_NAME)'
[ci-pipeline/py38-lin] [DEBUG] evaluating expression 'format('{0}', secrets.RESOURCE_USER_NAME)'
[ci-pipeline/py38-lin] [DEBUG] expression 'format('{0}', secrets.RESOURCE_USER_NAME)' evaluated to '%!t(string=)'
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea]

goroutine 32 [running]:
github.com/nektos/act/pkg/runner.useStepLogger.func1({0x18b7a98?, 0xc0004c0a80?})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/job_executor.go:136 +0x26a
github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34
github.com/nektos/act/pkg/runner.newJobExecutor.func5({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/job_executor.go:116 +0xb1
github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:176 +0x52
github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34
github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34
github.com/nektos/act/pkg/runner.(*RunContext).Executor.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/run_context.go:286 +0x7e
github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1.1({0x18b7a98, 0xc0004888a0})
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/runner.go:195 +0x362
github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0x0?, 0x0?)
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:100 +0x5c
created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1
        /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:98 +0x89
<!-- gh-comment-id:1237198389 --> @ikamensh commented on GitHub (Sep 5, 2022): Here is example yaml that causes the crash: ```yaml name: ci-pipeline on: ["push"] jobs: py38-lin: runs-on: [self-hosted, Linux, docker] container: image: python:3.8-slim credentials: username: ${{ secrets.RESOURCE_USER_NAME }} password: ${{ secrets.BDC_ARTIFACTORY_RESOURCE_TOKEN }} steps: - name: Configure if: ${{ !startsWith(runner.name, 'bla') }} run: echo "HELLO" ``` Here is the stack trace: ``` DEBU[0000] Loading environment from /Users/kai7rng/PycharmProjects/try_act/.env DEBU[0000] Loading secrets from /Users/kai7rng/PycharmProjects/try_act/.secrets DEBU[0000] Loading workflows from '/Users/kai7rng/PycharmProjects/try_act/.github/workflows' DEBU[0000] Loading workflows recursively DEBU[0000] Found workflow 'ci.yaml' in '/Users/kai7rng/PycharmProjects/try_act/.github/workflows/ci.yaml' DEBU[0000] Reading workflow '/Users/kai7rng/PycharmProjects/try_act/.github/workflows/ci.yaml' DEBU[0000] Planning event: push DEBU[0000] Loading slug from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' DEBU[0000] Loading revision from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' DEBU[0000] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 DEBU[0000] HEAD points to 'cf976886cf529d70aae21c5238c6c33a4b217f28' DEBU[0000] using github ref: refs/heads/feature/boom DEBU[0000] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 [ci-pipeline/py38-lin] [DEBUG] evaluating expression 'success()' [ci-pipeline/py38-lin] [DEBUG] expression 'success()' evaluated to 'true' [ci-pipeline/py38-lin] [DEBUG] Loading slug from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' [ci-pipeline/py38-lin] [DEBUG] Loading revision from git directory '/Users/kai7rng/PycharmProjects/try_act/.git' [ci-pipeline/py38-lin] [DEBUG] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 [ci-pipeline/py38-lin] [DEBUG] HEAD points to 'cf976886cf529d70aae21c5238c6c33a4b217f28' [ci-pipeline/py38-lin] [DEBUG] using github ref: refs/heads/feature/boom [ci-pipeline/py38-lin] [DEBUG] Found revision: cf976886cf529d70aae21c5238c6c33a4b217f28 [ci-pipeline/py38-lin] [DEBUG] expression '${{ secrets.RESOURCE_USER_NAME }}' rewritten to 'format('{0}', secrets.RESOURCE_USER_NAME)' [ci-pipeline/py38-lin] [DEBUG] evaluating expression 'format('{0}', secrets.RESOURCE_USER_NAME)' [ci-pipeline/py38-lin] [DEBUG] expression 'format('{0}', secrets.RESOURCE_USER_NAME)' evaluated to '%!t(string=)' panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x58 pc=0x16291ea] goroutine 32 [running]: github.com/nektos/act/pkg/runner.useStepLogger.func1({0x18b7a98?, 0xc0004c0a80?}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/job_executor.go:136 +0x26a github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34 github.com/nektos/act/pkg/runner.newJobExecutor.func5({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/job_executor.go:116 +0xb1 github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:176 +0x52 github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34 github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34 github.com/nektos/act/pkg/runner.(*RunContext).Executor.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/run_context.go:286 +0x7e github.com/nektos/act/pkg/common.Executor.Finally.func1({0x18b7a98, 0xc0004c0a80}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:175 +0x34 github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1.1({0x18b7a98, 0xc0004888a0}) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/runner/runner.go:195 +0x362 github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0x0?, 0x0?) /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:100 +0x5c created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1 /private/tmp/act-20220801-4014-thiodr/act-0.2.30/pkg/common/executor.go:98 +0x89 ```
Author
Owner

@ChristopherHX commented on GitHub (Sep 5, 2022):

Thank you for the additional information I see, the secrets are used as job container credentials. Using them in steps doesn't cause a crash.

Seems like the post executor should not run if starting the container fails. I'm looking into contributing a fix for the next monthly release of act.

I'm not shure how the error will look like, after I found a way to suppress the inconsistent state of the crash.

<!-- gh-comment-id:1237429852 --> @ChristopherHX commented on GitHub (Sep 5, 2022): Thank you for the additional information I see, the secrets are used as job container credentials. Using them in steps doesn't cause a crash. Seems like the post executor should not run if starting the container fails. I'm looking into contributing a fix for the next monthly release of act. I'm not shure how the error will look like, after I found a way to suppress the inconsistent state of the crash.
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#708
No description provided.