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

tflint crashed #129

Closed
netflash opened this issue Jul 27, 2017 · 10 comments
Closed

tflint crashed #129

netflash opened this issue Jul 27, 2017 · 10 comments
Labels

Comments

@netflash
Copy link

This is what I've got

Panic: interface conversion: interface {} is int, not string
 -> 0: main.main.func1: /main.go(17)
 -> 1: runtime.call32: /asm_amd64.s(514)
 -> 2: runtime.gopanic: /panic.go(489)
 -> 3: runtime.panicdottype: /iface.go(172)
 -> 4: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalOutput).Eval: /eval.go(399)
 -> 5: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).visit: /eval.go(207)
 -> 6: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).(github.com/wata727/tflint/vendor/github.com/hashicorp/hil.visit)-fm: /eval.go(167)
 -> 7: github.com/wata727/tflint/vendor/github.com/hashicorp/hil/ast.(*Output).Accept: /output.go(23)
 -> 8: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).Visit: /eval.go(167)
 -> 9: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.internalEval: /eval.go(145)
 -> 10: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.Eval: /eval.go(52)
 -> 11: github.com/wata727/tflint/evaluator.(*Evaluator).Eval: /evaluator.go(67)
 -> 12: github.com/wata727/tflint/evaluator.(*Evaluator).evalModuleAttr: /module.go(44)
 -> 13: github.com/wata727/tflint/evaluator.(*Evaluator).initModule: /module.go(24)
 -> 14: github.com/wata727/tflint/evaluator.NewEvaluator: /evaluator.go(35)
 -> 15: github.com/wata727/tflint/detector.NewDetector: /detector.go(88)
 -> 16: main.(*CLI).Run: /cli.go(116)
 -> 17: main.main: /main.go(30)
 -> 18: runtime.main: /proc.go(185)
 -> 19: runtime.goexit: /asm_amd64.s(2197)

TFLint crached... :(
Please attach an output log, describe the situation and version that occurred and post an issue to https://github.com/wata727/tflint/issues

version 0.4.0

not sure if I need to attach anything else to help debugging this

@wata727 wata727 added the bug label Jul 28, 2017
@wata727
Copy link
Member

wata727 commented Jul 28, 2017

Hi @netflash, Thanks for your bug report.
This problem seems to be occurring in external packages. I have released v0.4.1, which updated the external packages to the latest version. Please try this.

not sure if I need to attach anything else to help debugging this

Please use --debug options :)

@netflash
Copy link
Author

Thanks, @wata727.
Still doesn't work (version updated)

$ make lint
TF_VAR_datadog_api_key="qwe" tflint --debug
DEBUG:/loader.go:120 [INFO] Load environment...
DEBUG:/loader.go:128 [ERROR] open .terraform/environment: no such file or directory
DEBUG:/loader.go:131 [INFO] Load tfstate...
DEBUG:/loader.go:135 [ERROR] stat terraform.tfstate: no such file or directory
DEBUG:/loader.go:141 [INFO] Remote state detected
DEBUG:/loader.go:161 [INFO] Load tfvars...
DEBUG:/loader.go:164 [INFO] Load `terraform.tfvars`
DEBUG:/loader.go:166 [ERROR] stat terraform.tfvars: no such file or directory
DEBUG:/loader.go:191 [INFO] Load HCL file: `aws.tf`
DEBUG:/loader.go:53 [INFO] Load HCL file: `aws.tf`
DEBUG:/loader.go:191 [INFO] Load HCL file: `datadog.tf`
DEBUG:/loader.go:53 [INFO] Load HCL file: `datadog.tf`
DEBUG:/loader.go:191 [INFO] Load HCL file: `global.tf`
DEBUG:/loader.go:53 [INFO] Load HCL file: `global.tf`
DEBUG:/loader.go:191 [INFO] Load HCL file: `remote.tf`
DEBUG:/loader.go:53 [INFO] Load HCL file: `remote.tf`
DEBUG:/loader.go:191 [INFO] Load HCL file: `variables.tf`
DEBUG:/loader.go:53 [INFO] Load HCL file: `variables.tf`
Panic: interface conversion: interface {} is int, not string
 -> 0: main.main.func1: /main.go(17)
 -> 1: runtime.call32: /asm_amd64.s(514)
 -> 2: runtime.gopanic: /panic.go(489)
 -> 3: runtime.panicdottype: /iface.go(172)
 -> 4: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalOutput).Eval: /eval.go(449)
 -> 5: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).visit: /eval.go(215)
 -> 6: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).(github.com/wata727/tflint/vendor/github.com/hashicorp/hil.visit)-fm: /eval.go(175)
 -> 7: github.com/wata727/tflint/vendor/github.com/hashicorp/hil/ast.(*Output).Accept: /output.go(23)
 -> 8: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.(*evalVisitor).Visit: /eval.go(175)
 -> 9: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.internalEval: /eval.go(153)
 -> 10: github.com/wata727/tflint/vendor/github.com/hashicorp/hil.Eval: /eval.go(52)
 -> 11: github.com/wata727/tflint/evaluator.(*Evaluator).Eval: /evaluator.go(72)
 -> 12: github.com/wata727/tflint/evaluator.(*Evaluator).evalModuleAttr: /module.go(44)
 -> 13: github.com/wata727/tflint/evaluator.(*Evaluator).initModule: /module.go(24)
 -> 14: github.com/wata727/tflint/evaluator.NewEvaluator: /evaluator.go(39)
 -> 15: github.com/wata727/tflint/detector.NewDetector: /detector.go(89)
 -> 16: main.(*CLI).Run: /cli.go(116)
 -> 17: main.main: /main.go(30)
 -> 18: runtime.main: /proc.go(185)
 -> 19: runtime.goexit: /asm_amd64.s(2197)

TFLint crached... :(
Please attach an output log, describe the situation and version that occurred and post an issue to https://github.com/wata727/tflint/issues

make: *** [lint] Error 2

@wata727
Copy link
Member

wata727 commented Aug 1, 2017

Umm... It seems to be occurring when evaluating the attributes of a module. But I don't know how to reproduce it.
If there is a module that uses interpolation syntax in the templates, can you show it?

@netflash
Copy link
Author

netflash commented Aug 1, 2017

@toddmichael hey mate, need some assistance here.
how can I share that module ?

@toddmichael
Copy link

toddmichael commented Aug 2, 2017

@netflash, not sure which module, but I'm generally fine provided nothing sensitive (and there shouldn't be). Are we talking about just sharing for debugging purposes or do we need to open source the module and make public? Even there, this is something we're working toward so it's worth it to prioritize if it helps @wata727 help us.

@sidick
Copy link

sidick commented Aug 2, 2017

I had the same issue, I narrowed it down to where I'd set a variable to "default = 1" and then was using it as "${var.name}" with quotes. That would explain the "is int not string" error message. As soon as I changed the default to be "1" rather than 1 it didn't crash

@wata727
Copy link
Member

wata727 commented Aug 2, 2017

Oh... Thanks, @sidick. I noticed that I had made a very basic mistake.
I will fix this problem soon. please wait a moment.

@wata727
Copy link
Member

wata727 commented Aug 2, 2017

@netflash @sidick I've fixed this bug and released v0.4.2. Please try again.

@netflash
Copy link
Author

netflash commented Aug 2, 2017

Problem sovled, thank you!

@sidick
Copy link

sidick commented Aug 3, 2017

Yep, fixed here too, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants