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

Panic on interface conversion of OrganizationServiceListDefault #375

Closed
jjti opened this issue Aug 19, 2022 · 2 comments · Fixed by #376
Closed

Panic on interface conversion of OrganizationServiceListDefault #375

jjti opened this issue Aug 19, 2022 · 2 comments · Fixed by #376
Labels
bug Something isn't working

Comments

@jjti
Copy link
Contributor

jjti commented Aug 19, 2022

Terraform Version and Provider Version

Terraform version:
HCP provider version:

Affected Resource(s)

  • not sure

Terraform Configuration Files

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 3.43"
    }
    hcp = {
      source  = "hashicorp/hcp"
      version = ">= 0.36.0"
    }
  }

}

provider "hcp" {
}

Debug Output

Panic Output

# josh at josh-P6KR9LXL6P in ~/Desktop/test-nomad-consul/terraform-aws-hcp-consul/hcp-ui-templates/ec2 on git:main ✖︎ [15:45:22]
→ tf apply
╷
│ Error: Plugin did not respond
│ 
│   with provider["registry.terraform.io/hashicorp/hcp"],
│   on main.tf line 22, in provider "hcp":
│   22: provider "hcp" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain more
│ details.
╵

Stack trace from the terraform-provider-hcp_v0.40.0_x5 plugin:

panic: interface conversion: error is *url.Error, not *organization_service.OrganizationServiceListDefault

goroutine 21 [running]:
github.com/hashicorp/terraform-provider-hcp/internal/clients.RetryOrganizationServiceList(0x140002a8540, 0x1400047a0c0, 0x0, 0x0, 0x0)
        github.com/hashicorp/terraform-provider-hcp/internal/clients/retry_request.go:34 +0x21c
github.com/hashicorp/terraform-provider-hcp/internal/provider.getProjectFromCredentials(0x1015939c0, 0x14000424f60, 0x140002a8540, 0x40, 0x0, 0x0)
        github.com/hashicorp/terraform-provider-hcp/internal/provider/provider.go:132 +0x50
github.com/hashicorp/terraform-provider-hcp/internal/provider.configure.func1(0x1015939c0, 0x14000424f60, 0x140006fe880, 0x0, 0x14000424ea0, 0x0, 0x0, 0x0)
        github.com/hashicorp/terraform-provider-hcp/internal/provider/provider.go:114 +0x2f0
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0x140001327e0, 0x1015939c0, 0x14000424f60, 0x14000424ea0, 0x10120c3cb, 0x12, 0x0)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.20.0/helper/schema/provider.go:297 +0x1d8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0x1400012c198, 0x1015939c0, 0x14000424ae0, 0x1400000c408, 0x101204620, 0x9, 0x1012025af)
        github.com/hashicorp/terraform-plugin-sdk/v2@v2.20.0/helper/schema/grpc_provider.go:557 +0x3bc
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0x140001e4000, 0x1015939c0, 0x14000424ae0, 0x14000540380, 0x0, 0x0, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.12.0/tfprotov5/tf5server/server.go:556 +0x254
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler(0x101520a60, 0x140001e4000, 0x1015939c0, 0x140004241b0, 0x1400049e000, 0x0, 0x1015939c0, 0x140004241b0, 0x14000558000, 0x27)
        github.com/hashicorp/terraform-plugin-go@v0.12.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x1c8
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400023e380, 0x10159ccb8, 0x140001224e0, 0x1400077a000, 0x14000417bf0, 0x101bc1478, 0x0, 0x0, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1295 +0x500
google.golang.org/grpc.(*Server).handleStream(0x1400023e380, 0x10159ccb8, 0x140001224e0, 0x1400077a000, 0x0)
        google.golang.org/grpc@v1.48.0/server.go:1636 +0xa50
google.golang.org/grpc.(*Server).serveStreams.func1.2(0x14000034450, 0x1400023e380, 0x10159ccb8, 0x140001224e0, 0x1400077a000)
        google.golang.org/grpc@v1.48.0/server.go:932 +0x94
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.48.0/server.go:930 +0x1f8

Error: The terraform-provider-hcp_v0.40.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.

Steps to Reproduce

  1. export env vars for HCP_CLIENT_ID/HCP_CLIENT_SECRET
  2. terraform apply

Expected Behavior

Actual Behavior

Important Factoids

References

  • #0000

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@jjti jjti added the bug Something isn't working label Aug 19, 2022
@kalenarndt
Copy link

kalenarndt commented Aug 19, 2022

I was able to reproduce this as well on .40 and .41 with terraform 1.2.7


panic: interface conversion: error is *url.Error, not *organization_service.OrganizationServiceListDefault

goroutine 47 [running]:
github.com/hashicorp/terraform-provider-hcp/internal/clients.RetryOrganizationServiceList(0xc0001e06c0, 0x0?)
github.com/hashicorp/terraform-provider-hcp/internal/clients/retry_request.go:34 +0x191
github.com/hashicorp/terraform-provider-hcp/internal/provider.getProjectFromCredentials({0xc0000385ae?, 0x20?}, 0xc000046192?)
github.com/hashicorp/terraform-provider-hcp/internal/provider/provider.go:132 +0x45
github.com/hashicorp/terraform-provider-hcp/internal/provider.configure.func1({0x1037708, 0xc0002fb260}, 0xc0002fb260?)
github.com/hashicorp/terraform-provider-hcp/internal/provider/provider.go:114 +0x336
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0xc00013af00, {0x1037708, 0xc0002fb260}, 0xd?)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.21.0/helper/schema/provider.go:297 +0x1e6
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0xc00000c258, {0x1037708?, 0xc0002fae40?}, 0xc00000c438)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.21.0/helper/schema/grpc_provider.go:557 +0x345
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).Configure(0xc00053fe00, {0x1037708?, 0xc0002fa780?}, 0xc00052e380)
github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/tf5server/server.go:556 +0x2ce
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_Configure_Handler({0xe8f780?, 0xc00053fe00}, {0x1037708, 0xc0002fa780}, 0xc0005580e0, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.14.0/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:331 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0000003c0, {0x103a3a8, 0xc000317380}, 0xc0003819e0, 0xc0000a7590, 0x168ce78, 0x0)
google.golang.org/grpc@v1.48.0/server.go:1295 +0xb0b
google.golang.org/grpc.(*Server).handleStream(0xc0000003c0, {0x103a3a8, 0xc000317380}, 0xc0003819e0, 0x0)
google.golang.org/grpc@v1.48.0/server.go:1636 +0xa1b
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/grpc@v1.48.0/server.go:932 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.48.0/server.go:930 +0x28a

Error: The terraform-provider-hcp_v0.41.0_x5 plugin crashed!

This is always indicative of a bug within the plugin. It would be immensely
helpful if you could report the crash with the plugin's maintainers so that it
can be fixed. The output above should help diagnose the issue.```

@itsjaspermilan
Copy link
Contributor

This fix will be rolled out in the next HCP Terraform Provider release!

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

Successfully merging a pull request may close this issue.

3 participants