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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

References for commit Not Found #2606

Open
theautoroboto opened this issue Oct 20, 2022 · 3 comments
Open

References for commit Not Found #2606

theautoroboto opened this issue Oct 20, 2022 · 3 comments
Labels
bug Something isn't working help wanted Good feature for contributors

Comments

@theautoroboto
Copy link

theautoroboto commented Oct 20, 2022

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

When attempting an atlantis apply in a PR from a fork, the process fails with Error: goroutine panic. This is a bug.

Reproduction Steps

Verify environment variable has been set -- ATLANTIS_ALLOW_FORK_PRS=true
Fork Repo
Make a change
Submit a PR
run atlantis apply

Logs

Log posted to GitLab PR
Error: goroutine panic. This is a bug.

runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:260 (0x44c995)
runtime/signal_unix.go:835 (0x44c965)
github.com/runatlantis/atlantis/server/events/vcs/gitlab_client.go:209 (0xb8f5fa)
github.com/runatlantis/atlantis/server/events/vcs/proxy.go:72 (0xb947c4)
github.com/runatlantis/atlantis/server/events/vcs/pull_status_fetcher.go:28 (0xb95045)
github.com/runatlantis/atlantis/server/events/apply_command_runner.go:108 (0xd74c15)
github.com/runatlantis/atlantis/server/events/command_runner.go:296 (0xd79823)
runtime/asm_amd64.s:1594 (0x467ca0)

Logs from pod

{"level":"warn","ts":"2022-10-20T13:31:20.736Z","caller":"events/apply_command_runner.go:100","msg":"unable to update commit status: POST https://xxx/api/v4/projects/bsmith/runatlantis-terraform/statuses/d670fed43f6ff5e5ef7fc2dffe5ca86f61dd839d: 404 {message: 404 References for commit Not Found}","json":{"repo":"bsmith/runatlantis-terraform","pull":"14"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\tgithub.com/runatlantis/atlantis/server/events/apply_command_runner.go:100\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:296"}
{"level":"error","ts":"2022-10-20T13:31:20.936Z","caller":"events/command_runner.go:427","msg":"PANIC: runtime error: invalid memory address or nil pointer dereference\nruntime/panic.go:260 (0x44c995)\nruntime/signal_unix.go:835 (0x44c965)\ngithub.com/runatlantis/atlantis/server/events/vcs/gitlab_client.go:209 (0xb8f5fa)\ngithub.com/runatlantis/atlantis/server/events/vcs/proxy.go:72 (0xb947c4)\ngithub.com/runatlantis/atlantis/server/events/vcs/pull_status_fetcher.go:28 (0xb95045)\ngithub.com/runatlantis/atlantis/server/events/apply_command_runner.go:108 (0xd74c15)\ngithub.com/runatlantis/atlantis/server/events/command_runner.go:296 (0xd79823)\nruntime/asm_amd64.s:1594 (0x467ca0)\n","json":{"repo":"bsmith/runatlantis-terraform","pull":"14"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).logPanics\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:427\nruntime.gopanic\n\truntime/panic.go:890\nruntime.panicmem\n\truntime/panic.go:260\nruntime.sigpanic\n\truntime/signal_unix.go:835\ngithub.com/runatlantis/atlantis/server/events/vcs.(*GitlabClient).PullIsMergeable\n\tgithub.com/runatlantis/atlantis/server/events/vcs/gitlab_client.go:209\ngithub.com/runatlantis/atlantis/server/events/vcs.(*ClientProxy).PullIsMergeable\n\tgithub.com/runatlantis/atlantis/server/events/vcs/proxy.go:72\ngithub.com/runatlantis/atlantis/server/events/vcs.(*pullReqStatusFetcher).FetchPullStatus\n\tgithub.com/runatlantis/atlantis/server/events/vcs/pull_status_fetcher.go:28\ngithub.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\tgithub.com/runatlantis/atlantis/server/events/apply_command_runner.go:108\ngithub.com/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\tgithub.com/runatlantis/atlantis/server/events/command_runner.go:296"}

Environment details

If not already included, please provide the following:

  • Atlantis version: atlantis 0.20.1
@theautoroboto theautoroboto added the bug Something isn't working label Oct 20, 2022
@jamengual jamengual added the help wanted Good feature for contributors label Oct 20, 2022
@michelmzs
Copy link
Contributor

michelmzs commented Oct 25, 2022

Can you share the GitLab version where it occurred?

Probably related to #2484

@theautoroboto
Copy link
Author

We are running GitLab Community Edition [15.2.3]

@michelmzs
Copy link
Contributor

@theautoroboto I haven't found a way to relate the Atlantis commit status to the MR from the fork branch. Maybe it's a limitation of GitLab, we need to test more.
As another option, you can define a simple job in .gitlab-ci.yml to be triggered on MRs, this creates a pipeline ID and allows the Atlantis to successfully apply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Good feature for contributors
Projects
None yet
Development

No branches or pull requests

3 participants