terraform-provider-confluent: Provider crashes when creating confluent_schema resource
I use the following setup
schema.tf
resource "confluent_schema" "schema" {
subject_name = "TestNamespace.TestSchema"
schema = file("testschema.avsc")
format = "AVRO"
recreate_on_update = false
hard_delete = false
lifecycle {
prevent_destroy = true
}
}
setup.tf
terraform {
required_version = "1.4.4"
required_providers {
confluent = {
source = "confluentinc/confluent"
version = "1.42.0"
}
}
}
variable "schema_registry_api_key" {
description = "Confluent Schema Registry API Key"
type = string
}
variable "schema_registry_api_secret" {
description = "Confluent Schema Registry API Secret"
type = string
sensitive = true
}
variable "schema_registry_id" {
description = "Confluent Cloud Schema Registry id"
type = string
}
variable "schema_registry_rest_endpoint" {
description = "Confluent Cloud Schema Registry REST endpoint"
type = string
}
provider "confluent" {
schema_registry_id = var.schema_registry_id # optionally use SCHEMA_REGISTRY_ID env var
schema_registry_rest_endpoint = var.schema_registry_rest_endpoint # optionally use SCHEMA_REGISTRY_REST_ENDPOINT env var
schema_registry_api_key = var.schema_registry_api_key # optionally use SCHEMA_REGISTRY_API_KEY env var
schema_registry_api_secret = var.schema_registry_api_secret # optionally use SCHEMA_REGISTRY_API_SECRET env var
}
testschema.avsc
{
"type": "record",
"name": "TestSchema",
"namespace": "TestNamespace",
"fields": [
{
"name": "Id",
"type": "string"
},
{
"name": "Value",
"type": "string"
}
]
}
I set TF_VAR_… variables accordingly to set credentials to the schema registry cluster. when I run:
terraform init
terraform validate
terraform plan -out=tfplan
terraform apply tfplan
on the apply step the provider crashes with this message:
confluent_schema.schema: Creating...
╷
│ Error: Plugin did not respond
│
│ with confluent_schema.schema,
│ on schema.tf line 2, in resource "confluent_schema" "schema":
│ 2: resource "confluent_schema" "schema" {
│
│ The plugin encountered an error, and failed to respond to the plugin.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
Stack trace from the terraform-provider-confluent_1.42.0 plugin:
fatal error: unexpected signal during runtime execution
[signal SIGSEGV: segmentation violation code=0x1 addr=0x236c0 pc=0x236c0]
runtime stack:
runtime.throw({0x13fd3a9?, 0x0?})
/home/semaphore/.goenv/versions/1.20.0/src/runtime/panic.go:1047 +0x5d fp=0x7efc37fe7d58 sp=0x7efc37fe7d28 pc=0x43809d
runtime.sigpanic()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/signal_unix.go:821 +0x3e9 fp=0x7efc37fe7db8 sp=0x7efc37fe7d58 pc=0x44e5a9
goroutine 39 [syscall]:
runtime.cgocall(0xf36c80, 0xc0005ba558)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/cgocall.go:157 +0x5c fp=0xc0005ba530 sp=0xc0005ba4f8 pc=0x406fdc
net._C2func_getaddrinfo(0xc0005a01b0, 0x0, 0xc0005e2bd0, 0xc0005c8438)
/tmp/go-build3196846011/b099/_cgo_gotypes.go:99 +0x56 fp=0xc0005ba558 sp=0xc0005ba530 pc=0x628ed6
net._C_getaddrinfo.func1(0x410ac7?, 0x8?, 0x1201660?, 0xc0005a0101?)
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix_cgo.go:74 +0x85 fp=0xc0005ba5c0 sp=0xc0005ba558 pc=0x629aa5
net._C_getaddrinfo(0x0?, 0x0?, 0x0?, 0xc0005a00c0?)
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix_cgo.go:74 +0x19 fp=0xc0005ba5f0 sp=0xc0005ba5c0 pc=0x6299d9
net.cgoLookupIPCNAME({0x13d0dc7, 0x3}, {0xc0005a00c0, 0x2b})
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix.go:153 +0x175 fp=0xc0005ba738 sp=0xc0005ba5f0 pc=0x5f65b5
net.cgoIPLookup(0x1d7faf0?, {0x13d0dc7?, 0xc0005a00f0?}, {0xc0005a00c0?, 0xc0005c62c0?})
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix.go:210 +0x3b fp=0xc0005ba7a8 sp=0xc0005ba738 pc=0x5f6c7b
net.cgoLookupIP.func1()
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix.go:220 +0x36 fp=0xc0005ba7e0 sp=0xc0005ba7a8 pc=0x5f70b6
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0005ba7e8 sp=0xc0005ba7e0 pc=0x46a961
created by net.cgoLookupIP
/home/semaphore/.goenv/versions/1.20.0/src/net/cgo_unix.go:220 +0x12a
goroutine 1 [select]:
runtime.gopark(0xc0004df930?, 0x2?, 0xca?, 0x31?, 0xc0004df7b4?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:381 +0xd6 fp=0xc0004ef540 sp=0xc0004ef520 pc=0x43ae76
runtime.selectgo(0xc0004ef930, 0xc0004df7b0, 0x1?, 0x0, 0xc0004df970?, 0x1)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/select.go:327 +0x7be fp=0xc0004ef680 sp=0xc0004ef540 pc=0x44a71e
github.com/hashicorp/go-plugin.Serve(0xc0000aa120)
pkg/mod/github.com/hashicorp/go-plugin@v1.4.3/server.go:469 +0x14a5 fp=0xc0004efb60 sp=0xc0004ef680 pc=0xd3aac5
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.Serve({0x13d5aa8, 0x8}, 0xc000037540, {0x0, 0x0, 0x0})
pkg/mod/github.com/hashicorp/terraform-plugin-go@v0.9.0/tfprotov5/tf5server/server.go:311 +0xc0a fp=0xc0004efda0 sp=0xc0004efb60 pc=0xd52b2a
github.com/hashicorp/terraform-plugin-sdk/v2/plugin.tf5serverServe(0xc0000aa0c0)
pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/plugin/serve.go:178 +0x4d9 fp=0xc0004efe80 sp=0xc0004efda0 pc=0xd73e39
github.com/hashicorp/terraform-plugin-sdk/v2/plugin.Serve(0xc0000aa0c0)
pkg/mod/github.com/hashicorp/terraform-plugin-sdk/v2@v2.16.0/plugin/serve.go:118 +0x18d fp=0xc0004eff48 sp=0xc0004efe80 pc=0xd737ed
main.main()
src/github.com/confluentinc/terraform-provider-confluent/main.go:30 +0x6b fp=0xc0004eff80 sp=0xc0004eff48 pc=0xf36b6b
runtime.main()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:250 +0x207 fp=0xc0004effe0 sp=0xc0004eff80 pc=0x43aa47
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0004effe8 sp=0xc0004effe0 pc=0x46a961
goroutine 2 [force gc (idle)]:
runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:381 +0xd6 fp=0xc000084fb0 sp=0xc000084f90 pc=0x43ae76
runtime.goparkunlock(...)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:387
runtime.forcegchelper()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:305 +0xb0 fp=0xc000084fe0 sp=0xc000084fb0 pc=0x43acb0
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000084fe8 sp=0xc000084fe0 pc=0x46a961
created by runtime.init.6
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:293 +0x25
goroutine 3 [GC sweep wait]:
runtime.gopark(0x1?, 0x0?, 0x0?, 0x0?, 0x0?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:381 +0xd6 fp=0xc000085780 sp=0xc000085760 pc=0x43ae76
runtime.goparkunlock(...)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:387
runtime.bgsweep(0x0?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgcsweep.go:319 +0xde fp=0xc0000857c8 sp=0xc000085780 pc=0x42705e
runtime.gcenable.func1()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgc.go:178 +0x26 fp=0xc0000857e0 sp=0xc0000857c8 pc=0x41c2e6
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000857e8 sp=0xc0000857e0 pc=0x46a961
created by runtime.gcenable
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgc.go:178 +0x6b
goroutine 4 [GC scavenge wait]:
runtime.gopark(0xc00003c0e0?, 0x1577070?, 0x0?, 0x0?, 0x0?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:381 +0xd6 fp=0xc000085f70 sp=0xc000085f50 pc=0x43ae76
runtime.goparkunlock(...)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:387
runtime.(*scavengerState).park(0x1d80700)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgcscavenge.go:400 +0x53 fp=0xc000085fa0 sp=0xc000085f70 pc=0x424f53
runtime.bgscavenge(0x0?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgcscavenge.go:633 +0x65 fp=0xc000085fc8 sp=0xc000085fa0 pc=0x425545
runtime.gcenable.func2()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgc.go:179 +0x26 fp=0xc000085fe0 sp=0xc000085fc8 pc=0x41c286
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc000085fe8 sp=0xc000085fe0 pc=0x46a961
created by runtime.gcenable
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mgc.go:179 +0xaa
goroutine 18 [finalizer wait]:
runtime.gopark(0x0?, 0x143f9f8?, 0x0?, 0xa0?, 0x1000000010?)
/home/semaphore/.goenv/versions/1.20.0/src/runtime/proc.go:381 +0xd6 fp=0xc000084628 sp=0xc000084608 pc=0x43ae76
runtime.runfinq()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mfinal.go:193 +0x107 fp=0xc0000847e0 sp=0xc000084628 pc=0x41b2a7
runtime.goexit()
/home/semaphore/.goenv/versions/1.20.0/src/runtime/asm_amd64.s:1598 +0x1 fp=0xc0000847e8 sp=0xc0000847e0 pc=0x46a961
created by runtime.createfing
/home/semaphore/.goenv/versions/1.20.0/src/runtime/mfinal.go:163 +0x45
Error: The terraform-provider-confluent_1.42.0 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.
Let me know if I can provide any additional information.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 15
Commits related to this issue
- #minor Prepare for 1.18.0 release (#258) — committed to javabrett/terraform-provider-confluent by linouk23 2 years ago
I did some further investigation and found that it is most likely a bug in glibc as described here: https://github.com/golang/go/issues/30310
The trace I posted earlier fits and as described in the issue, I can set
GODEBUG=netdns=goenvironment variable to work around the issue.I suggest you try to set
-tags netgoor document one of the workarounds.Thank you so much for the investigation @superkartoffel! That looks like a super easy fix, we just merged it to our internal repo so it’ll be included in our next release 👍
@linouk23 that seems to be the issue. The terraform version out is:
I tried latest terraform versions (1.4.6) for linux amd64 and linux 386: amd64 crashes, 386 works as expected.
Hello @superkartoffel , I had the same problem, changing the provider version to 1.39.0 worked, maybe you can try it