-
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 crashes on atlantis plan after redis configuration #5379
Comments
Hey @jgatt513! I'm here to assist you with any bugs, questions, or contributions you have for Atlantis. Let's tackle this together! The error you're encountering, "invalid memory address or nil pointer dereference," suggests that there might be an issue with how the Redis client is being initialized or used in the
By following these steps, you should be able to identify and resolve the issue with the Redis configuration in Atlantis. If the problem persists, consider reviewing the code or configuration for any overlooked details. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Redis is accessible from the same namespace using redis-cli and the same hostname, port and no password as configured in the Atlantis pod |
Hi @jgatt513, Atlantis is crashing here, probably because the atlantis/server/events/command_runner.go Line 340 in 618d5ac
This is assigned here, with the backend value, which is a locking backend type of redis or boltdb. Line 904 in 618d5ac
It looks therefore like the backend object is not initialising correctly for you, but not throwing an initialisation error. I tested Atlantis locally with a basic Redis container, and I could not recreate this issue.
To help investigate this further, Can you run your Atlantis container with log-level=debug set and update your issue description with the logs. Please strip out the metrics debug log lines. |
Community Note
Overview of the Issue
After configuring Atlantis Server to use redis as lockingdbtype the container gets created without any issues but on the attempt to run a plan it fails with the following:
runtime error: invalid memory address or nil pointer dereference runtime/panic.go:262 (0x472a98) runtime/signal_unix.go:917 (0x472a68) github.com/runatlantis/atlantis/server/events/command_runner.go:340 (0x11539da) runtime/asm_amd64.s:1700 (0x478960)
Reproduction Steps
add redis cluster to your kubernetes cluster and same namespace as atlantis.
set atlanits server args
args:
- server
- --log-level={{ .Values.log.level }}
- --repo-config=/atlantis-config/repos.yaml
- --redis-host="atlantis-leader-headless.atlantis.svc.cluster.local"
- --redis-password=""
- --locking-db-type="redis"
- --checkout-strategy=merge
- --atlantis-url=https://{{ get (first .Values.ingress.hosts ) "host" }}
- --default-tf-version={{ .Values.defaultTFVersion }}
- --enable-regexp-cmd
- --hide-unchanged-plan-comments
- --quiet-policy-checks
Once the environment and pods are stable and healthy attempt to run a plan.
Logs
{"level":"info","ts":"2025-03-04T15:37:05.261Z","caller":"events/events_controller.go:692","msg":"Handling 'plan' comment","json":{"repo":"alienadmin/terragrunt","pull":4185}} │
│ {"level":"info","ts":"2025-03-04T15:37:05.261Z","caller":"events/events_controller.go:736","msg":"Running comment command 'plan' for user '712020:1ba2ddde-b573-42df-a1d4-c6a7b1a4d83b'.","json":{"repo" │
│ {"level":"error","ts":"2025-03-04T15:37:05.262Z","caller":"events/command_runner.go:555","msg":"PANIC: runtime error: invalid memory address or nil pointer dereference\nruntime/panic.go:262 (0x472a98)
Environment details
atlantis version v.0.33.0
The text was updated successfully, but these errors were encountered: