terraform-linters / tflint

A Pluggable Terraform Linter
Mozilla Public License 2.0
4.86k stars 354 forks source link

Error: Incompatible API version with plugin "google". Plugin version: 5, TFLint versions: [9] #1242

Closed MPV closed 2 years ago

MPV commented 2 years ago

Am I using this wrong?

$ tflint --version
TFLint version 0.30.0

$ cat .tflint.hcl
plugin "google" {
    enabled = true
    version = "0.13.1"
    source  = "github.com/terraform-linters/tflint-ruleset-google"
}

$ tflint --init
Installing `google` plugin...
Installed `google` (source: github.com/terraform-linters/tflint-ruleset-google, version: 0.13.1)

$ tflint --enable-plugin=google .
Failed to initialize plugins. An error occurred:

Error: Incompatible API version with plugin "google". Plugin version: 5, TFLint versions: [9]
wata727 commented 2 years ago

This seems to be a bug in --enable-plugin.

Probably not .tflint.d/plugins/github.com/terraform-linters/tflint-ruleset-google/0.13.1/tflint-ruleset-goole, but.tflint.d/plugins/tflint-ruleset-google is referenced.

MPV commented 2 years ago

Is there other ways of using the google plugins that would already work? 🤔

Either way, promising with a fix in #1243 of course. 😍

wata727 commented 2 years ago

A workaround is not to use --enable-plugin. When enabling or disabling plugins, it works perfectly by directly rewriting the config file. Another option is to move the plugins to ~/.tflint.d/plugins/tflint-ruleset-google.

Or, I have released v0.33.1 which includes this fix, so please update it. https://github.com/terraform-linters/tflint/releases/tag/v0.33.1