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

Error in GoogleDisabledAPIRule #265

Closed
semnil opened this issue Apr 10, 2023 · 1 comment · Fixed by #267
Closed

Error in GoogleDisabledAPIRule #265

semnil opened this issue Apr 10, 2023 · 1 comment · Fixed by #267
Labels
bug Something isn't working

Comments

@semnil
Copy link

semnil commented Apr 10, 2023

Hi,

In v0.23.0, an error occurs when executing tflint.

% tflint
Failed to check ruleset; error reading from server: EOF

The following logs were found with TFLINT_LOG=debug tflint:

panic: interface conversion: tflint.Runner is *plugin2host.GRPCClient, not *google.Runner

goroutine 29 [running]:
github.com/terraform-linters/tflint-ruleset-google/rules/api.(*GoogleDisabledAPIRule).Check(0x14000359ee0?, {0x104bb3118?, 0x14000504980?})
       /home/runner/work/tflint-ruleset-google/tflint-ruleset-google/rules/api/google_disabled_api.go:58 +0x498
github.com/terraform-linters/tflint-plugin-sdk/tflint.(*BuiltinRuleSet).Check(0x10?, {0x104bb3118, 0x14000504980})
       /home/runner/go/pkg/mod/github.com/terraform-linters/[email protected]/tflint/ruleset.go:115 +0x7c
github.com/terraform-linters/tflint-plugin-sdk/plugin/host2plugin.(*GRPCServer).Check(0x1400000d368, {0x1047e8860?, 0x1400041c720?}, 0x1400041c720?)
       /home/runner/go/pkg/mod/github.com/terraform-linters/[email protected]/plugin/host2plugin/server.go:119 +0x108
github.com/terraform-linters/tflint-plugin-sdk/plugin/proto._RuleSet_Check_Handler.func1({0x104bab440, 0x140003ff410}, {0x104afbb00?, 0x140003ff440})
       /home/runner/go/pkg/mod/github.com/terraform-linters/[email protected]/plugin/proto/tflint_grpc.pb.go:342 +0x74
github.com/terraform-linters/tflint-plugin-sdk/plugin/interceptor.RequestLogging.func1({0x104bab440, 0x140003ff410}, {0x104afbb00?, 0x140003ff440?}, 0x140003fc360, 0x140004006c0)
       /home/runner/go/pkg/mod/github.com/terraform-linters/[email protected]/plugin/interceptor/logging.go:16 +0x220
github.com/terraform-linters/tflint-plugin-sdk/plugin/proto._RuleSet_Check_Handler({0x104b59aa0?, 0x1400000d368}, {0x104bab440, 0x140003ff410}, 0x140004465b0, 0x1400000d350)
       /home/runner/go/pkg/mod/github.com/terraform-linters/[email protected]/plugin/proto/tflint_grpc.pb.go:344 +0x12c
google.golang.org/grpc.(*Server).processUnaryRPC(0x140001601e0, {0x104bb2738, 0x140003ea9c0}, 0x14000454360, 0x14000217950, 0x1050c82e0, 0x0)
       /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1345 +0xc28
google.golang.org/grpc.(*Server).handleStream(0x140001601e0, {0x104bb2738, 0x140003ea9c0}, 0x14000454360, 0x0)
       /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:1722 +0x80c
google.golang.org/grpc.(*Server).serveStreams.func1.2()
       /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:966 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func1
       /home/runner/go/pkg/mod/google.golang.org/[email protected]/server.go:964 +0x278

We have enabled the deep_check and google_disabled_api rules.

Part of .tflint.hcl:

plugin "google" {
  enabled = true
  version = "0.23.0"
  source  = "github.com/terraform-linters/tflint-ruleset-google"

  deep_check = true
}

...

rule "google_disabled_api" {
 enabled = true
}

After reverting the changes of Use New Runner hook, the error no longer occurs.
Can you see what is occurring?

@wata727
Copy link
Member

wata727 commented Apr 11, 2023

Thank you for reporting this. It seems like a bug.
Perhaps the NewRunner provided by the SDK is not working as intended. The issue is likely here terraform-linters/tflint-plugin-sdk#225.

As a workaround, you can either use v0.22 or disable deep checking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging a pull request may close this issue.

2 participants