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

[BUG] panic: runtime error: invalid memory address or nil pointer dereference v0.3.0 #84

Closed
mkyc opened this issue Jan 14, 2022 · 8 comments · Fixed by #86
Closed

[BUG] panic: runtime error: invalid memory address or nil pointer dereference v0.3.0 #84

mkyc opened this issue Jan 14, 2022 · 8 comments · Fixed by #86

Comments

@mkyc
Copy link

mkyc commented Jan 14, 2022

Hi, thanks for that amazing tool.

I found that version v0.3.0 doesn't work while v0.2.2 does work:

docker run --rm -it -p 9000:9000 -v $(pwd):/src --env=AWS_ACCESS_KEY_ID="nanana" --env=AWS_SECRET_ACCESS_KEY="nununu" --env=AWS_DEFAULT_REGION="eu-west-1" --platform linux/amd64 im2nguyen/rover -tfBackendConfig lalala.s3.tfbackend -tfVarsFile lalala.tfvars -workspaceName=lalala
2022/01/14 11:59:40 Starting Rover...
2022/01/14 11:59:40 Initializing Terraform...
2022/01/14 11:59:58 Running in mkyc workspace...
2022/01/14 12:00:03 Generating plan...
2022/01/14 12:00:34 Parsing configuration...
2022/01/14 12:00:34 Generating resource overview...
2022/01/14 12:00:35 Generating resource map...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x48 pc=0xa5b0cf]

goroutine 1 [running]:
main.(*rover).GenerateModuleMap(0xc000159320, 0xc0003c87e0, {0xc00003d8d8, 0x12})
        /src/map.go:212 +0x1acf
main.(*rover).GenerateModuleMap(0xc000159320, 0xc0006ddb88, {0x0, 0x0})
        /src/map.go:240 +0xefc
main.(*rover).GenerateMap(0xc000159320)
        /src/map.go:319 +0x1bc
main.(*rover).generateAssets(0xc000159320)
        /src/main.go:207 +0x176
main.main()
        /src/main.go:142 +0xd19

when running the same with v0.2.2 it works.

@EugenMayer
Copy link
Contributor

I have seen the same, it is most probably related to nested modules or modules which are referenced by git - not yet sure

@mkyc
Copy link
Author

mkyc commented Jan 14, 2022

Might be. I do use AWS modules:

module "lalala" {
  source               = "registry.terraform.io/terraform-aws-modules/vpc/aws"
  version              = "~> 3.0"
  ...
}

@JackFlukinger
Copy link
Contributor

That is probably the issue -- I'll check it out later today.

@JackFlukinger
Copy link
Contributor

For the time being @mkyc @EugenMayer it should run with -TFConfigExists=false, let me know if it doesn't

@mkyc
Copy link
Author

mkyc commented Jan 15, 2022

@JackFlukinger yes. Actual flag is -tfConfigExists=false but yes it does work with that flag 👍

@chenrui333
Copy link
Contributor

I run into the similar runtime panic issue,, and this is what I got in my local with -tfConfigExists=false (same error regardless):

$ /opt/homebrew/Cellar/terraform-rover/0.3.0/bin/terraform-rover -tfConfigExists=false  -standalone -tfPath /opt/homebrew/opt/terraform/bin/terraform
2022/01/22 20:35:54 Starting Rover...
2022/01/22 20:35:54 Initializing Terraform...
2022/01/22 20:35:54 Generating plan...
2022/01/22 20:35:54 Generating resource overview...
2022/01/22 20:35:54 Generating resource map...
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0xb0 pc=0x102ef1160]

goroutine 1 [running]:
main.(*rover).GenerateModuleMap(0x140001ff440, 0x14000121830, {0x0, 0x0})
	rover/map.go:134 +0x2f0
main.(*rover).GenerateMap(0x140001ff440)
	rover/map.go:322 +0x220
main.(*rover).generateAssets(0x140001ff440)
	rover/main.go:207 +0x1cc
main.main()
	rover/main.go:142 +0xf34

@chenrui333
Copy link
Contributor

chenrui333 commented Jan 23, 2022

Let me give that fix PR a shot.

There are some issue applying that patch for the 0.3.0 release, gonna try out HEAD build later then.

@chenrui333
Copy link
Contributor

@im2nguyen still have the issue with the new re-tagged release. And I create a new issue tracker #87. Thanks!

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

Successfully merging a pull request may close this issue.

4 participants