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

Snowpipes - terraform-provider-snowflake_v0.76.0 plugin: (FILE FORMAT) #2224

Closed
messi198310 opened this issue Nov 29, 2023 · 2 comments
Closed
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@messi198310
Copy link

messi198310 commented Nov 29, 2023

Terraform CLI and Provider Versions

terraform-provider-snowflake_v0.76.0 plugin:

Terraform Configuration

resource "snowflake_grant_privileges_to_role" "file_format_grant" {
provider = snowflake.security_admin
privileges = ["USAGE"]
role_name = var.roles["raw_admin"].name
on_schema_object {
object_type = "FILE FORMAT"
object_name = snowflake_file_format.dynamodb_json_format.name
}
}

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-snowflake_v0.76.0 plugin:

panic: runtime error: index out of range [1] with length 1

goroutine 44 [running]:
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk.NewSchemaObjectIdentifierFromFullyQualifiedName({0xc000d4e390?, 0xc000addfb0?})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/sdk/identifier_helpers.go:206 +0x46a
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.configureAccountRoleGrantPrivilegeOptions(0xc000afc0a0?, {0xc000aeae80, 0x1, 0x1}, 0x1?, 0xc0009c6cf0)
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/grant_privileges_to_role.go:746 +0xd85
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources.CreateGrantPrivilegesToRole(0x0?, {0x1ced480?, 0xc000a60dd0?})
github.com/Snowflake-Labs/terraform-provider-snowflake/pkg/resources/grant_privileges_to_role.go:456 +0x1ad
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0x2054060?, {0x2054060?, 0xc000ac19e0?}, 0xd?, {0x1ced480?, 0xc000a60dd0?})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:766 +0x178
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc00060d5e0, {0x2054060, 0xc000ac19e0}, 0xc000a53e10, 0xc000a4a400, {0x1ced480, 0xc000a60dd0})
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/resource.go:909 +0xa7e
github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*GRPCProviderServer).ApplyResourceChange(0xc000736588, {0x2054060?, 0xc000ac1800?}, 0xc000ac8370)
github.com/hashicorp/terraform-plugin-sdk/v2@v2.29.0/helper/schema/grpc_provider.go:1060 +0xe8d
github.com/hashicorp/terraform-plugin-mux/tf5to6server.v5tov6Server.ApplyResourceChange({{0x2073560?, 0xc000736588?}}, {0x2054060, 0xc000ac1800}, 0x0?)
github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf5to6server/tf5to6server.go:37 +0x5a
github.com/hashicorp/terraform-plugin-mux/tf6muxserver.(*muxServer).ApplyResourceChange(0x2053fb8?, {0x2054060?, 0xc000ac14d0?}, 0xc000ac8320)
github.com/hashicorp/terraform-plugin-mux@v0.12.0/tf6muxserver/mux_server_ApplyResourceChange.go:36 +0x1b5
github.com/hashicorp/terraform-plugin-go/tfprotov6/tf6server.(*server).ApplyResourceChange(0xc00082a000, {0x2054060?, 0xc000ac0cc0?}, 0xc000a84540)
github.com/hashicorp/terraform-plugin-go@v0.19.0/tfprotov6/tf6server/server.go:857 +0x574
github.com/hashicorp/terraform-plugin-go/tfprotov6/internal/tfplugin6._Provider_ApplyResourceChange_Handler({0x1c998c0?, 0xc00082a000}, {0x2054060, 0xc000ac0cc0}, 0xc000a844d0, 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(0xc00053f2c0, {0x2063ec0, 0xc0009e0000}, 0xc000ac6480, 0xc00095ef30, 0x2d7e8d8, 0x0)
google.golang.org/grpc@v1.58.2/server.go:1376 +0xdd2
google.golang.org/grpc.(*Server).handleStream(0xc00053f2c0, {0x2063ec0, 0xc0009e0000}, 0xc000ac6480, 0x0)
google.golang.org/grpc@v1.58.2/server.go:1753 +0xa36
google.golang.org/grpc.(*Server).serveStreams.func1.1()
google.golang.org/grpc@v1.58.2/server.go:998 +0x98
created by google.golang.org/grpc.(*Server).serveStreams.func1
google.golang.org/grpc@v1.58.2/server.go:996 +0x18c

Error: The terraform-provider-snowflake_v0.76.0 plugin crashed!

@messi198310 messi198310 added the bug Used to mark issues with provider's incorrect behavior label Nov 29, 2023
@messi198310 messi198310 changed the title Snowpipes - terraform-provider-snowflake_v0.76.0 plugin: Snowpipes - terraform-provider-snowflake_v0.76.0 plugin: (FILE FORMAT) Nov 30, 2023
@sfc-gh-jcieslak
Copy link
Collaborator

@messi198310
Hey 👋
It seems like the identifier at object_name = snowflake_file_format.dynamodb_json_format.name is invalid.

Here, we expect a fully qualified name with 3 parts "database_name"."schema_name"."schema_object" and it seems like there's only one part (I'm guessing "schema_object").

When specifying IDs with quotes in HCL remember to escape the string like this:
object_name = "\"database_name\".\"schema_name\".\"schema_object\""
or if all of the identifiers are case insensitive you can omit the quotes like this:
object_name = "database_name.schema_name.schema_object"

It depends on your setup, but making the identifier fully qualified should resolve the issue.
If that's the case, please let me know.

@sfc-gh-jcieslak sfc-gh-jcieslak self-assigned this Nov 30, 2023
@messi198310
Copy link
Author

@messi198310 Hey 👋 It seems like the identifier at object_name = snowflake_file_format.dynamodb_json_format.name is invalid.

Here, we expect a fully qualified name with 3 parts "database_name"."schema_name"."schema_object" and it seems like there's only one part (I'm guessing "schema_object").

When specifying IDs with quotes in HCL remember to escape the string like this: object_name = "\"database_name\".\"schema_name\".\"schema_object\"" or if all of the identifiers are case insensitive you can omit the quotes like this: object_name = "database_name.schema_name.schema_object"

It depends on your setup, but making the identifier fully qualified should resolve the issue. If that's the case, please let me know.

Thanks @sfc-gh-jcieslak - much appreciated. What a silly mistake..

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