fivetran / terraform-provider-fivetran

Terraform Provider for Fivetran
https://fivetran.com
Apache License 2.0
41 stars 22 forks source link

zendesk sell connector panic on apply #276

Closed ann8ty closed 3 months ago

ann8ty commented 4 months ago

Describe the bug A clear and concise description of what the bug is.

unclear how to configure zendesk sell connector in terraform, too many options in doc

To Reproduce

produces panic on apply

resource "fivetran_connector" "zendesk_sell_connector_name" {
  group_id           = data.aws_ssm_parameter.fivetran_group_id_external_id_versioned.value
  service            = "zendesk_sell"
  run_setup_tests    = true
  trust_fingerprints = true
  trust_certificates = true

  destination_schema {
    name = local.zendesk_sell_connector_name
  }

  config {
    # go click Authorize in the fivetran UI... yeah really!
  }
  auth {

  }
}
fivetran_connector.business_central_connector: Modifying... [id=xxx]
fivetran_connector.zendesk_sell_connector_name: Modifying... [id=xxx]
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵
╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details.
╵

Stack trace from the terraform-provider-fivetran_v1.1.16 plugin:

panic: Unknown servicezendesk_sell

goroutine 61 [running]:
github.com/fivetran/terraform-provider-fivetran/fivetran/common.GetFieldsForService(...)
        github.com/fivetran/terraform-provider-fivetran/fivetran/common/config_field.go:61
github.com/fivetran/terraform-provider-fivetran/fivetran/framework/core/model.(*ConnectorResourceModel).GetConfigMap(0x1400021a900, 0x0?)
        github.com/fivetran/terraform-provider-fivetran/fivetran/framework/core/model/connector.go:147 +0x188
github.com/fivetran/terraform-provider-fivetran/fivetran/framework/resources.(*connector).Update(0x1400000e028, {0x1053a80a0, 0x14000ae4f00}, {{{{0x1053ace58, 0x14000888660}, {0x10528c560, 0x14000b14c60}}, {0x1053ae848, 0x1400004ea50}}, {{{0x1053ace58, ...}, ...}, ...}, ...}, ...)
        github.com/fivetran/terraform-provider-fivetran/fivetran/framework/resources/connector.go:240 +0x324
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).UpdateResource(0x140001e2000, {0x1053a80a0, 0x14000ae4f00}, 0x14000a772d0, 0x14000a771e0)
        github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/fwserver/server_updateresource.go:122 +0x51c
github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(*Server).ApplyResourceChange(0x1053a80a0?, {0x1053a80a0, 0x14000ae4f00}, 0x14000b9c0f0, 0x14000a77400)
        github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/fwserver/server_applyresourcechange.go:102 +0x118
github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(*Server).ApplyResourceChange(0x140001e2000, {0x1053a80a0?, 0x14000ae4db0?}, 0x14000b9c0a0)
        github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/proto6server/server_applyresourcechange.go:55 +0x1a4
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ApplyResourceChange(0x1053a7ff8?, {0x1053a80a0?, 0x14000ae4a80?}, 0x14000b9c0a0)
        github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf6muxserver/mux_server_ApplyResourceChange.go:36 +0x188
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0x140000bf720, {0x1053a80a0?, 0x14000ae4240?}, 0x1400022e070)
        github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov6/tf6server/server.go:857 +0x3b8
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x10536a2c0?, 0x140000bf720}, {0x1053a80a0, 0x14000ae4240}, 0x1400022e000, 0x0)
        github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:467 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400048e000, {0x1053ad320, 0x1400050a4e0}, 0x14000b9e000, 0x14000465650, 0x105995bd8, 0x0)
        google.golang.org/grpc@v1.57.0/server.go:1360 +0xc88
google.golang.org/grpc.(*Server).handleStream(0x1400048e000, {0x1053ad320, 0x1400050a4e0}, 0x14000b9e000, 0x0)
        google.golang.org/grpc@v1.57.0/server.go:1737 +0x82c
google.golang.org/grpc.(*Server).serveStreams.func1.1()
        google.golang.org/grpc@v1.57.0/server.go:982 +0x84
created by google.golang.org/grpc.(*Server).serveStreams.func1
        google.golang.org/grpc@v1.57.0/server.go:980 +0x16c

Error: The terraform-provider-fivetran_v1.1.16 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.

produces panic on apply

resource "fivetran_connector" "zendesk_sell_connector_name" {
  group_id           = data.aws_ssm_parameter.fivetran_group_id_external_id_versioned.value
  service            = "zendesk_sell"
  run_setup_tests    = true
  trust_fingerprints = true
  trust_certificates = true

  destination_schema {
    name = local.zendesk_sell_connector_name
  }

}

fivetran_connector.business_central_connector: Modifying... [id=xxx] fivetran_connector.zendesk_sell_connector_name: Modifying... [id=xxx] ╷ │ Error: Request cancelled │ │ The plugin6.(GRPCProvider).ApplyResourceChange request was cancelled. ╵ ╷ │ Error: Plugin did not respond │ │ The plugin encountered an error, and failed to respond to the plugin6.(GRPCProvider).ApplyResourceChange call. The plugin logs may contain more details. ╵

Stack trace from the terraform-provider-fivetran_v1.1.16 plugin:

panic: Unknown servicezendesk_sell

goroutine 16 [running]: github.com/fivetran/terraform-provider-fivetran/fivetran/common.GetFieldsForService(...) github.com/fivetran/terraform-provider-fivetran/fivetran/common/config_field.go:61 github.com/fivetran/terraform-provider-fivetran/fivetran/framework/core/model.(ConnectorResourceModel).GetConfigMap(0x14000e30100, 0x0?) github.com/fivetran/terraform-provider-fivetran/fivetran/framework/core/model/connector.go:147 +0x188 github.com/fivetran/terraform-provider-fivetran/fivetran/framework/resources.(connector).Update(0x14000b8e020, {0x1058600a0, 0x140006475c0}, {{{{0x105864e58, 0x1400074b920}, {0x105744560, 0x14000715b90}}, {0x105866848, 0x14000180960}}, {{{0x105864e58, ...}, ...}, ...}, ...}, ...) github.com/fivetran/terraform-provider-fivetran/fivetran/framework/resources/connector.go:240 +0x324 github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(Server).UpdateResource(0x1400016a000, {0x1058600a0, 0x140006475c0}, 0x14000e7f2d0, 0x14000e7f1e0) github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/fwserver/server_updateresource.go:122 +0x51c github.com/hashicorp/terraform-plugin-framework/internal/fwserver.(Server).ApplyResourceChange(0x1058600a0?, {0x1058600a0, 0x140006475c0}, 0x14000beabe0, 0x14000e7f400) github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/fwserver/server_applyresourcechange.go:102 +0x118 github.com/hashicorp/terraform-plugin-framework/internal/proto6server.(Server).ApplyResourceChange(0x1400016a000, {0x1058600a0?, 0x14000647470?}, 0x14000beab90) github.com/hashicorp/terraform-plugin-framework@v1.4.2/internal/proto6server/server_applyresourcechange.go:55 +0x1a4 github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(muxServer).ApplyResourceChange(0x10585fff8?, {0x1058600a0?, 0x14000647110?}, 0x14000beab90) github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf6muxserver/mux_server_ApplyResourceChange.go:36 +0x188 github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(server).ApplyResourceChange(0x1400051f680, {0x1058600a0?, 0x14000646720?}, 0x140002361c0) github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov6/tf6server/server.go:857 +0x3b8 github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x1058222c0?, 0x1400051f680}, {0x1058600a0, 0x14000646720}, 0x14000236150, 0x0) github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:467 +0x170 google.golang.org/grpc.(Server).processUnaryRPC(0x140000f2000, {0x105865320, 0x14000582d00}, 0x14000dadc20, 0x1400046d680, 0x105e4dbd8, 0x0) google.golang.org/grpc@v1.57.0/server.go:1360 +0xc88 google.golang.org/grpc.(Server).handleStream(0x140000f2000, {0x105865320, 0x14000582d00}, 0x14000dadc20, 0x0) google.golang.org/grpc@v1.57.0/server.go:1737 +0x82c google.golang.org/grpc.(Server).serveStreams.func1.1() google.golang.org/grpc@v1.57.0/server.go:982 +0x84 created by google.golang.org/grpc.(*Server).serveStreams.func1 google.golang.org/grpc@v1.57.0/server.go:980 +0x16c

Error: The terraform-provider-fivetran_v1.1.16 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.



**Expected behavior**
no panic

**Logs & Output**
see above with examples

**Plugin version:**
v1.1.16

**Additional context**
upgrading from 0.7.3, have been stuck so far
beevital commented 4 months ago

@ann8ty thank you! Working on this.

ann8ty commented 3 months ago

we actually don't need this anymore, but i was finally able to upgrade using 1.1.17!

beevital commented 3 months ago

It actually should not be panic. It should be a diags message like "Service zendesk_sell is not yet supported in Fivetran Terraform Provider" We have lag between our public API and terraform schema up to 2 weeks.

beevital commented 3 months ago

zendesk_sell supported in latest v1.1.20. Updated logic for missing service - no panic anymore.