-
Notifications
You must be signed in to change notification settings - Fork 427
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]: Possible bug in Snowflake provider: No schema available for snowflake_role_grants while reading state #2989
Comments
Hi, @jamiekt 👋 These errors occur, because in the newer version old grant resources are removed and Terraform can't find schema definitions for them. Unfortunately, Terraform does not provide a way to automatically migrate between two different resources, so it needs to be done manually. Please check resource migration which has an example of migrating a grant (although a different one). We listed a few ways to migrate from deprecated resources, so pick one that suits you the most :) Please note that upgrading almost 30 versions at once may be error-prone, and we suggest taking a more granular approach here. |
Thank you @sfc-gh-jmichalak . That seems to be a bit of a failing in terraform :( |
I've used an earlier version of the provider (0.92.0) which includes definitions of the removed and newly created resources and now the errors no longer appear 👍 |
Hello @jamiekt |
Hi @paul-marrand-hublo 👋 Please take a look at the migration guide (esp. grant removal entry). We write about all breaking changes there to ensure smoother migrations. We advise migrating versions gradually one by one. |
Might be worth skipping straight to the "Steps to reproduce" at the bottom rather than read all the text here at the top!
Terraform CLI Version
1.9.3
Terraform Provider Version
0.94.1
Terraform Configuration
I am trying to upgrade provider version and am getting errors when I do so:
The error states that it is a bug in terraform but I am skeptical that that is actually the case as I shall now explain.
I am trying to upgrade provider version and am getting errors when I do so:
The error states that it is a bug in terraform but I am skeptical that that is actually the case as I shall now explain.
I have 14 errors of the form:
8 of the errors are for resource type
snowflake_account_grant
5 of the errors are for resource type
snowflake_grant_privileges_to_role
1 of the errors is for resource type
snowflake_role_grants
that I am getting when running
terraform plan
. However, immediately prior to that there are 14 warnings in the plan of the form:8 of the warnings are for resource type
snowflake_account_grant
5 of the warnings are for resource type
snowflake_grant_privileges_to_role
1 of the warnings is for resource type
snowflake_role_grants
The change that I am making is to remove:
snowflake_account_grant
snowflake_grant_privileges_to_role
snowflake_role_grants
The reason I am removing them is that I am trying to upgrade the provider to the most recent version, 0.94.1, from a much older version, 0.68.2.
and in version 0.93.0 those resource types have been removed, in line with your announcement at #2736
Hence I have removed code like this:
and replaced it with
The warning
Makes me think that this is a problem with the provider rather than a bug in terraform which is what the error suggests.
Category
category:other
Object type(s)
No response
Expected Behavior
Actual Behavior
Plan fails with
Steps to Reproduce
var.snowflake_account
,var.snowflake_region
,var.snowflake_user
,var.snowflake_private_key
,var.snowflake_user_being_granted_a_role
:terraform init
which should return:terraform apply
while building this repro I've realised its nothing to do with the
import
block. Simply removing theresource
block is sufficient to repro the problem.terraform init --upgrade
terraform plan
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
No response
Would you like to implement a fix?
The text was updated successfully, but these errors were encountered: