Giter Club home page Giter Club logo

Comments (10)

wata727 avatar wata727 commented on September 13, 2024

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 :)

from tflint.

netflash avatar netflash commented on September 13, 2024

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

from tflint.

wata727 avatar wata727 commented on September 13, 2024

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?

from tflint.

netflash avatar netflash commented on September 13, 2024

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

from tflint.

toddmichael avatar toddmichael commented on September 13, 2024

@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.

from tflint.

sidick avatar sidick commented on September 13, 2024

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

from tflint.

wata727 avatar wata727 commented on September 13, 2024

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

from tflint.

wata727 avatar wata727 commented on September 13, 2024

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

from tflint.

netflash avatar netflash commented on September 13, 2024

Problem sovled, thank you!

from tflint.

sidick avatar sidick commented on September 13, 2024

Yep, fixed here too, thanks

from tflint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.