Closed larsen0815 closed 3 years ago
Still crashes with terraform 1.0.0
Updated the provider to 5.1.3, now another crash happens if I use "endpoint" (which used to work in 5.0.4):
provider "ionoscloud" {
username = "none@example.com"
password = "xxx"
endpoint = "https://nbc-api.nexinto.com/cloudapi/v6"
}
?
¦ Error: Plugin did not respond
¦
¦ with provider["registry.terraform.io/ionos-cloud/ionoscloud"],
¦ on /root/terraform/demo/test.tf line 9, in provider "ionoscloud":
¦ 9: provider "ionoscloud" {
¦
¦ 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-ionoscloud_v5.1.3 plugin:
panic: runtime error: index out of range [2] with length 2
goroutine 25 [running]:
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud.providerConfigure(0xc0002cc2a0, 0xc0002b53b0, 0x5, 0x1, 0x1, 0xebfd78, 0x1508140)
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud/provider.go:137 +0x752
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud.Provider.func1(0xc0002cc2a0, 0x0, 0xc000803120, 0xc0002cc2a0, 0x0)
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud/provider.go:102 +0xd1
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Provider).Configure(0xc0000b9780, 0xc0002bbc20, 0x137b820, 0xc0002bbb90)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/helper/schema/provider.go:275 +0xf6
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).Configure(0xc00000f760, 0x18d0ea0, 0xc0002bb6b0, 0xc000521200, 0xc00000f760, 0xc0002bb6b0, 0xc00015dba0)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/internal/helper/plugin/grpc_provider.go:487 +0x2e6
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_Configure_Handler(0x14f1c40, 0xc00000f760, 0x18d0ea0, 0xc0002bb6b0, 0xc0002af4a0, 0x0, 0x18d0ea0, 0xc0002bb6b0, 0xc000112320, 0x9c)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/internal/tfplugin5/tfplugin5.pb.go:3251 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00017ddc0, 0x18df9a0, 0xc00059d380, 0xc0001cec00, 0xc0000fe630, 0x22c3358, 0x0, 0x0, 0x0)
google.golang.org/grpc@v1.31.1/server.go:1180 +0x50a
google.golang.org/grpc.(*Server).handleStream(0xc00017ddc0, 0x18df9a0, 0xc00059d380, 0xc0001cec00, 0x0)
google.golang.org/grpc@v1.31.1/server.go:1503 +0xcfd
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc0000340a0, 0xc00017ddc0, 0x18df9a0, 0xc00059d380, 0xc0001cec00)
google.golang.org/grpc@v1.31.1/server.go:843 +0xa1
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.31.1/server.go:841 +0x204
Error: The terraform-provider-ionoscloud_v5.1.3 plugin crashed!
The panic in regards to the endpoint parameter is already documented in #12 . This seems to be a duplicate. Can we close the original issue in regards to panic when importing since this seems to be fixed?
Yes. The first problem I noticed seems to have been fixed in the meantime. I hadn't seen the other issue when I updated this ticket with the crash from the new version.
Thank you :)
I'm afraid the initial crash had only been masked by the second one. After updating the provider to 5.1.5 it's back.
Stack trace from the terraform-provider-ionoscloud_v5.1.5 plugin:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x11fb7e1]
goroutine 27 [running]:
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud.resourceServerRead(0xc0002d6af0, 0x145b460, 0xc0002d10e0, 0x0, 0x0)
github.com/ionos-cloud/terraform-provider-ionoscloud/ionoscloud/resource_server.go:829 +0xc21
github.com/hashicorp/terraform-plugin-sdk/helper/schema.(*Resource).RefreshWithoutUpgrade(0xc000438a20, 0xc0002dad20, 0x145b460, 0xc0002d10e0, 0xc0002868e8, 0x0, 0x0)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/helper/schema/resource.go:460 +0x119
github.com/hashicorp/terraform-plugin-sdk/internal/helper/plugin.(*GRPCProviderServer).ReadResource(0xc00000f768, 0x18de3a0, 0xc000317950, 0xc0002bf5c0, 0xc00000f768, 0xc000317950, 0xc0005eeba0)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/internal/helper/plugin/grpc_provider.go:525 +0x3d8
github.com/hashicorp/terraform-plugin-sdk/internal/tfplugin5._Provider_ReadResource_Handler(0x14fcc80, 0xc00000f768, 0x18de3a0, 0xc000317950, 0xc0002bf560, 0x0, 0x18de3a0, 0xc000317950, 0xc0005e3180, 0x242)
github.com/hashicorp/terraform-plugin-sdk@v1.16.1/internal/tfplugin5/tfplugin5.pb.go:3269 +0x217
google.golang.org/grpc.(*Server).processUnaryRPC(0xc00017ddc0, 0x18ece40, 0xc00059b080, 0xc0001cce00, 0xc000100690, 0x22cf370, 0x0, 0x0, 0x0)
google.golang.org/grpc@v1.31.1/server.go:1180 +0x50a
google.golang.org/grpc.(*Server).handleStream(0xc00017ddc0, 0x18ece40, 0xc00059b080, 0xc0001cce00, 0x0)
google.golang.org/grpc@v1.31.1/server.go:1503 +0xcfd
google.golang.org/grpc.(*Server).serveStreams.func1.2(0xc000034550, 0xc00017ddc0, 0x18ece40, 0xc00059b080, 0xc0001cce00)
google.golang.org/grpc@v1.31.1/server.go:843 +0xa1
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.31.1/server.go:841 +0x204
@larsen0815 I had a similar crash, and maybe for a similar reason. For me it crashed setting the kubeconfig on an imported kubernetes cluster.
Above you mentioned your endpoint is endpoint = "https://nbc-api.nexinto.com/cloudapi/v6"
, which is incompatible with this terraform provider, since it uses https://github.com/ionos-cloud/sdk-go, which is built using the v5 swagger definition.
For me switching from the V6 to the V5 endpoint fixed the crash
@m2hofi94 @larsen0815 - I've just released v5.1.6
which should fix this crash - let me know if it works for you.
Fixed. Thanks a lot for the quick help!
Description
I used this command (which probably isn't correct) and the plugin crashed
terraform import ionoscloud_server.${name_server} ${ID_DC}/${ID_SERVER}/33b25c25-7e79-4b8b-8f91-2a64692578d1
Seems like it cannot handle a UID as a NIC.Expected behavior
Should return something like "Proper value range is from 1 to 99".
Environment
Terraform version:
Provider version:
OS:
Error and Debug Output