runatlantis / atlantis

Terraform Pull Request Automation
https://www.runatlantis.io
Other
7.82k stars 1.06k forks source link

Panic with Bitbucket when there are many changes #2427

Open neinkob15 opened 2 years ago

neinkob15 commented 2 years ago

Community Note


Overview of the Issue

With Bitbucket Server (v7.19.3) and Atlantis (v0.19.7) configured to use Bitbucket, when there are lots of changes (f.e. when renaming a directory) in a pull-request, Atlantis panices with: "Error: goroutine panic. This is a bug."

Reproduction Steps

  1. setup atlantis (using Version v0.19.7) for Bitbucket using this repo-config:
  2. open a pull-request that includes lots of changes
  3. wait until Atlantis outputs the panic error message (see logs) as comment to the pull-request

Logs

Logs ``` Error: goroutine panic. This is a bug. runtime error: invalid memory address or nil pointer dereference runtime/panic.go:221 (0x44a146) runtime/signal_unix.go:735 (0x44a116) github.com/runatlantis/atlantis/server/events/vcs/bitbucketserver/client.go:103 (0xa9f84b) github.com/runatlantis/atlantis/server/events/vcs/proxy.go:56 (0xa6a074) github.com/runatlantis/atlantis/server/events/project_command_builder.go:215 (0xc4eeb8) github.com/runatlantis/atlantis/server/events/project_command_builder.go:166 (0xc4e7e4) github.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:44 (0xc4610e) github.com/runatlantis/atlantis/server/events/plan_command_runner.go:73 (0xc49d63) github.com/runatlantis/atlantis/server/events/plan_command_runner.go:222 (0xc4ba44) github.com/runatlantis/atlantis/server/events/command_runner.go:174 (0xc3618e) runtime/asm_amd64.s:1581 (0x465140) ```

Environment details

Additional Context

jamengual commented 2 years ago

how is the memory and cpu usage of the atlantis instance when this happens?

neinkob15 commented 2 years ago

It's pretty normal, I'd say. I made it to happen again, at around 09:44 (in my timezone GMT+2, in the logs it is 07:44). This are the relevant docker logs:

{"level":"error","ts":"2022-08-26T07:44:34.244Z","caller":"events/command_runner.go:427","msg":"PANIC: runtime error: invalid memory address or nil pointer dereference\nruntime/panic.go:221 (0x44a146)\nruntime/signal_unix.go:735 (0x44a116)\ngithub.com/runatlantis/atlantis/server/events/vcs/bitbucketserver/client.go:103 (0xa9f84b)\ngithub.com/runatlantis/atlantis/server/events/vcs/proxy.go:56 (0xa6a074)\ngithub.com/runatlantis/atlantis/server/events/project_command_builder.go:215 (0xc4eeb8)\ngithub.com/runatlantis/atlantis/server/events/project_command_builder.go:166 (0xc4e7e4)\ngithub.com/runatlantis/atlantis/server/events/instrumented_project_command_builder.go:44 (0xc4610e)\ngithub.com/runatlantis/atlantis/server/events/plan_command_runner.go:73 (0xc49d63)\ngithub.com/runatlantis/atlantis/server/events/plan_command_runner.go:222 (0xc4ba44)\ngithub.com/runatlantis/atlantis/server/events/command_runner.go:174 (0xc3618e)\nruntime/asm_amd64.s:1581 (0x465140)\n","json":{"repo":"...

and this is the memory and cpu usage (remember GMT+2, so it corresponds to 07:44 in UTC): grafik grafik