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" #811

Closed
jdpipe opened this issue Sep 10, 2021 · 10 comments · Fixed by #763
Closed

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

jdpipe opened this issue Sep 10, 2021 · 10 comments · Fixed by #763
Labels
kind/bug Something isn't working meta/duplicate This issue or pull request already exists

Comments

@jdpipe
Copy link

jdpipe commented Sep 10, 2021

After following the "Alternative Installation" instructions for Homebrew on Linux on Ubuntu 20.04, without any use of sudo. I then ran brew install act without errors. However, when I then attempted to run act, I got errors:

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

goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0x4f4efa, 0xc0001201e0)
	/home/linuxbrew/.linuxbrew/Cellar/go/1.16.6/libexec/src/reflect/value.go:1908 +0x189
github.com/nektos/act/pkg/model.(*Job).Matrix(0xc000178900, 0x0)
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/pkg/model/workflow.go:178 +0xd7
github.com/nektos/act/pkg/model.(*Job).GetMatrixes(0xc000178900, 0xc000113420, 0x5, 0xc000178900)
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/pkg/model/workflow.go:200 +0x76
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor(0xc0004a80c0, 0xc000117de8, 0x5)
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/pkg/runner/runner.go:119 +0x685
github.com/nektos/act/cmd.newRunCommand.func1(0xc000118000, 0xc0001242a0, 0x0, 0x6, 0x0, 0x0)
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/cmd/root.go:290 +0xc5f
github.com/spf13/cobra.(*Command).execute(0xc000118000, 0xc000124240, 0x6, 0x6, 0xc000118000, 0xc000124240)
	/github/home/.cache/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:850 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000118000, 0x6, 0x6, 0xf)
	/github/home/.cache/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:958 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
	/github/home/.cache/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:895
github.com/nektos/act/cmd.Execute(0xe7b920, 0xc0003c6640, 0xe57c9c, 0x6)
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/cmd/root.go:71 +0x100c
main.main()
	/tmp/act-20210804-1757-7cby3e/act-0.2.24/main.go:33 +0x175

It seems to be referring to folders like /home/linuxbrew which don't exist on my machine.

System information

- Operating System: Linux
- Architecture: x64 (64-bit)
- Apple M1: nope, Lenovo X1 :-)
- Docker version 20.10.7, build 20.10.7-0ubuntu1~20.04.1
- Docker image used in `act`: doesn't matter, same error no matter which one I choose.
- `act` version: act version 0.2.24

Workflow and/or repository

SolarTherm/SolarTherm on github.

@jdpipe jdpipe added the kind/bug Something isn't working label Sep 10, 2021
@catthehacker
Copy link
Member

I can't reproduce issue using latest and master version of act. Please provide full command you used and commit hash for https://github.com/SolarTherm/SolarTherm

It seems to be referring to folders like /home/linuxbrew which don't exist on my machine.

It refers to /home/linuxbrew because that's where brew stores dependencies and programs.

@ChristopherHX
Copy link
Contributor

ChristopherHX commented Sep 10, 2021

This is (should be, not tested by me) fixed in master, but latest=v0.2.24 doesn't include the fix for fail-fast without matrix property in strategy.
Removing the unused strategy property is a workaround until v0.2.25 will be released.

The following workflow is causing the crash, remove the unused highlighted code and act v0.2.24 won't crash. (this is a duplicated issue)
https://github.com/SolarTherm/SolarTherm/blob/85458de8e7f64e484c82e03031a9dbc434be26cc/.github/workflows/dakota.yml#L8-L9

@catthehacker
Copy link
Member

image

@ChristopherHX
Copy link
Contributor

I'm able to reproduce this, if you use the push event act skips this workflow.

sudo ~/Downloads/act -W .github/workflows/dakota.yml workflow_dispatch -v
DEBU[0000] Loading environment from /tmp/SolarTherm/.env 
DEBU[0000] Loading secrets from /tmp/SolarTherm/.secrets 
DEBU[0000] Loading workflow '/tmp/SolarTherm/.github/workflows/dakota.yml' 
DEBU[0000] Reading workflow '/tmp/SolarTherm/.github/workflows/dakota.yml' 
DEBU[0000] Correcting if statements '/tmp/SolarTherm/.github/workflows/dakota.yml' 
DEBU[0000] Planning event: workflow_dispatch            
panic: reflect: call of reflect.Value.Type on zero Value

goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
	/opt/hostedtoolcache/go/1.16.6/x64/src/reflect/value.go:1908 +0x189
github.com/nektos/act/pkg/model.(*Job).Matrix(0xc0004fa000, 0x0)
	/home/runner/work/act/act/pkg/model/workflow.go:178 +0xd7
github.com/nektos/act/pkg/model.(*Job).GetMatrixes(0xc0004fa000, 0xc00048c268, 0x5, 0xc0004fa000)
	/home/runner/work/act/act/pkg/model/workflow.go:200 +0x76
github.com/nektos/act/pkg/runner.(*runnerImpl).NewPlanExecutor(0xc0004907e0, 0xc000490738, 0x5)
	/home/runner/work/act/act/pkg/runner/runner.go:119 +0x685
github.com/nektos/act/cmd.newRunCommand.func1(0xc000492000, 0xc0004d8000, 0x1, 0xc, 0x0, 0x0)
	/home/runner/work/act/act/cmd/root.go:290 +0xc5f
github.com/spf13/cobra.(*Command).execute(0xc000492000, 0xc000494300, 0xc, 0x10, 0xc000492000, 0xc000494300)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.1.1/command.go:850 +0x472
github.com/spf13/cobra.(*Command).ExecuteC(0xc000492000, 0xc, 0x10, 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(0xe73820, 0xc0003dc600, 0xe500bc, 0x6)
	/home/runner/work/act/act/cmd/root.go:71 +0x100c
main.main()
	/home/runner/work/act/act/main.go:33 +0x175

image

@jdpipe
Copy link
Author

jdpipe commented Sep 11, 2021

Just giving my full steps.

# get my code to test
cd ~
git clone https://github.com/SolarTherm/solartherm.git
# per 'Alternative Installation' from https://docs.brew.sh/Homebrew-on-Linux
git clone https://github.com/Homebrew/brew ~/.linuxbrew/Homebrew
mkdir ~/.linuxbrew/bin
ln -s ~/.linuxbrew/Homebrew/bin/brew ~/.linuxbrew/bin
eval $(~/.linuxbrew/bin/brew shellenv)
# so now I have 'brew'...
brew install act
# so now I have act?
cd ~/solartherm
act

and then I got the error as above.

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

@alvaromartmart
Copy link

alvaromartmart commented Sep 30, 2021

I'm getting the same error, on a M1 mac (I used the --container-architecture linux/arm64) arg)

@catthehacker
Copy link
Member

Duplicate of #760
Already fixed in master, you can use linked or any newer pull request artefacts to get working build

@catthehacker catthehacker added the meta/duplicate This issue or pull request already exists label Sep 30, 2021
@josegonzalez
Copy link

I know its fixed in master, but the latest release one gets from homebrew has this error, which makes it a bit more difficult for new users to figure out why their job isn't working locally.

Would it be possible to get a new release soonish? If there is something blocking that release, I'd love to hear about it so that maybe I can help out? :)

@catthehacker
Copy link
Member

@josegonzalez #678 (comment)
brew install act --HEAD

@francisco-gs-colpal
Copy link

@josegonzalez #678 (comment) brew install act --HEAD

Than you very much, maybe documentation could be updated

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 meta/duplicate This issue or pull request already exists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants