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

Issue: Panic after failing to load an action #946

Closed
ChristopherHX opened this issue Dec 30, 2021 · 0 comments · Fixed by #971
Closed

Issue: Panic after failing to load an action #946

ChristopherHX opened this issue Dec 30, 2021 · 0 comments · Fixed by #971
Labels
kind/bug Something isn't working

Comments

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Dec 30, 2021

System information

  • Operating System: Windows
  • Architecture: x64 (64-bit)
  • Apple M1: no
  • Docker version: 20.10.6
  • Docker image used in act: catthehacker/ubuntu:act-latest
  • act version: 0.2.26-master ( e9c4609 since 1891c72 )

Expected behaviour

Print a proper errormessage and don't panic.

Actual behaviour

Panic after some failures without any cleanup.

Workflow and/or repository

workflow
on: push
name: no-panic-after-failure
jobs:
  nopanic:
    runs-on: ubuntu-latest
    steps:
    - uses: ./path/to/non-existent-action

Steps to reproduce

  • execute the provided workflow
    act -W .\no-panic-after-failure\push.yml -v
  • older versions of act like v0.2.25 don't panic.

act output

Log
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading environment from /act-panic-after-failure\\pkg\\runner\\testdata\\.env"
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading secrets from /act-panic-after-failure\\pkg\\runner\\testdata\\.secrets"
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading workflow '/act-panic-after-failure\\pkg\\runner\\testdata\\no-panic-after-failure\\push.yml'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Reading workflow '/act-panic-after-failure\\pkg\\runner\\testdata\\no-panic-after-failure\\push.yml'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Correcting if statements '/act-panic-after-failure\\pkg\\runner\\testdata\\no-panic-after-failure\\push.yml'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Planning event: push"
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading slug from git directory '/.git'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading revision from git directory '/.git'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:30:55+01:00" level=debug msg="HEAD points to 'b5929156e58dec0605e18a50e2168c626bee9b6c'"
time="2021-12-30T20:30:55+01:00" level=debug msg="using github ref: refs/heads/v0.1.x"
time="2021-12-30T20:30:55+01:00" level=debug msg="context steps => map[]"
time="2021-12-30T20:30:55+01:00" level=debug msg="context env => map[ACT:true]"
time="2021-12-30T20:30:55+01:00" level=debug msg="expression 'success()' evaluated to 'true'"
[no-panic-after-failure/nopanic] 🚀  Start image=catthehacker/ubuntu:act-latest
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading slug from git directory '/.git'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:30:55+01:00" level=debug msg="Loading revision from git directory '/.git'"
time="2021-12-30T20:30:55+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:30:55+01:00" level=debug msg="HEAD points to 'b5929156e58dec0605e18a50e2168c626bee9b6c'"
time="2021-12-30T20:30:55+01:00" level=debug msg="using github ref: refs/heads/v0.1.x"
[no-panic-after-failure/nopanic]   🐳  docker pull image=catthehacker/ubuntu:act-latest platform= username= forcePull=false
[no-panic-after-failure/nopanic]   🐳  docker pull catthehacker/ubuntu:act-latest
time="2021-12-30T20:30:55+01:00" level=debug msg="Image exists? true"
[no-panic-after-failure/nopanic] Removed container: 46bddb20f7b6a0fe6daa0c56273bbfaf774d1be03948ce0035ab5ef6dce0e723
[no-panic-after-failure/nopanic]   🐳  docker volume rm act-no-panic-after-failure-nopanic
[no-panic-after-failure/nopanic]   🐳  docker create image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[no-panic-after-failure/nopanic] Created container name=act-no-panic-after-failure-nopanic id=b84031832c7799feea18ee0ed8d88987e29908ff64568469d41969c3782b4056 from image catthehacker/ubuntu:act-latest (platform: )
[no-panic-after-failure/nopanic] ENV ==> [RUNNER_TOOL_CACHE=/opt/hostedtoolcache RUNNER_OS=Linux RUNNER_TEMP=/tmp]
[no-panic-after-failure/nopanic]   🐳  docker run image=catthehacker/ubuntu:act-latest platform= entrypoint=["/usr/bin/tail" "-f" "/dev/null"] cmd=[]
[no-panic-after-failure/nopanic] Starting container: b84031832c7799feea18ee0ed8d88987e29908ff64568469d41969c3782b4056
[no-panic-after-failure/nopanic] Started container: b84031832c7799feea18ee0ed8d88987e29908ff64568469d41969c3782b4056
[no-panic-after-failure/nopanic]   🐳  docker exec cmd=[mkdir -m 0777 -p /var/run/act] user=root workdir=
[no-panic-after-failure/nopanic] Exec command '[mkdir -m 0777 -p /var/run/act]'
[no-panic-after-failure/nopanic] Working directory '/mnt/c/Users/Christopher/github-actions-act-runner/act-panic-after-failure/pkg/runner/testdata'
time="2021-12-30T20:30:59+01:00" level=debug msg="Writing entry to tarball workflow/event.json len:2"
time="2021-12-30T20:30:59+01:00" level=debug msg="Writing entry to tarball workflow/envs.txt len:0"
time="2021-12-30T20:30:59+01:00" level=debug msg="Writing entry to tarball workflow/paths.txt len:0"
[no-panic-after-failure/nopanic] Extracting content to '/var/run/act/'
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading slug from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading revision from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="HEAD points to 'b5929156e58dec0605e18a50e2168c626bee9b6c'"
time="2021-12-30T20:31:00+01:00" level=debug msg="using github ref: refs/heads/v0.1.x"
time="2021-12-30T20:31:00+01:00" level=debug msg="context steps => map[0:map[conclusion:success outcome:success outputs:map[]]]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context env => map[]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context needs => map[]"
time="2021-12-30T20:31:00+01:00" level=debug msg="expression 'success()' evaluated to 'true'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading slug from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading revision from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="HEAD points to 'b5929156e58dec0605e18a50e2168c626bee9b6c'"
time="2021-12-30T20:31:00+01:00" level=debug msg="using github ref: refs/heads/v0.1.x"
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading slug from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="Loading revision from git directory '/.git'"
time="2021-12-30T20:31:00+01:00" level=debug msg="Found revision: b5929156e58dec0605e18a50e2168c626bee9b6c\n"
time="2021-12-30T20:31:00+01:00" level=debug msg="HEAD points to 'b5929156e58dec0605e18a50e2168c626bee9b6c'"
time="2021-12-30T20:31:00+01:00" level=debug msg="using github ref: refs/heads/v0.1.x"
time="2021-12-30T20:31:00+01:00" level=debug msg="context steps => map[0:map[conclusion:success outcome:success outputs:map[]]]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:nopanic GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/v0.1.x GITHUB_REPOSITORY:christopherhx/github-actions-act-runner GITHUB_REPOSITORY_OWNER:christopherhx GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:b5929156e58dec0605e18a50e2168c626bee9b6c GITHUB_TOKEN: GITHUB_WORKFLOW:no-panic-after-failure GITHUB_WORKSPACE:/mnt/c/Users/Christopher/github-actions-act-runner/act-panic-after-failure/pkg/runner/testdata IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context env => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:nopanic GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/v0.1.x GITHUB_REPOSITORY:christopherhx/github-actions-act-runner GITHUB_REPOSITORY_OWNER:christopherhx GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:b5929156e58dec0605e18a50e2168c626bee9b6c GITHUB_TOKEN: GITHUB_WORKFLOW:no-panic-after-failure GITHUB_WORKSPACE:/mnt/c/Users/Christopher/github-actions-act-runner/act-panic-after-failure/pkg/runner/testdata IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]"
time="2021-12-30T20:31:00+01:00" level=debug msg="context needs => map[]"
[no-panic-after-failure/nopanic] setupEnv => map[ACT:true AGENT_TOOLSDIRECTORY:/opt/hostedtoolcache CI:true DEBIAN_FRONTEND:noninteractive DEPLOYMENT_BASEPATH:/opt/runner GITHUB_ACTION:0 GITHUB_ACTIONS:true GITHUB_ACTION_PATH: GITHUB_ACTION_REF: GITHUB_ACTION_REPOSITORY: GITHUB_ACTOR:nektos/act GITHUB_API_URL:https://api.github.com GITHUB_BASE_REF: GITHUB_ENV:/var/run/act/workflow/envs.txt GITHUB_EVENT_NAME:push GITHUB_EVENT_PATH:/var/run/act/workflow/event.json GITHUB_GRAPHQL_URL:https://api.github.com/graphql GITHUB_HEAD_REF: GITHUB_JOB:nopanic GITHUB_PATH:/var/run/act/workflow/paths.txt GITHUB_REF:refs/heads/v0.1.x GITHUB_REPOSITORY:christopherhx/github-actions-act-runner GITHUB_REPOSITORY_OWNER:christopherhx GITHUB_RETENTION_DAYS:0 GITHUB_RUN_ID:1 GITHUB_RUN_NUMBER:1 GITHUB_SERVER_URL:https://github.com GITHUB_SHA:b5929156e58dec0605e18a50e2168c626bee9b6c GITHUB_TOKEN: GITHUB_WORKFLOW:no-panic-after-failure GITHUB_WORKSPACE:/mnt/c/Users/Christopher/github-actions-act-runner/act-panic-after-failure/pkg/runner/testdata IMAGE_OS:ubuntu20 ImageOS:ubuntu20 LSB_OS_VERSION:2004 LSB_RELEASE:20.04 PATH:/opt/hostedtoolcache/node/14.18.2/x64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin RUNNER_PERFLOG:/dev/null RUNNER_TRACKING_ID: RUNNER_USER:root RUN_TOOL_CACHE:/opt/hostedtoolcache USER:root]
[no-panic-after-failure/nopanic] ⭐  Run ./path/to/non-existent-action
time="2021-12-30T20:31:00+01:00" level=debug msg="About to run action <nil>"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x30 pc=0x9274e9]

goroutine 26 [running]:
github.com/nektos/act/pkg/runner.(*StepContext).populateEnvsFromInput(0xc00038a8c0, 0x0, 0xc00041a2d0)
        /act-panic-after-failure/pkg/runner/step_context.go:751 +0x49
github.com/nektos/act/pkg/runner.(*StepContext).runAction.func1(0xc3b328, 0xc0003ad800, 0x0, 0x0)
        /act-panic-after-failure/pkg/runner/step_context.go:504 +0x23a
github.com/nektos/act/pkg/common.Executor.Then.func1(0xc3b328, 0xc0003ad800, 0xc0003ad800, 0xc0002a3470)
        /act-panic-after-failure/pkg/common/executor.go:145 +0x12c
github.com/nektos/act/pkg/runner.(*RunContext).newStepExecutor.func1(0xc3b328, 0xc0003ad800, 0x0, 0x0)
        /act-panic-after-failure/pkg/runner/run_context.go:337 +0x3ed
github.com/nektos/act/pkg/common.Executor.Then.func1(0xc3b328, 0xc0003ad800, 0x0, 0x1)
        /act-panic-after-failure/pkg/common/executor.go:145 +0x12c
github.com/nektos/act/pkg/common.Executor.Then.func1(0xc3b328, 0xc0003ad800, 0xc00041a2d0, 0xc000273181)
        /act-panic-after-failure/pkg/common/executor.go:133 +0x4d
github.com/nektos/act/pkg/common.Executor.Finally.func1(0xc3b328, 0xc0003ad800, 0x2030000, 0x20)
        /act-panic-after-failure/pkg/common/executor.go:179 +0x53
github.com/nektos/act/pkg/common.Executor.Finally.func1(0xc3b328, 0xc0003ad800, 0x1, 0x30)
        /act-panic-after-failure/pkg/common/executor.go:179 +0x53
github.com/nektos/act/pkg/common.Executor.If.func1(0xc3b328, 0xc0003ad800, 0x0, 0xc000573e18)
        /act-panic-after-failure/pkg/common/executor.go:153 +0x71
github.com/nektos/act/pkg/common.Executor.Finally.func1(0xc3b328, 0xc0003ad800, 0x9bafa0, 0xc16290)
        /act-panic-after-failure/pkg/common/executor.go:179 +0x53
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor.func1(0xc3b328, 0xc00042c750, 0xc000005590, 0xc000573f70)
        /act-panic-after-failure/pkg/runner/runner.go:158 +0x398
github.com/nektos/act/pkg/common.Executor.ChannelError.func1(0xc3b328, 0xc00042c750, 0xc000005590, 0x0)
        /act-panic-after-failure/pkg/common/executor.go:125 +0x4c
github.com/nektos/act/pkg/common.NewParallelExecutor.func1.1(0xc00038a880, 0xc000400060, 0xc3b328, 0xc00042c750)
        /act-panic-after-failure/pkg/common/executor.go:101 +0x62
created by github.com/nektos/act/pkg/common.NewParallelExecutor.func1
        /act-panic-after-failure/pkg/common/executor.go:100 +0xbe
exit status 2

EDIT 1
I'm mitigating missing cleanup due to this issue by ChristopherHX@425dc96

Act also panics if the docker daemon is unreachable.

Reason for this issue

The PR changed the meaning of the then executor to something like finally, therefore the pipeline executor won't stop on errors and continues with an invalid state. E.g. the action.yml file failed to load, then the next pipeline entry was expected to be skipped, but since it actually runs there is a null pointer access.

@ChristopherHX ChristopherHX added the kind/bug Something isn't working label Dec 30, 2021
@mergify mergify bot closed this as completed in #971 Jan 27, 2022
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

Successfully merging a pull request may close this issue.

1 participant