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

Plugin crashed! - "cloudamqp_vpc_info" "vpc_info" #310

Closed
ricardochaves opened this issue Jan 24, 2025 · 3 comments
Closed

Plugin crashed! - "cloudamqp_vpc_info" "vpc_info" #310

ricardochaves opened this issue Jan 24, 2025 · 3 comments

Comments

@ricardochaves
Copy link

I'm trying to get data from a VPC that already exists in my account.
However, I always get this error.a

Terraform code:

data "cloudamqp_vpc_info" "vpc_info" {
  vpc_id = "271107"
}

output "test" {
  value = data.cloudamqp_vpc_info.vpc_info
}

Erro:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Plugin did not respond
│ 
│   with data.cloudamqp_vpc_info.vpc_info,
│   on cloudamqp.tf line 72, in data "cloudamqp_vpc_info" "vpc_info":
│   72: data "cloudamqp_vpc_info" "vpc_info" {
│ 
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ReadDataSource call. The plugin logs may contain more details.
╵
data.cloudamqp_vpc_info.vpc_info: Still reading... [1m10s elapsed]
Releasing state lock. This may take a few moments...

Stack trace from the terraform-provider-cloudamqp_v1.32.2 plugin:

panic: interface conversion: interface {} is nil, not string

goroutine 51 [running]:
github.com/cloudamqp/terraform-provider-cloudamqp/cloudamqp.dataSourceVpcInfoRead(0x40001d1400, {0x8b0b40?, 0x4000351300})
        github.com/cloudamqp/terraform-provider-cloudamqp/cloudamqp/data_source_cloudamqp_vpc_info.go:70 +0x3e4
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x9f41b0?, {0x9f41b0?, 0x4000050210?}, 0xd?, {0x8b0b40?, 0x4000351300?})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:811 +0x130
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).ReadDataApply(0x400019b6c0, {0x9f41b0, 0x4000050210}, 0x40001d1300, {0x8b0b40, 0x4000351300})
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:1043 +0x110
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadDataSource(0x40003e3a40, {0x9f41b0?, 0x4000509ef0?}, 0x4000509e90)
        github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1436 +0x5a0
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ReadDataSource(0x400019e960, {0x9f41b0?, 0x4000509500?}, 0x40002846e0)
        github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:688 +0x1cc
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ReadDataSource_Handler({0x893de0, 0x400019e960}, {0x9f41b0, 0x4000509500}, 0x40001d0b00, 0x0)
        github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:665 +0x1c0
google.golang.org/grpc.(*Server).processUnaryRPC(0x40001ccc00, {0x9f41b0, 0x4000509470}, {0x9f8e40, 0x40004b2000}, 0x40000feea0, 0x4000410750, 0xf6b7a0, 0x0)
        google.golang.org/[email protected]/server.go:1394 +0xb64
google.golang.org/grpc.(*Server).handleStream(0x40001ccc00, {0x9f8e40, 0x40004b2000}, 0x40000feea0)
        google.golang.org/[email protected]/server.go:1805 +0xb20
google.golang.org/grpc.(*Server).serveStreams.func2.1()
        google.golang.org/[email protected]/server.go:1029 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 22
        google.golang.org/[email protected]/server.go:1040 +0x13c

Error: The terraform-provider-cloudamqp_v1.32.2 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.

@tbroden84
Copy link
Contributor

@ricardochaves tried to reproduce the issue, but couldn't. Are you sure you use the correct VPC identifier?

Using a managed cloudamqp_vpc resource the information is collected. While using a non-existing VPC in our backend, there is an error and not plugin crash.

Can you please email [email protected] with your account and cluster information and refer to this issue. So can I take a look in our backend and logs.

@ricardochaves
Copy link
Author

Hi @tbroden84, thanks for the quick reply
I have 4 VPCs, two used for AWS and two used in Azure.
The data works in both AWS, but it doesn't work in the two Azure ones.
I wanted the output of the object, but I managed to get it in another way.
Anyway, if you couldn't reproduce it and you're not interested in investigating further, you can close the issue.
Anyway, it would be interesting to have a 400 instead of a 500 in the error return.

@tbroden84
Copy link
Contributor

Ah, cloudamqp_vpc_info is only supported for AWS and we have one for Google. Both can be used for setting up peering. A bit more complicated for Azure, so it's not supported in this provider. Agree, should not return 500. Will make a note about this and close this issue.

tbroden84 added a commit that referenced this issue Jan 27, 2025
When using data source `cloudamqp_vpc_info` for another provider
than AWS, the provider will crash. Handle missing id in response
and unable to cast nil data to a string.

Reference: #310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants