-
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
snowflake_stage recreates every apply regardless of an actual change #2679
Comments
Hey @bmhah. Thanks for reaching out to us. Please share the terraform run logs with |
Here is the file that the customer provided me. plan.txt.gz |
Any updates here? |
Hey @bmhah. I will confirm in the morning, but it looks like an easy fix, so we may even be able to include it in tomorrow's release. I will keep you posted. |
🤖 I have created a release *beep* *boop* --- ## [0.89.0](v0.88.0...v0.89.0) (2024-04-18) ### 🎉 **What's new:** * Update target objects for privilege-granting resources ([#2688](#2688)) ([74e2b6b](74e2b6b)) ### 🔧 **Misc** * Handle generic check destroy in acceptance tests ([#2716](#2716)) ([63a5324](63a5324)) * Initialize the SDK client in fewer places ([#2710](#2710)) ([382bfc1](382bfc1)) ### 🐛 **Bug fixes:** * Adds case statement for ObjectTypeUser in ShowObjectParameter. ([#2675](#2675)) ([23a3341](23a3341)) * diffs always occurring when multiple columns exist ([#2686](#2686)) ([3275ad4](3275ad4)) * Fix issues [#2679](#2679) [#2721](#2721) ([#2723](#2723)) ([b0c9dd4](b0c9dd4)) * Fix several small issues ([#2697](#2697)) ([e3f6a15](e3f6a15)) * granting ownership on database roles ([#2703](#2703)) ([88944e7](88944e7)) * network policy update ([#2647](#2647)) ([8126b28](8126b28)) * Rename grants_redesign_desgin_decisions.md to grants_redesign_design_… ([#2691](#2691)) ([5000b2b](5000b2b)) * renames in update operations ([#2702](#2702)) ([793c879](793c879)) * showbyid method tests ([#2648](#2648)) ([ff5e617](ff5e617)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: snowflake-release-please[bot] <105954990+snowflake-release-please[bot]@users.noreply.github.com>
Hey @bmhah. We have released the new version: https://github.com/Snowflake-Labs/terraform-provider-snowflake/releases/tag/v0.89.0. Please bump and check if the error persists. Please remember to use the migration guide during version upgrades: https://github.com/Snowflake-Labs/terraform-provider-snowflake/blob/main/MIGRATION_GUIDE.md#migration-guide. |
Sounds good, we'll get to testing this later this week. I'll keep this issue open in the meantime |
Hey @bmhah. Have you have a chance to test the newer versions after the introduced fixes? |
Yes, we've done the provider upgrade to 88 and have also used others, they haven't worked for us, the stage for this pipe still drops and recreates causing the pipe to break again |
The fix was introduced in 0.89, not 0.88, so please provide the config and logs (run terraform with TF_LOG=DEBUG) on the 0.89+ version (I could not reproduce the issue given your config on the 0.89 version). |
We were having the same issue with:
Fix in #2885 |
We are getting permadiff on stage `file_format` parameter when it contains quotes, as it used to be the case with `copy_options` (see #2679) To fix it, re-using the same `DiffSuppressFunc` seems to do the trick. ## Test Plan * [x] acceptance tests * [x] locally built tested
The fix was included in v0.93.0. Please check it @guillaumelecerf @bmhah. |
Hey @sfc-gh-asawicki. terraform configuration resource "snowflake_stage" "stage" {
database = "DATABASE_NAME"
file_format = "TYPE = CSV NULL_IF = []"
name = "NAME"
schema = "SCHEMA_NAME"
storage_integration = "INTEGRATION_NAME"
url = "s3://aaaaa"
} |
I will take a look this week. Thanks for providing the config; it helps reproduce the issues. |
Hi @sfc-gh-asawicki. |
Hey @harukitake. Sorry, I missed this one, I will check it this week. |
Hey @harukitake. I've finally reproduced the error. The current implementation of the stage resource filters out all the file format properties that have default values in Snowflake. TYPE = CSV is the default value, so after reading the resource's state, it is programmatically removed from the file format string, which causes the permadiff you see. This is, of course, not the expected behavior. For now, please just remove TYPE = CSV from your config, because this is the default in Snowflake. We will fix the handling of these parameters during the stage resource rework in the next few weeks. I have added a test to confirm it and the note in the resource documentation. |
Terraform CLI and Provider Versions
v1.5.0
0.85.0
Terraform Configuration
Expected Behavior
Stage doesn't destroy and recreate
Actual Behavior
Stage recreates, this causes snowflake pipes to break having a status
STOPPED_STAGE_DROPPED
Steps to Reproduce
terraform apply
How much impact is this issue causing?
High
Logs
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: