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

The terraform-provider-snowflake_v0.71.0 plugin crashed - user creation. #2070

Closed
thomasyu888 opened this issue Sep 25, 2023 · 6 comments
Closed
Labels
bug Used to mark issues with provider's incorrect behavior category:identifiers

Comments

@thomasyu888
Copy link

thomasyu888 commented Sep 25, 2023

Provider Version

Terraform cloud v1.5.7

Terraform Version

v0.71.0

Describe the bug

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

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

goroutine 96 [running]:
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.ReadUser(0xc0009f7480, {0x1ac3660?, 0xc000b4ab60?})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/user.go:244 +0x96a
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.CreateUser(0x0?, {0x1ac3660?, 0xc000b4ab60?})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/user.go:236 +0xbc8
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x1ddd1a0?, {0x1ddd1a0?, 0xc0002e5b60?}, 0xd?, {0x1ac3660?, 0xc000b4ab60?})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:695 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00063dea0, {0x1ddd1a0, 0xc0002e5b60}, 0xc0001f92b0, 0xc0009f7300, {0x1ac3660, 0xc000b4ab60})
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/resource.go:837 +0xa85
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc0009b3c50, {0x1ddd1a0?, 0xc0002e5a40?}, 0xc0002ea0f0)
github.com/hashicorp/terraform-plugin-sdk/[email protected]/helper/schema/grpc_provider.go:1021 +0xe8d
github.com/hashicorp/terraform-plugin-go/tfprotov5/tf5server.(*server).ApplyResourceChange(0xc00027f040, {0x1ddd1a0?, 0xc0002e5050?}, 0xc000b3a2a0)
github.com/hashicorp/[email protected]/tfprotov5/tf5server/server.go:818 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5._Provider_ApplyResourceChange_Handler({0x1a75c80?, 0xc00027f040}, {0x1ddd1a0, 0xc0002e5050}, 0xc000b3a230, 0x0)
github.com/hashicorp/[email protected]/tfprotov5/internal/tfplugin5/tfplugin5_grpc.pb.go:385 +0x170
google.golang.org/grpc.(*Server).processUnaryRPC(0xc0007fcb40, {0x1decb60, 0xc000581860}, 0xc0009ee240, 0xc0009bd4a0, 0x2a34400, 0x0)
google.golang.org/[email protected]/server.go:1336 +0xd33
google.golang.org/grpc.(*Server).handleStream(0xc0007fcb40, {0x1decb60, 0xc000581860}, 0xc0009ee240, 0x0)
google.golang.org/[email protected]/server.go:1704 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.2()
google.golang.org/[email protected]/server.go:965 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/[email protected]/server.go:963 +0x28a

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

Expected behavior

The plugin failing on terraform cloud, but the user was created

Code samples and commands

....

provider "snowflake" {
  account = var.snowflake_account
  username = var.snowflake_user
  password = var.snowflake_pwd
  role = "SYSADMIN"
}

provider "snowflake" {
  alias = "useradmin"
  account = var.snowflake_account
  username = var.snowflake_user
  password = var.snowflake_pwd
  role = "USERADMIN"
}

resource "snowflake_user" "user" {
  provider = snowflake.useradmin
  name         = "user@..."
  login_name   = "user@..."
}
@thomasyu888 thomasyu888 added the bug Used to mark issues with provider's incorrect behavior label Sep 25, 2023
@thomasyu888
Copy link
Author

This seems to be a duplicate of #2058 . I used an older version as well and it worked

@sfc-gh-asawicki
Copy link
Collaborator

Hey @thomasyu888. Thanks for creating the issue.

Can you confirm that the solution described in #2058 works for you? Do you see this error in the newest provider version?

@sfc-gh-asawicki
Copy link
Collaborator

@thomasyu888, do you have any updates?

@thomasyu888
Copy link
Author

Hi @sfc-gh-asawicki ,

Thanks for providing an update - I will try to take a look soon.

@sfc-gh-asawicki
Copy link
Collaborator

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

@thomasyu888
Copy link
Author

thomasyu888 commented Feb 16, 2024

Thanks! Sorry about the delays - I haven't been able to test this, but will open a ticket if needed

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 category:identifiers
Projects
None yet
Development

No branches or pull requests

3 participants