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

'invalid memory address or nil pointer dereference' against local plan #135

Open
fernandino143 opened this issue Nov 16, 2023 · 0 comments

Comments

@fernandino143
Copy link

Are there any tf version constraints, perhaps? I've performed the terraform plan to generate the expecte file and executed rover.

Terraform v0.12.31

$ terraform plan -out plan_new.tfstate
...
This plan was saved to: plan_new.tfstate

To perform exactly these actions, run the following command to apply:
    terraform apply "plan_new.tfstate"
$ ~/rover_v0.3.3 -tfPath "/opt/homebrew/bin/terraform" -planPath "plan_new.tfstate" 
2023/11/16 12:55:54 Starting Rover...
2023/11/16 12:55:54 Using provided plan...
2023/11/16 12:56:06 Generating resource overview...
2023/11/16 12:56:07 Generating resource map...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10503aca0]

goroutine 1 [running]:
main.(*rover).GenerateModuleMap(0x140001f5560, 0x140001f2ea0, {0x14000475a60, 0xe})
	rover/map.go:177 +0xac0
main.(*rover).GenerateModuleMap(0x140001f5560, 0x1400039fb68, {0x0, 0x0})
	rover/map.go:261 +0x107c
main.(*rover).GenerateMap(0x140001f5560)
	rover/map.go:343 +0x1c8
main.(*rover).generateAssets(0x140001f5560)
	rover/main.go:193 +0x10c
main.main()
	rover/main.go:138 +0xeb8

The module is quite big, but nothing stupendous - 85K in size after terraform plan. It does make use of "stack.auto.tfvars.json" for variables, though. Could that be it?:

I also tried the json format after transofrming it to json (which render fine with jq), but that fails immediately:

$ ~/rover_v0.3.3 -tfPath "/opt/homebrew/bin/terraform" -planJSONPath "plan.json" 
2023/11/16 13:09:08 Starting Rover...
2023/11/16 13:09:08 Using provided JSON plan...
2023/11/16 13:09:08 Generating resource overview...
2023/11/16 13:09:08 Generating resource map...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10486eca0]

goroutine 1 [running]:
main.(*rover).GenerateModuleMap(0x14000265320, 0x14000262900, {0x140003fcde0, 0xe})
	rover/map.go:177 +0xac0
main.(*rover).GenerateModuleMap(0x14000265320, 0x140003afb68, {0x0, 0x0})
	rover/map.go:261 +0x107c
main.(*rover).GenerateMap(0x14000265320)
	rover/map.go:343 +0x1c8
main.(*rover).generateAssets(0x14000265320)
	rover/main.go:193 +0x10c
main.main()
	rover/main.go:138 +0xeb8

Worth mentioning that the tests from the examples provided were successful and my team and I are quite excited to use this tool on our own modules. Please advise.

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

No branches or pull requests

1 participant