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

[Bug]: snowflake_account resource error due to 2024_06 bundle change #3016

Closed
1 task
sbrudz opened this issue Aug 27, 2024 · 9 comments
Closed
1 task

[Bug]: snowflake_account resource error due to 2024_06 bundle change #3016

sbrudz opened this issue Aug 27, 2024 · 9 comments
Assignees
Labels
bug Used to mark issues with provider's incorrect behavior

Comments

@sbrudz
Copy link

sbrudz commented Aug 27, 2024

Terraform CLI Version

1.8.5

Terraform Provider Version

0.94.1

Terraform Configuration

terraform {
  required_version = "1.8.5"
}

terraform {
  required_providers {
    snowflake = {
      source  = "Snowflake-Labs/snowflake"
      version = "0.94.1"
    }
  }
}

variable "snowflake_org_user" {
  type = string
}

variable "snowflake_org_account" {
  type = string
}

variable "admin_password" {
  type      = string
  sensitive = true
}

provider "snowflake" {
  user          = var.snowflake_org_user
  account       = var.snowflake_org_account
  role          = "ORGADMIN"
}

resource "snowflake_account" "this" {
  name           = "BUG_TEST"
  admin_name     = "TEST_ADMIN"
  admin_password = var.admin_password
  email          = "test@xample.com"
  comment        = "Managed by Terraform"
  edition        = "STANDARD"
}

Category

category:sdk

Object type(s)

resource:account

Expected Behavior

Running terraform apply on the above configuration and confirming the plan should create a new account and complete without error.

Actual Behavior

As of 8/27, when I run terraform apply and confirm the plan, I get the following error:

Error: giving up after 5 attempts
 
  with snowflake_account.this,
  on main.tf line 33, in resource "snowflake_account" "this":
  33: resource "snowflake_account" "this" {

The account does get created, but the state isn't saved because of the error.

Steps to Reproduce

To reproduce the error:

  1. Run SELECT SYSTEM$SHOW_ACTIVE_BEHAVIOR_CHANGE_BUNDLES(); to check that the 2024_06 bundle is enabled in your account. If not, run SELECT SYSTEM$ENABLE_BEHAVIOR_CHANGE_BUNDLE('2024_06');
  2. Run the provided code as a user with the org_admin role
  3. Run terraform apply and confirm the plan

How much impact is this issue causing?

Medium

Logs

https://gist.github.com/sbrudz/363aedc61c209e86958e67d2aad3350a

Additional Information

The 2024_06 bundle became enabled by default on August 26-27. This bundle changes the behavior of the SHOW ORGANIZATION ACCOUNTS command.

The workaround is to disable the 2024_06 bundle:

SELECT SYSTEM$DISABLE_BEHAVIOR_CHANGE_BUNDLE('2024_06');

It seems like this could be fixed by using SHOW ACCOUNTS instead of SHOW ORGANIZATION ACCOUNTS within the Accounts SDK.

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@sbrudz sbrudz added the bug Used to mark issues with provider's incorrect behavior label Aug 27, 2024
@sfc-gh-jcieslak
Copy link
Collaborator

Hey @sbrudz 👋
Thank you for reporting this issue. I'll change the SHOW command to the newer one. The fix should be present in the newest release.

@sbrudz
Copy link
Author

sbrudz commented Aug 28, 2024

Excellent! Thank you, @sfc-gh-jcieslak!

@sfc-gh-jcieslak sfc-gh-jcieslak self-assigned this Aug 28, 2024
@marcofunaro
Copy link

@sfc-gh-jcieslak thanks for the prompt response!

As far as you know, is there an official policy to align the release of this provider with the official Snowflake releases? I'm creating an internal process around Snowflake updates.

@sfc-gh-asawicki
Copy link
Collaborator

Hey @marcofunaro. You are right, there is no alignment currently. We will discuss the release's cadence after reaching a stable V1.

@marcofunaro
Copy link

do you want me to open an issue for tracking purposes?

@asafcyclops
Copy link

asafcyclops commented Sep 1, 2024

As a side note, we have also encountered this issue and it was very hard to debug.
It appears that the current implementation is swallowing the error and is not logging it in any way making it hard to understand the root cause. would be nice if we could have an error message here when retrying.

sfc-gh-jcieslak added a commit that referenced this issue Sep 3, 2024
## Addressed issues
* #3016 `SHOW ORGANIZATION ACCOUNTS` -> `SHOW ACCOUNTS` BCR
* #3015
* #2807
* #3025
@sfc-gh-jcieslak
Copy link
Collaborator

Hey all 👋
Yesterday, we released a new provider version (v0.95.0). Please upgrade and let us know if the issue disappeared.

@marcofunaro I think there's no need for that. We are aware of the issue and will communicate to you any decision we'll make on that most likely through GitHub discussions.

@asafcyclops Thank You for pointing this out, we already created a task for that and will try to address it as part of the next release.

sfc-gh-asawicki added a commit that referenced this issue Sep 5, 2024
@sbrudz
Copy link
Author

sbrudz commented Oct 15, 2024

Confirming that the issue is fixed for us after upgrading to v0.95.0. Thank you, @sfc-gh-jcieslak!

@sfc-gh-jcieslak
Copy link
Collaborator

Oh I wanted to close the ticket since there was no answer from you side for a long time 😅, but now I saw you responded just now, great to hear it works. Closing.

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

5 participants