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

Stack trace from the terraform-provider-snowflake_v0.82.0.exe plugin:panic: interface conversion: sdk.ObjectIdentifier is sdk.AccountObjectIdentifier, not sdk.SchemaObjectIdentifier #2309

Closed
pmaganti11 opened this issue Dec 29, 2023 · 8 comments
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@pmaganti11
Copy link

Terraform CLI and Provider Versions

Error: Request cancelled

│ The plugin6.(*GRPCProvider).ValidateResourceConfig request was cancelled.

Stack trace from the terraform-provider-snowflake_v0.82.0.exe plugin:

panic: interface conversion: sdk.ObjectIdentifier is sdk.AccountObjectIdentifier, not sdk.SchemaObjectIdentifier

goroutine 56 [running]:
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.CreateStream(0xc136870, {0x2454240, 0xc88de60})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/stream.go:132 +0x17bc
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc3ba310, {0x27a4828, 0xc973020}, 0xc136870, {0x2454240, 0xc88de60})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource.go:766 +0x164
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc3ba310, {0x27a4828, 0xc973020}, 0xc878bd0, 0xc136690, {0x2454240, 0xc88de60})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/resource.go:909 +0xaa2
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc513c10, {0x27a4828, 0xc972f78}, 0xc3d9ef0)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.31.0/helper/schema/grpc_provider.go:1074 +0xf46
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ApplyResourceChange({{0x27ae128, 0xc513c10}}, {0x27a4828, 0xc972f78}, 0xc3d9ec0)
github.com/hashicorp/terraform-plugin-mux@v0.13.0/tf5to6server/tf5to6server.go:37 +0x4b
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ApplyResourceChange(0xc6e5cc0, {0x27a4828, 0xc972ea0}, 0xc3d9ec0)
github.com/hashicorp/terraform-plugin-mux@v0.13.0/tf6muxserver/mux_server_ApplyResourceChange.go:36 +0x1df
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc4d2780, {0x27a4828, 0xc90c120}, 0xc6d20c0)
github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov6/tf6server/server.go:857 +0x582
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x2426ba0, 0xc4d2780}, {0x27a4828, 0xc90c120}, 0xc6d2080, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.20.0/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:503 +0x176
google.golang.org/grpc.(*Server).processUnaryRPC(0xc14cdc0, {0x27a4828, 0xc90c0f0}, {0x27acbd4, 0xc084600}, 0xc0900a0, 0xc4f4048, 0x3570eec, 0x0)
google.golang.org/grpc@v1.60.0/server.go:1372 +0xf6a
google.golang.org/grpc.(*Server).handleStream(0xc14cdc0, {0x27acbd4, 0xc084600}, 0xc0900a0)
google.golang.org/grpc@v1.60.0/server.go:1783 +0x10d0
google.golang.org/grpc.(*Server).serveStreams.func2.1()
google.golang.org/grpc@v1.60.0/server.go:1016 +0x6f
created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 40
google.golang.org/grpc@v1.60.0/server.go:1027 +0x123

Error: The terraform-provider-snowflake_v0.82.0.exe 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.

Terraform Configuration

terraform {
  required_providers {
    snowflake = {
      source = "Snowflake-Labs/snowflake"
      version = "0.82.0"
    }
  }
}

Expected Behavior

Create Snowflake resources

Actual Behavior

Terraform Apply is failing

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@pmaganti11 pmaganti11 added the bug Used to mark issues with provider's incorrect behavior label Dec 29, 2023
@pmaganti11
Copy link
Author

not able to create tables but not views, streams , tasks or constraints
resource "snowflake_task" "summers_item_table_update_task" {
name = "SUMMERS_ITEM_TABLE_UPDATE_TASK"
warehouse = ""
database = ""
schema = ""
schedule = "30 MINUTE"
when = "SYSTEM$STREAM_HAS_DATA"
sql_statement = <<-EOT

EOT

@sfc-gh-asawicki
Copy link
Collaborator

Hey @pmaganti11. Thanks for creating the issue.

Please provide the simplified configuration you are using that causes the error (from the log you attached, I presume you are creating a stream resource, but we have to see the configuration to help you).

@pmaganti11
Copy link
Author

resource "snowflake_stream" "DIM_TRANSACTION_LINES_STREAM" {
name = "DIM_TRANSACTION_LINES_STREAM"
database = ""
schema = ""
on_table = "TRANSACTION_LINES"
}
This is my stream

@sfc-gh-asawicki
Copy link
Collaborator

@pmaganti11, you should fully qualify the table name, so:

on_table = "your_database.your_schema.your_table"

or

on_table = "\"your_database\".\"your_schema\".\"your_table\""

(in this case, we allow both escaped and unescaped).

One other thing: are you removing database and schema from the presented output, or are these really empty?

@pmaganti11
Copy link
Author

@pmaganti11, you should fully qualify the table name, so:

on_table = "your_database.your_schema.your_table"

or

on_table = "\"your_database\".\"your_schema\".\"your_table\""

(in this case, we allow both escaped and unescaped).

One other thing: are you removing database and schema from the presented output, or are these really empty?

I have tried with fully qualified name and still the plugin is crashing
resource "snowflake_stream" "DIM_TRANSACTION_LINES_STREAM" {
name = "DIM_TRANSACTION_LINES_STREAM"
database = "TETON_DATABASE_AZURE"
schema = "NETSUITE"
on_table = "TETON_DATABASE_AZURE.NETSUITE.TRANSACTION_LINES"
}
I am nor removing Db and schema, they are not having any streams now

@sfc-gh-asawicki
Copy link
Collaborator

@pmaganti11, please provide the error log after you changed it to the fully qualified name (if the plugin still crashes, it should have a different stack trace).

@sfc-gh-asawicki
Copy link
Collaborator

@pmaganti11, do you have any updates on this?

@sfc-gh-asawicki
Copy link
Collaborator

Hey @pmaganti11, I will close this issue; please open a new one if you are still experiencing this problem in the more recent versions of the provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to mark issues with provider's incorrect behavior
Projects
None yet
Development

No branches or pull requests

2 participants