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

“Provider <> planned an invalid value” for task resource while upgrading from 0.47.0 to 0.80.0 #2289

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

Comments

@LukLight
Copy link

Terraform CLI and Provider Versions

Terraform CLI: 1.0.9
Snowflake-Labs/snowflake Version: upgrading from 0.47.0 -> 0.80.0

Terraform Configuration

resource snowflake_task task_xyz {
  comment = "xyz"
  database = "database_xyz"
  schema = "schema_xyz"
  name = "xyz"
  schedule = "USING CRON 0 0/2 * * * UTC"
  enabled = true
  user_task_managed_initial_warehouse_size = "XSMALL"
  sql_statement = "xyz"
}

Expected Behavior

As we did not change anything on our resources during the upgrade to version 0.80.0, we expected a Terraform plan (& Terraform apply) without any change.

Actual Behavior

Error Log form DevOps Pipeline:

Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task. task_xyz.error_integration:
│ planned value cty.StringVal("") for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task. task_xyz.allow_overlapping_execution:
│ planned value cty.False for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task.task_xyz.after:
│ planned value cty.ListValEmpty(cty.String) for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task.task_xyz.warehouse:
│ planned value cty.StringVal("") for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task.task_xyz.when:
│ planned value cty.StringVal("") for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.


│ Error: Provider produced invalid plan

│ Provider "registry.terraform.io/snowflake-labs/snowflake" planned an
│ invalid value for
│ module.account_usage.snowflake_task.task_xyz.session_parameters:
│ planned valu_e cty.MapValEmpty(cty.String) for a non-computed attribute.

│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.

=> Hence, for all configuration parameters which we did not use in our resource befor the upgrade, we got an error.

We tried to work around this by including non-conflicting, missing attributes into the resource configuration like this:

resource snowflake_task task_xyz {
  comment = "xyz"
  database = "database_xyz"
  schema = "schema_xyz"
  name = "xyz"
  schedule = "USING CRON 0 0/2 * * * UTC"
  enabled = true
  user_task_managed_initial_warehouse_size = "XSMALL"
  sql_statement = "xyz"

  when = ""
  # after = []
  # warehouse = ""
  error_integration = ""
  allow_overlapping_execution = false
  session_parameters = {}
}

As expected, we only are left with the above error for parameter “warehouse” and “after” which we can not resolve like this due to being conflicting with other parameters.

According to the resource code and documentation those parameters should all be optional and we should not get any error when upgrading the provider only.

Steps to Reproduce

  1. terraform init (using constraint on provider version 0.47.0)
  2. terraform plan
  3. terraform apply
  4. terraform init -upgrade (without constraint on provider version => upgrade to version 0.80.0)
  5. terraform plan

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

The root cause might be related to the terraform version instead of the Snowflake provider (see links).
It would be useful to know, whether there is a specific terraform version requirement when using the Snowflake provider.

https://gitlab.com/gitlab-org/terraform-provider-gitlab/-/issues/1394
https://discuss.hashicorp.com/t/plan-failures-with-terraform-1-5-0-and-framework-1-2-0/54961
https://github.com/hashicorp/terraform/releases/tag/v1.5.1

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

Hey @LukLight. Thanks for reporting the issue.

You are right, please first bump the Terraform CLI you are using to at least 1.1.5 (but the newest possible is preferable).

We don't have a compatibility matrix yet, but we have it on our roadmap.

@LukLight
Copy link
Author

Hi @sfc-gh-asawicki,

Many thanks for the fast feedback!
We upgraded our Terraform CLI and this solved the issue :)

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