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

Error: The terraform-provider-snowflake_v0.81.0 plugin crashed! #2299

Closed
juliankeppel opened this issue Dec 21, 2023 · 2 comments
Closed

Error: The terraform-provider-snowflake_v0.81.0 plugin crashed! #2299

juliankeppel opened this issue Dec 21, 2023 · 2 comments
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@juliankeppel
Copy link

juliankeppel commented Dec 21, 2023

Terraform CLI and Provider Versions

Terraform 1.5.7
Provider 0.81.0

Terraform Configuration

terraform {
  backend "local" {
    path = "terraform.tfstate"
  }

required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "~> 0.81"
    }
  }
}

import {
  to = snowflake_database.staging_db
  id = "STAGING"
}

import {
  to = snowflake_schema.staging_common
  id = "STAGING.COMMON"
}

resource "snowflake_database" "staging_db" {
  provider     = snowflake.sysadmin
  name         = "STAGING"
  is_transient = false
}

resource "snowflake_schema" "staging_common" {
  provider     = snowflake.sysadmin
  database     = snowflake_database.staging_db.name
  name         = "COMMON"
  is_managed   = true
  is_transient = false
}

Expected Behavior

Already existing schema should be imported correctly. For the database it worked fine.

Actual Behavior

Stack trace from the terraform-provider-snowflake_v0.81.0 plugin:

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

goroutine 37 [running]:
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadSchema(0x14000f90300, {0x103f2c820?, 0x14000becc30?})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/schema.go:108 +0x780
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).read(0x103f6e018?, {0x103f6e018?, 0x14000baf710?}, 0xd?, {0x103f2c820?, 0x14000becc30?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/resource.go:783 +0x134
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).RefreshWithoutUpgrade(0x14000b19b20, {0x103f6e018, 0x14000baf710}, 0x140008565b0, {0x103f2c820, 0x14000becc30})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/resource.go:1089 +0x430
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ReadResource(0x14000ab8210, {0x103f6e018?, 0x14000baf4d0?}, 0x14000055b80)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.30.0/helper/schema/grpc_provider.go:661 +0x3e4
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ReadResource({{0x103f82c78?, 0x14000ab8210?}}, {0x103f6e018?, 0x14000baf4d0?}, 0x14000055980?)
github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf5to6server/tf5to6server.go:119 +0x228
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ReadResource(0x103f6e050?, {0x103f6e018?, 0x14000baec60?}, 0x14000055980)
github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf6muxserver/mux_server_ReadResource.go:35 +0x184
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ReadResource(0x140008ebc20, {0x103f6e018?, 0x14000bae480?}, 0x14000ab4e40)
github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov6/tf6server/server.go:787 +0x390
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ReadResource_Handler({0x103ed3300?, 0x140008ebc20}, {0x103f6e018, 0x14000bae480}, 0x14000f90000, 0x0)
github.com/hashicorp/terraform-plugin-go@v0.19.1/tfprotov6/internal/tfplugin6/tfplugin6_grpc.pb.go:431 +0x164
google.golang.org/grpc.(*Server).processUnaryRPC(0x140000ccd20, {0x103f6e018, 0x14000bae3f0}, {0x103f7e300, 0x14000602820}, 0x1400056c120, 0x14000baf5c0, 0x104dcea08, 0x0)
google.golang.org/grpc@v1.59.0/server.go:1343 +0xb8c
google.golang.org/grpc.(*Server).handleStream(0x140000ccd20, {0x103f7e300, 0x14000602820}, 0x1400056c120)
google.golang.org/grpc@v1.59.0/server.go:1737 +0x990
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.59.0/server.go:986 +0x88
created by google.golang.org/grpc.(*Server).serveStreams.func1 in goroutine 22
google.golang.org/grpc@v1.59.0/server.go:997 +0x160

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

Steps to Reproduce

  1. terraform apply or terraform plan

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

@juliankeppel juliankeppel added the bug Used to mark issues with provider's incorrect behavior label Dec 21, 2023
@sfc-gh-asawicki
Copy link
Collaborator

Hey @juliankeppel. Thanks for reporting the issue.

Could you please try the ID conforming with the docs: https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs/resources/schema#import? (in this case "STAGING|COMMON")

@juliankeppel
Copy link
Author

@sfc-gh-asawicki Oh yes, I'm sorry. I overlooked that and it's a little bit unintuitive. But I'm sure it has it's reasons!

Thank you for this very quick response!

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