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

[Bug]: Configuration of the provider fails #3350

Closed
1 task
joscha opened this issue Jan 21, 2025 · 6 comments
Closed
1 task

[Bug]: Configuration of the provider fails #3350

joscha opened this issue Jan 21, 2025 · 6 comments
Assignees
Labels
category:migration Issues connected with migration to v1.0.0. category:provider_config general-usage General help/usage questions

Comments

@joscha
Copy link
Contributor

joscha commented Jan 21, 2025

Terraform CLI Version

OpenTofu v1.8.6

Terraform Provider Version

1.0.2

Company Name

Planet A

Terraform Configuration

provider "snowflake" {
  alias = "ingest_role"
  role  = var.ingest_role

  authenticator = "SNOWFLAKE_JWT"
  organization_name = var.snowflake_organization_name
  account_name = var.snowflake_account_name
}

provider "snowflake" {
  role = "ORGADMIN"

  alias         = "orgadmin"
  authenticator = "SNOWFLAKE_JWT"
  organization_name = var.snowflake_organization_name
  account_name = var.snowflake_account_name
}

provider "snowflake" {
  role = "SECURITYADMIN"

  alias         = "securityadmin"
  authenticator = "SNOWFLAKE_JWT"
  organization_name = var.snowflake_organization_name
  account_name = var.snowflake_account_name
}

provider "snowflake" {
  role = "SYSADMIN"

  alias         = "sysadmin"
  authenticator = "SNOWFLAKE_JWT"
  organization_name = var.snowflake_organization_name
  account_name = var.snowflake_account_name
}

Category

category:provider_config

Object type(s)

No response

Expected Behavior

The snowflake provider should not crash

Actual Behavior

╷
│ Error: Invalid provider configuration
│ 
│ Provider "registry.opentofu.org/snowflake-labs/snowflake" requires explicit configuration. Add a provider block to the root module and configure the provider's required arguments as described in the provider documentation.
│ 
╵

╷
│ Error: Plugin did not respond
│ 
│ The plugin encountered an error, and failed to respond to the plugin6.(*GRPCProvider).ConfigureProvider call. The plugin logs may contain more details.
╵

╷
│ Error: Request cancelled
│ 
│ The plugin6.(*GRPCProvider).ConfigureProvider request was cancelled.
╵

╷
│ Error: Request cancelled
│ 
│ The plugin6.(*GRPCProvider).ConfigureProvider request was cancelled.
╵

╷
│ Error: 260000: account is empty
│ 
│   with provider["registry.opentofu.org/snowflake-labs/snowflake"],
│   on provider["registry.opentofu.org/snowflake-labs/snowflake"] with no configuration line 1:
│   (source code not available)
│ 
╵


Stack trace from the terraform-provider-snowflake_v1.0.2 plugin:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1039601a8]

goroutine 52 [running]:
crypto/rsa.(*PrivateKey).Public(...)
	crypto/rsa/rsa.go:122
github.com/snowflakedb/gosnowflake.prepareJWTToken(0x14001031400)
	github.com/snowflakedb/[email protected]/auth.go:476 +0x28
github.com/snowflakedb/gosnowflake.createRequestBody(0x14000873740, 0x1400066c700?, {{0x140007690c0, 0x1c}, {0x103f411b3, 0x6}, {0x1400069ddc8, 0x8}, {0x103f507e6, 0x9}, ...}, ...)
	github.com/snowflakedb/[email protected]/auth.go:439 +0x358
github.com/snowflakedb/gosnowflake.authenticate.func1()
	github.com/snowflakedb/[email protected]/auth.go:339 +0x74
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x14000b0ded0)
	github.com/snowflakedb/[email protected]/retry.go:310 +0x1a8
github.com/snowflakedb/gosnowflake.postAuthRestful({0x104859a40?, 0x10583fa60?}, 0x103f5c1de?, 0x1400101f3d0?, 0x14000b0e0c8?, 0x103932d14?, 0x14000b0e048?, 0x102936538?)
	github.com/snowflakedb/[email protected]/restful.go:199 +0xd8
github.com/snowflakedb/gosnowflake.postAuth({0x104859a40, 0x10583fa60}, 0x14000a75ad0, 0x8?, 0x1400101f3d0, 0x30?, 0x14000b0e188?, 0x10293e600?)
	github.com/snowflakedb/[email protected]/auth.go:231 +0x2cc
github.com/snowflakedb/gosnowflake.authenticate({0x104859a40, 0x10583fa60}, 0x14000873740, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0})
	github.com/snowflakedb/[email protected]/auth.go:359 +0xf5c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x14000873740)
	github.com/snowflakedb/[email protected]/auth.go:553 +0x340
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x14000769089, 0xf}, {0x14000769080, 0x7}, {0x14000769080, 0x0}, {0x0, ...}, ...})
	github.com/snowflakedb/[email protected]/driver.go:44 +0x118
github.com/snowflakedb/gosnowflake.SnowflakeDriver.Open({}, {0x14000769080, 0xb7})
	github.com/snowflakedb/[email protected]/driver.go:27 +0xf8
github.com/luna-duclos/instrumentedsql.dsnConnector.Connect(...)
	github.com/luna-duclos/[email protected]/connector.go:53
github.com/luna-duclos/instrumentedsql.wrappedConnector.Connect({{{0x10483f9a0, 0x10482e8b8}, {0x104842760, 0x10583fa60}, 0x0, 0x0}, {0x104849058, 0x14000bce300}, 0x14000677780}, {0x104859a40?, ...})
	github.com/luna-duclos/[email protected]/connector.go:33 +0x188
database/sql.(*DB).conn(0x14000a75860, {0x104859a40, 0x10583fa60}, 0x1)
	database/sql/sql.go:1387 +0x824
database/sql.(*DB).PingContext.func1(0xd0?)
	database/sql/sql.go:850 +0x40
database/sql.(*DB).retry(0x14000c077d0?, 0x14000b0f048)
	database/sql/sql.go:1538 +0x4c
database/sql.(*DB).PingContext(0x14000a75860, {0x104859a40?, 0x10583fa60})
	database/sql/sql.go:849 +0x70
database/sql.(*DB).Ping(...)
	database/sql/sql.go:867
github.com/jmoiron/sqlx.Connect({0x103f80692?, 0x16?}, {0x14000769080?, 0x14000677740?})
	github.com/jmoiron/[email protected]/sqlx.go:642 +0x48
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk.NewClient(0x14001030e00?)
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk/client.go:152 +0xc4
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider.ConfigureProvider({0x103f411a1?, 0x6?}, 0x14000c06ae0?)
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/provider.go:555 +0x1f8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0x1400103aa20, {0x104859a78, 0x14000c06ae0}, 0x14000f1e5a0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:306 +0x1cc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0x1400102fe48, {0x104859a78?, 0x140007b1e00?}, 0x140007a36b0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:611 +0x340
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ConfigureProvider({{0x1048721d8?, 0x1400102fe48?}}, {0x104859a78?, 0x140007b1e00?}, 0x140007a3650?)
	github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:86 +0x154
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ConfigureProvider(0x140010533b0, {0x104859a78?, 0x140007b1b00?}, 0x5?)
	github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ConfigureProvider.go:28 +0x110
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0x14000d44500, {0x104859a78?, 0x140007b1290?}, 0x14000676040)
	github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:558 +0x244
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x1047b26a0?, 0x14000d44500}, {0x104859a78, 0x140007b1290}, 0x14000f84c80, 0x0)
	github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:464 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x14001030a00, {0x104859a78, 0x140007b1200}, {0x10486d720, 0x140000e8a80}, 0x14000ad99e0, 0x140007b0720, 0x10576f350, 0x0)
	google.golang.org/[email protected]/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x14001030a00, {0x10486d720, 0x140000e8a80}, 0x14000ad99e0)
	google.golang.org/[email protected]/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 51
	google.golang.org/[email protected]/server.go:1030 +0x150
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x101eec1a8]

goroutine 71 [running]:
crypto/rsa.(*PrivateKey).Public(...)
	crypto/rsa/rsa.go:122
github.com/snowflakedb/gosnowflake.prepareJWTToken(0x14000ec9000)
	github.com/snowflakedb/[email protected]/auth.go:476 +0x28
github.com/snowflakedb/gosnowflake.createRequestBody(0x140008aee40, 0x1400104fab0?, {{0x140007a90c0, 0x1c}, {0x1024cd1b3, 0x6}, {0x14000651f68, 0x8}, {0x1024dc7e6, 0x9}, ...}, ...)
	github.com/snowflakedb/[email protected]/auth.go:439 +0x358
github.com/snowflakedb/gosnowflake.authenticate.func1()
	github.com/snowflakedb/[email protected]/auth.go:339 +0x74
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x14000af3ed0)
	github.com/snowflakedb/[email protected]/retry.go:310 +0x1a8
github.com/snowflakedb/gosnowflake.postAuthRestful({0x102de5a40?, 0x103dcba60?}, 0x1024e81de?, 0x140010213e8?, 0x14000af40c8?, 0x101ebed14?, 0x14000af4048?, 0x100ec2538?)
	github.com/snowflakedb/[email protected]/restful.go:199 +0xd8
github.com/snowflakedb/gosnowflake.postAuth({0x102de5a40, 0x103dcba60}, 0x14000c248f0, 0x8?, 0x140010213e8, 0x30?, 0x14000af4188?, 0x100eca600?)
	github.com/snowflakedb/[email protected]/auth.go:231 +0x2cc
github.com/snowflakedb/gosnowflake.authenticate({0x102de5a40, 0x103dcba60}, 0x140008aee40, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0})
	github.com/snowflakedb/[email protected]/auth.go:359 +0xf5c
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x140008aee40)
	github.com/snowflakedb/[email protected]/auth.go:553 +0x340
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x140007a9089, 0xf}, {0x140007a9080, 0x7}, {0x140007a9080, 0x0}, {0x0, ...}, ...})
	github.com/snowflakedb/[email protected]/driver.go:44 +0x118
github.com/snowflakedb/gosnowflake.SnowflakeDriver.Open({}, {0x140007a9080, 0xbb})
	github.com/snowflakedb/[email protected]/driver.go:27 +0xf8
github.com/luna-duclos/instrumentedsql.dsnConnector.Connect(...)
	github.com/luna-duclos/[email protected]/connector.go:53
github.com/luna-duclos/instrumentedsql.wrappedConnector.Connect({{{0x102dcb9a0, 0x102dba8b8}, {0x102dce760, 0x103dcba60}, 0x0, 0x0}, {0x102dd5058, 0x14000b233a0}, 0x14000640200}, {0x102de5a40?, ...})
	github.com/luna-duclos/[email protected]/connector.go:33 +0x188
database/sql.(*DB).conn(0x14000c24680, {0x102de5a40, 0x103dcba60}, 0x1)
	database/sql/sql.go:1387 +0x824
database/sql.(*DB).PingContext.func1(0xa0?)
	database/sql/sql.go:850 +0x40
database/sql.(*DB).retry(0x14000c285a0?, 0x14000af5048)
	database/sql/sql.go:1538 +0x4c
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x101d041a8]

goroutine 27 [running]:
crypto/rsa.(*PrivateKey).Public(...)
	crypto/rsa/rsa.go:122
database/sql.(*DB).PingContext(0x14000c24680, {0x102de5a40?, 0x103dcba60})
github.com/snowflakedb/gosnowflake.prepareJWTToken(0x14000df7000)
	database/sql/sql.go:849 +0x70
	github.com/snowflakedb/[email protected]/auth.go:476 +0x28
database/sql.(*DB).Ping(...)
	database/sql/sql.go:867
github.com/jmoiron/sqlx.Connect({0x10250c692?, 0x16?}, {0x140007a9080?, 0x140006401c0?})
	github.com/jmoiron/[email protected]/sqlx.go:642 +0x48
github.com/snowflakedb/gosnowflake.createRequestBody(0x14000741f80, 0x14000b6a000?, {{0x140007c5000, 0x1c}, {0x1022e51b3, 0x6}, {0x140006f3f68, 0x8}, {0x1022f47e6, 0x9}, ...}, ...)
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk.NewClient(0x140010bdc00?)
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk/client.go:152 +0xc4
	github.com/snowflakedb/[email protected]/auth.go:439 +0x358
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider.ConfigureProvider({0x1024cd1a1?, 0x6?}, 0x14000c0d890?)
github.com/snowflakedb/gosnowflake.authenticate.func1()
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/provider.go:555 +0x1f8
	github.com/snowflakedb/[email protected]/auth.go:339 +0x74
github.com/snowflakedb/gosnowflake.(*retryHTTP).execute(0x14000b47ed0)
	github.com/snowflakedb/[email protected]/retry.go:310 +0x1a8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0x1400103cea0, {0x102de5a78, 0x14000c0d890}, 0x14000f0f270)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:306 +0x1cc
github.com/snowflakedb/gosnowflake.postAuthRestful({0x102bfda40?, 0x103be3a60?}, 0x1023001de?, 0x1400008d740?, 0x14000b480c8?, 0x101cd6d14?, 0x14000b48048?, 0x100cda538?)
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0x14001029db8, {0x102de5a78?, 0x14000c0cbd0?}, 0x140007f1e60)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:611 +0x340
	github.com/snowflakedb/[email protected]/restful.go:199 +0xd8
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ConfigureProvider({{0x102dfe1d8?, 0x14001029db8?}}, {0x102de5a78?, 0x14000c0cbd0?}, 0x140007f1e00?)
	github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:86 +0x154
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ConfigureProvider(0x1400104ea10, {0x102de5a78?, 0x14000c0c8d0?}, 0x5?)
	github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ConfigureProvider.go:28 +0x110
github.com/snowflakedb/gosnowflake.postAuth({0x102bfda40, 0x103be3a60}, 0x14000b2b930, 0x8?, 0x1400008d740, 0x30?, 0x14000b48188?, 0x100ce2600?)
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0x14001034640, {0x102de5a78?, 0x14000c0c090?}, 0x1400068fa40)
	github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:558 +0x244
	github.com/snowflakedb/[email protected]/auth.go:231 +0x2cc
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x102d3e6a0?, 0x14001034640}, {0x102de5a78, 0x14000c0c090}, 0x14000e4b400, 0x0)
	github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:464 +0x164
github.com/snowflakedb/gosnowflake.authenticate({0x102bfda40, 0x103be3a60}, 0x14000741f80, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0})
	github.com/snowflakedb/[email protected]/auth.go:359 +0xf5c
google.golang.org/grpc.(*Server).processUnaryRPC(0x1400102c600, {0x102de5a78, 0x14000c0c000}, {0x102df9720, 0x140000e8780}, 0x14000b4d0e0, 0x14000b28780, 0x103cfb350, 0x0)
github.com/snowflakedb/gosnowflake.authenticateWithConfig(0x14000741f80)
	google.golang.org/[email protected]/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x1400102c600, {0x102df9720, 0x140000e8780}, 0x14000b4d0e0)
	github.com/snowflakedb/[email protected]/auth.go:553 +0x340
	google.golang.org/[email protected]/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 66
	google.golang.org/[email protected]/server.go:1030 +0x150
github.com/snowflakedb/gosnowflake.SnowflakeDriver.OpenWithConfig({}, {_, _}, {{0x140007c4fc9, 0xf}, {0x140007c4fc0, 0x7}, {0x140007c4fc0, 0x0}, {0x0, ...}, ...})
	github.com/snowflakedb/[email protected]/driver.go:44 +0x118
github.com/snowflakedb/gosnowflake.SnowflakeDriver.Open({}, {0x140007c4fc0, 0xbc})
	github.com/snowflakedb/[email protected]/driver.go:27 +0xf8
github.com/luna-duclos/instrumentedsql.dsnConnector.Connect(...)
	github.com/luna-duclos/[email protected]/connector.go:53
github.com/luna-duclos/instrumentedsql.wrappedConnector.Connect({{{0x102be39a0, 0x102bd28b8}, {0x102be6760, 0x103be3a60}, 0x0, 0x0}, {0x102bed058, 0x14000bc6a20}, 0x140006e2200}, {0x102bfda40?, ...})
	github.com/luna-duclos/[email protected]/connector.go:33 +0x188
database/sql.(*DB).conn(0x14000b2b6c0, {0x102bfda40, 0x103be3a60}, 0x1)
	database/sql/sql.go:1387 +0x824
database/sql.(*DB).PingContext.func1(0x30?)
	database/sql/sql.go:850 +0x40
database/sql.(*DB).retry(0x14000b40c30?, 0x14000b49048)
	database/sql/sql.go:1538 +0x4c
database/sql.(*DB).PingContext(0x14000b2b6c0, {0x102bfda40?, 0x103be3a60})
	database/sql/sql.go:849 +0x70
database/sql.(*DB).Ping(...)
	database/sql/sql.go:867
github.com/jmoiron/sqlx.Connect({0x102324692?, 0x16?}, {0x140007c4fc0?, 0x140006e21c0?})
	github.com/jmoiron/[email protected]/sqlx.go:642 +0x48
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk.NewClient(0x14000df6600?)
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk/client.go:152 +0xc4
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider.ConfigureProvider({0x1022e51a1?, 0x6?}, 0x14000b2df20?)
	github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/provider/provider.go:555 +0x1f8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Provider).Configure(0x140007413e0, {0x102bfda78, 0x14000b2df20}, 0x14000de5770)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/provider.go:306 +0x1cc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ConfigureProvider(0x14000ea2660, {0x102bfda78?, 0x14000b2d260?}, 0x14000698ea0)
	github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:611 +0x340
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ConfigureProvider({{0x102c161d8?, 0x14000ea2660?}}, {0x102bfda78?, 0x14000b2d260?}, 0x14000698e40?)
	github.com/hashicorp/[email protected]/tf5to6server/tf5to6server.go:86 +0x154
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ConfigureProvider(0x140006dc620, {0x102bfda78?, 0x14000b2cf60?}, 0x5?)
	github.com/hashicorp/[email protected]/tf6muxserver/mux_server_ConfigureProvider.go:28 +0x110
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ConfigureProvider(0x14000d305a0, {0x102bfda78?, 0x14000b2c720?}, 0x14000e99ac0)
	github.com/hashicorp/[email protected]/tfprotov6/tf6server/server.go:558 +0x244
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ConfigureProvider_Handler({0x102b566a0?, 0x14000d305a0}, {0x102bfda78, 0x14000b2c720}, 0x14000df3b00, 0x0)
	github.com/hashicorp/[email protected]/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:464 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x14000df6200, {0x102bfda78, 0x14000b2c690}, {0x102c11720, 0x140000e8780}, 0x14000b83b00, 0x14000b2c3c0, 0x103b13350, 0x0)
	google.golang.org/[email protected]/server.go:1369 +0xba0
google.golang.org/grpc.(*Server).handleStream(0x14000df6200, {0x102c11720, 0x140000e8780}, 0x14000b83b00)
	google.golang.org/[email protected]/server.go:1780 +0xc80
google.golang.org/grpc.(*Server).serveStreams.func2.1()
	google.golang.org/[email protected]/server.go:1019 +0x8c
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 15
	google.golang.org/[email protected]/server.go:1030 +0x150

Error: The terraform-provider-snowflake_v1.0.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.

Steps to Reproduce

Upgrade from 0.9.6 -> 1.0.2

with these changes:

How much impact is this issue causing?

High

Logs

No response

Additional Information

@@ -9,34 +9,38 @@ provider "snowflake" {
   alias = "ingest_role"
   role  = var.ingest_role
 
-  authenticator = "JWT"
+  authenticator = "SNOWFLAKE_JWT"
-  account = var.snowflake_account
+  organization_name = var.snowflake_organization_name
+  account_name = var.snowflake_account_name
 }
 
 provider "snowflake" {
   role = "ORGADMIN"
 
   alias         = "orgadmin"
-  authenticator = "JWT"
+  authenticator = "SNOWFLAKE_JWT"
-  account = var.snowflake_account
+  organization_name = var.snowflake_organization_name
+  account_name = var.snowflake_account_name
 }
 
 provider "snowflake" {
   role = "SECURITYADMIN"
 
   alias         = "securityadmin"
-  authenticator = "JWT"
+  authenticator = "SNOWFLAKE_JWT"
-  account = var.snowflake_account
+  organization_name = var.snowflake_organization_name
+  account_name = var.snowflake_account_name
 }
 
 provider "snowflake" {
   role = "SYSADMIN"
 
   alias         = "sysadmin"
-  authenticator = "JWT"
+  authenticator = "SNOWFLAKE_JWT"
-  account = var.snowflake_account
+  organization_name = var.snowflake_organization_name
+  account_name = var.snowflake_account_name
 }

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@joscha joscha added the bug Used to mark issues with provider's incorrect behavior label Jan 21, 2025
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @joscha 👋

It looks like the panic comes from reading the key in the driver, but in this case it's not set. How do you configure private_key in the provider? Also, please ensure var.snowflake_account_name and var.snowflake_organization_name are not empty.

Please note that OpenTofu is currently not supported.

@sfc-gh-jmichalak sfc-gh-jmichalak changed the title [Bug]: [Bug]: Configuration of the provider fails Jan 21, 2025
@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Jan 21, 2025
@sfc-gh-asawicki sfc-gh-asawicki added general-usage General help/usage questions and removed bug Used to mark issues with provider's incorrect behavior labels Jan 21, 2025
@joscha
Copy link
Contributor Author

joscha commented Jan 21, 2025

I removed the private_key definitions from the sample as I hadn't used them with 0.96.0 either.
The variables are definitely not empty.
Should it be panicking though or can we somehow improve on this so it will tell me expectations?

@sfc-gh-jmichalak
Copy link
Collaborator

You are using authenticator = "SNOWFLAKE_JWT" which requires private_key to be set. If you're not using the keys, what is your method of authentication?

@joscha
Copy link
Contributor Author

joscha commented Jan 21, 2025

If you're not using the keys, what is your method of authentication?

    export SNOWFLAKE_USER="xxx";
    export SNOWFLAKE_PRIVATE_KEY_PATH="~/.ssh/xxx.p8";
    export SNOWFLAKE_PRIVATE_KEY_PASSPHRASE="xxx";

@sfc-gh-jmichalak sfc-gh-jmichalak added the category:migration Issues connected with migration to v1.0.0. label Jan 21, 2025
@sfc-gh-jmichalak
Copy link
Collaborator

SNOWFLAKE_PRIVATE_KEY_PATH has been removed in v1 in favor of SNOWFLAKE_PRIVATE_KEY. We have adjusted the examples recently. Please use something like export SNOWFLAKE_PRIVATE_KEY=$(cat ~/.ssh/xxx.p8). If you have any further issues, please take a look at the following:

We plan to improve the documentation by grouping all of such issues regarding private keys, and providing more examples, like in #3332 (comment).

Regarding the panics, this has been fixed in snowflakedb/gosnowflake#1285, but it needs to be released in gosnowflake, and then upgraded on our side.

@joscha
Copy link
Contributor Author

joscha commented Jan 21, 2025

Ah great, this worked, thank you, sorry I didn't connect the two things together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:migration Issues connected with migration to v1.0.0. category:provider_config general-usage General help/usage questions
Projects
None yet
Development

No branches or pull requests

3 participants