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

cron job error: ModuleNotFoundError: No module named 'matplotlib' #161

Closed
ctessum opened this issue Jan 21, 2024 · 4 comments · May be fixed by #189
Closed

cron job error: ModuleNotFoundError: No module named 'matplotlib' #161

ctessum opened this issue Jan 21, 2024 · 4 comments · May be fixed by #189

Comments

@ctessum
Copy link

ctessum commented Jan 21, 2024

Describe the bug

I followed the tutorial to set up a governance repository, and the cron job ran and then failed, with the error message listed in the title here. Here is the output log: https://github.com/EarthSciML/GasChem.jl-gov.public/actions/runs/7604258935

To Reproduce

Just followed the tutorial

Expected behavior

I would expect the github action to run successfully.

Attach the logs

https://github.com/EarthSciML/GasChem.jl-gov.public/actions/runs/7604258935

@petar
Copy link
Member

petar commented Jan 25, 2024

For some strange reason, you are missing the python requirements file in your governance repo inside .github, like this one https://github.com/gov4git/roadmap-gov.public/tree/main/.github/python

This file is automatically installed by gov4git deploy right here https://github.com/gov4git/gov4git/blob/v2/github/deploy.go#L132

Could you be using an old (non-release) commit? Try using v2.0.1?

@ctessum
Copy link
Author

ctessum commented Jan 25, 2024

Thanks for your response! Some more information:

I followed the documentation here, but go get ... didn't work for me, it had to be go install .... When I did go install github.com/gov4git/gov4git/gov4git@latest, it installed v1.1.15. I guess this expected, because if you go to https://pkg.go.dev/github.com/gov4git/gov4git, it says that v1.1.15 is the latest version available.

I tried downloading v2.0.1 from here, and using that version when I run gov4git version it displays "dev", which I assume is just version numbering oversight.

Anyways, when I continue following the directions using that version, I get the error:

POST https://api.github.com/repos/EarthSciML/EarthSciMLCommunity.jl/labels: 404 Not Found []%  

I used the same access token and same command line arguments that worked (well enough for that command to complete) using v1.1.15. The full stack trace is below. Thanks again for any help you can offer!


gov4git -v github deploy --token=[redacted] --project=EarthSciML/EarthSciMLCommunity.jl --release=v2.0.1     
2024-01-24T18:49:50.119-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/gov4git/cmd/root.go:69 gov4git version: dev-rev-d9d5ba5-2024-01-12, os: darwin, arch: arm64
2024-01-24T18:49:50.120-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:45 creating GitHub repository {EarthSciML EarthSciMLCommunity.jl-gov.public}
2024-01-24T18:49:51.071-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:50 creating GitHub repository {EarthSciML EarthSciMLCommunity.jl-gov.private}
2024-01-24T18:49:51.922-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:70 initializing governance for {EarthSciML EarthSciMLCommunity.jl}
2024-01-24T18:49:53.574-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:74 creating GitHub environment for governance in {EarthSciML EarthSciMLCommunity.jl-gov.public}
2024-01-24T18:49:54.183-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:191 adding secret to environment: {
   "key_id": "xxxx",
   "encrypted_value": "xxx"
}
2024-01-24T18:49:55.664-0600	INFO	base/logging.go:61	/home/runner/work/gov4git/gov4git/github/deploy.go:78 installing GitHub actions for governance in {EarthSciML EarthSciMLCommunity.jl-gov.public}, targetting {EarthSciML EarthSciMLCommunity.jl}
goroutine 1 [running]:
runtime/debug.Stack()
	/opt/hostedtoolcache/go/1.21.5/x64/src/runtime/debug/stack.go:24 +0x64
github.com/gov4git/lib4git/must.mkErr(...)
	/home/runner/go/pkg/mod/github.com/gov4git/lib4git@v0.0.28/must/must.go:16
github.com/gov4git/lib4git/must.Panic(...)
	/home/runner/go/pkg/mod/github.com/gov4git/lib4git@v0.0.28/must/must.go:20
github.com/gov4git/lib4git/must.NoError(...)
	/home/runner/go/pkg/mod/github.com/gov4git/lib4git@v0.0.28/must/must.go:43
github.com/gov4git/gov4git/v2/github.createGovernanceIssueLabels({0x102d66d10, 0x1400021cf00}, 0x1400021a580, {{0x16d96774f, 0xa}, {0x16d96775a, 0x16}})
	/home/runner/work/gov4git/gov4git/github/deploy.go:151 +0x248
github.com/gov4git/gov4git/v2/github.Deploy({0x102d66d10, 0x1400021cf00}, {0x16d9676e7, 0x5d}, {{0x16d96774f, 0xa}, {0x16d96775a, 0x16}}, {{0x16d96774f?, 0x0?}, ...}, ...)
	/home/runner/work/gov4git/gov4git/github/deploy.go:82 +0x550
github.com/gov4git/gov4git/v2/gov4git/cmd.glob..func31(0x140001ff700?, {0x102a71373?, 0x4?, 0x102a712a3?})
	/home/runner/work/gov4git/gov4git/gov4git/cmd/github.go:67 +0x148
github.com/spf13/cobra.(*Command).execute(0x103263b00, {0x14000232940, 0x4, 0x4})
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:920 +0x654
github.com/spf13/cobra.(*Command).ExecuteC(0x103263820)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044 +0x320
github.com/spf13/cobra.(*Command).Execute(...)
	/home/runner/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/gov4git/gov4git/v2/gov4git/cmd.Execute()
	/home/runner/work/gov4git/gov4git/gov4git/cmd/root.go:107 +0x24
main.main.func1()
	/home/runner/work/gov4git/gov4git/gov4git/main.go:15 +0x1c
github.com/gov4git/lib4git/must.TryWithStack(0x14000182000?)
	/home/runner/go/pkg/mod/github.com/gov4git/lib4git@v0.0.28/must/must.go:64 +0x6c
main.main()
	/home/runner/work/gov4git/gov4git/gov4git/main.go:14 +0x24

POST https://api.github.com/repos/EarthSciML/EarthSciMLCommunity.jl/labels: 404 Not Found []%     

@petar
Copy link
Member

petar commented Jan 31, 2024

I don't have a good insight on the go install issue. Currently branch v2 is default on GitHub but maybe go install does not recognize that. I would stick to using explicit version as in go install github.com/gov4git/gov4git/v2/gov4git@v2.0.4

gov4git version will display dev anytime you've built the binary yourself with go build. Only binaries created by our CI and through the GitHub release flow will have a version number that is not dev.

The error you are getting is when deploy is trying to install new labels (gov4git:managed, gov4git:directive, etc) to your project repository. I am guessing that your PAT token doesn't have rights to add labels? Did you use a Finegrain token?

Also, FYI, the system is not able to deploy on repos inside GitHub personal accounts. It only works with repos inside GitHub org accounts, because Gov4Git uses the list of maintainers of the org account as people who can issue governance directives.

@ctessum
Copy link
Author

ctessum commented Feb 23, 2024

Using go install with /v2/ fixes this for me.

@petar petar closed this as completed Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants