-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Atlantis v0.27.0 hits nil pointer dereference panic on github client #4081
Comments
Fix potential nil pointers. See runatlantis#4081 for context.
Ah yeah that's a good catch. It looks like a number of the debug lines added by #3876 are going to have similar problems. I wonder what people think about adding a helper function:
Then translating calls like:
To
Otherwise we'll have to check the err before logging every time. Unless there's a cleaner way to do it? |
I opened a PR with a proposed fix for this issue: #4082 It is a simple fix, and there is a chance I missed one. But we can at least start from there. |
Fix potential nil pointers. See runatlantis#4081 for context.
Fix potential nil pointers. See runatlantis#4081 for context.
…itlab client (runatlantis#4082) Fix potential nil pointers. See runatlantis#4081 for context.
…itlab client (runatlantis#4082) Fix potential nil pointers. See runatlantis#4081 for context.
Community Note
Overview of the Issue
Since upgrading our Atlantis to v0.27.0 yesterday, we have seen at least two panics logged with the same stack trace:
This pairs with a comment on the github PR, showing the panic:
As indicated by the stack trace, the panic is occurring when atlantis is updating the status of the PR on github.
The last line of the stack trace points to this line of code:
https://github.com/runatlantis/atlantis/blob/v0.27.0/server/events/vcs/github_client.go#L583
Which was added via this PR: #3876
I believe the issue is that when we go to log this, we are not checking if
resp
is non-null. In this case, I believe there was an error in the previous line, resulting inresp
being null, and thereforeresp.StatusCode
is throwing a panic.Reproduction Steps
I believe this issue can be reproduced by running Atlantis v0.27.0, and having the prior line return an error
https://github.com/runatlantis/atlantis/blob/v0.27.0/server/events/vcs/github_client.go#L582
Logs
Logs
Environment details
Additional Context
Related issues / PRs:
#3876
Sounds similar to #3756, but likely a different root cause
The text was updated successfully, but these errors were encountered: