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: reflect: call of reflect.Value.Type on zero Value #760

Closed
ptrk8 opened this issue Jul 25, 2021 · 2 comments · Fixed by #763
Closed

Issue: panic: reflect: call of reflect.Value.Type on zero Value #760

ptrk8 opened this issue Jul 25, 2021 · 2 comments · Fixed by #763
Assignees
Labels
area/workflow Relating to workflow definitions kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)

Comments

@ptrk8
Copy link

ptrk8 commented Jul 25, 2021

System information

  • Operating System: Ubuntu 20.10
  • Architecture: x86 64bit
  • Apple M1: no
  • Docker version: 20.10.2,
  • act version: 0.2.23

Expected behaviour

act does not crash when I run the following command:

act --userns <my namespace> release

Actual behaviour

Running act --userns <my namespace> release results in the following error:

panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0xc00069f8b0, 0xc0001ae910)
	/opt/hostedtoolcache/go/1.16.5/x64/src/reflect/value.go:1908 +0x189
github.com/nektos/act/pkg/model.(*Job).Matrix(0xc0002f7800, 0x0)
	/home/runner/work/act/act/pkg/model/workflow.go:177 +0xd7
github.com/nektos/act/pkg/model.(*Job).GetMatrixes(0xc0002f7800, 0xc000236b00, 0x19, 0xc0002f7800)
	/home/runner/work/act/act/pkg/model/workflow.go:199 +0x76
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor(0xc000212a50, 0xc000212840, 0x5)
	/home/runner/work/act/act/pkg/runner/runner.go:119 +0x685
github.com/nektos/act/cmd.newRunCommand.func1(0xc000214000, 0xc00025a000, 0x1, 0x9, 0x0, 0x0)
	/home/runner/work/act/act/cmd/root.go:281 +0xc5f
github.com/spf13/cobra.(*Command).execute(0xc000214000, 0xc00024c000, 0x9, 0xc, 0xc000214000, 0xc00024c000)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:850 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000214000, 0x9, 0xc, 0xf)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/nektos/act/cmd.Execute(0xe70fe0, 0xc0004e2640, 0xe4d8bc, 0x6)
	/home/runner/work/act/act/cmd/root.go:71 +0x100c
main.main()
	/home/runner/work/act/act/main.go:33 +0x175

Workflow and/or repository

workflow
name: Create Packages
on: [release]

jobs:
  Package-Ubuntu-2104-64bit:
    strategy:
      fail-fast: false

    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 0

Steps to reproduce

  1. Install act
  2. Have your docker daemon use namespaces.
  3. Run a workflow using act -v --userns <namespace> release.

act output

Log
DEBU[0000] Loading environment from /home/phao5814/dev/souffle/souffle-forked/.env
DEBU[0000] Loading secrets from /home/phao5814/dev/souffle/souffle-forked/.secrets
DEBU[0000] Loading workflows from '/home/phao5814/dev/souffle/souffle-forked/.github/workflows'
DEBU[0000] Loading workflows recursively
DEBU[0000] Found workflow 'CI-Tests.yml' in '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/CI-Tests.yml'
DEBU[0000] Found workflow 'cancel.yml' in '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/cancel.yml'
DEBU[0000] Found workflow 'create-packages.yml' in '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/create-packages.yml'
DEBU[0000] Reading workflow '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/CI-Tests.yml'
DEBU[0000] Correcting if statements '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/CI-Tests.yml'
DEBU[0000] Reading workflow '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/cancel.yml'
DEBU[0000] Correcting if statements '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/cancel.yml'
DEBU[0000] Reading workflow '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/create-packages.yml'
DEBU[0000] Correcting if statements '/home/phao5814/dev/souffle/souffle-forked/.github/workflows/create-packages.yml'
DEBU[0000] Planning event: release
panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0xc00061f8b0, 0xc0001ae9b0)
	/opt/hostedtoolcache/go/1.16.5/x64/src/reflect/value.go:1908 +0x189
github.com/nektos/act/pkg/model.(*Job).Matrix(0xc0002f7500, 0x0)
	/home/runner/work/act/act/pkg/model/workflow.go:177 +0xd7
github.com/nektos/act/pkg/model.(*Job).GetMatrixes(0xc0002f7500, 0xc0003fc760, 0x19, 0xc0002f7500)
	/home/runner/work/act/act/pkg/model/workflow.go:199 +0x76
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor(0xc00000caf8, 0xc00000c8e8, 0x5)
	/home/runner/work/act/act/pkg/runner/runner.go:119 +0x685
github.com/nektos/act/cmd.newRunCommand.func1(0xc000214000, 0xc00021b900, 0x1, 0xa, 0x0, 0x0)
	/home/runner/work/act/act/cmd/root.go:281 +0xc5f
github.com/spf13/cobra.(*Command).execute(0xc000214000, 0xc00024c000, 0xa, 0xc, 0xc000214000, 0xc00024c000)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:850 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000214000, 0xa, 0xc, 0xf)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/nektos/act/cmd.Execute(0xe70fe0, 0xc0004e4600, 0xe4d8bc, 0x6)
	/home/runner/work/act/act/cmd/root.go:71 +0x100c
main.main()
	/home/runner/work/act/act/main.go:33 +0x175
@ptrk8 ptrk8 added the kind/bug Something isn't working label Jul 25, 2021
@ronnetzer
Copy link

same version, i get the same error when running act -s TOKEN

@catthehacker catthehacker added area/workflow Relating to workflow definitions stale-exempt Exempt from stale labels Jul 26, 2021
@catthehacker catthehacker self-assigned this Jul 26, 2021
@catthehacker catthehacker added this to Needs triage in Bug squashing via automation Jul 26, 2021
@catthehacker
Copy link
Member

catthehacker commented Jul 26, 2021

In some sense it's a duplicate of #625 but since I changed it from map[string]... to interface{} and now it fails at reflecting.

@catthehacker catthehacker moved this from Needs triage to Mid priority in Bug squashing Jul 27, 2021
catthehacker pushed a commit to catthehacker/act-fork that referenced this issue Jul 27, 2021
fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes nektos#625)
fix[workflow]: skip non-existing includes and hard fail on non-existing excludes
fix[worfklow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes nektos#760)
fix[tests]: add test for planner and runner
catthehacker pushed a commit to catthehacker/act-fork that referenced this issue Jul 27, 2021
fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes nektos#625)
fix[workflow]: skip non-existing includes and hard fail on non-existing excludes
fix[worfklow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes nektos#760)
fix[tests]: add test for planner and runner
catthehacker pushed a commit to catthehacker/act-fork that referenced this issue Jul 28, 2021
fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes nektos#625)
fix[workflow]: skip non-existing includes keys and hard fail on non-existing excludes keys
fix[workflow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes nektos#760)
fix[tests]: add test for planner and runner
@mergify mergify bot closed this as completed in #763 Aug 9, 2021
Bug squashing automation moved this from Mid priority to Closed Aug 9, 2021
mergify bot added a commit that referenced this issue Aug 9, 2021
…add test (#763)

* fix[workflow]: multiple fixes for workflow/matrix

fix[workflow]: default `max-parallel`
fix[workflow]: default `fail-fast`, it's `true`, not `false`
fix[workflow]: skipping over the job when `strategy:` is defined but `matrix:` isn't (fixes #625)
fix[workflow]: skip non-existing includes keys and hard fail on non-existing excludes keys
fix[workflow]: simplify Matrix decode (because I "think" I know how `yaml` works) (fixes #760)
fix[tests]: add test for planner and runner

* fix(workflow): use yaml node for env key

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
@catthehacker catthehacker added meta/resolved Issue has been fixed or valid solution has been provided (not workaround) and removed stale-exempt Exempt from stale labels Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/workflow Relating to workflow definitions kind/bug Something isn't working meta/resolved Issue has been fixed or valid solution has been provided (not workaround)
Projects
Bug squashing
  
Closed
Development

Successfully merging a pull request may close this issue.

3 participants