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

Error 394300 (08004) when establishing connection with Snowflake using Terraform #2280

Closed
jacobcbeaudin opened this issue Dec 19, 2023 · 2 comments
Labels
bug Used to mark issues with provider's incorrect behavior category:provider_config

Comments

@jacobcbeaudin
Copy link
Contributor

Terraform CLI and Provider Versions

Terraform CLI: 1.6.1
Snowflake-Labs/snowflake Version: 0.80.0

Terraform Configuration

provider "snowflake" {
  account       = local.snowflake_account
  authenticator = "JWT"
}

provider "snowflake" {
  alias         = "account_admin"
  role          = "ACCOUNTADMIN"
  account       = local.snowflake_account
  authenticator = "JWT"
}

provider "snowflake" {
  alias         = "security_admin"
  role          = "SECURITYADMIN"
  account       = local.snowflake_account
  authenticator = "JWT"
}

provider "snowflake" {
  alias         = "sys_admin"
  role          = "SYSADMIN"
  account       = local.snowflake_account
  authenticator = "JWT"
}

Expected Behavior

I expect to generate a terraform plan. The same code is able to run without issue in a separate development account

Actual Behavior

$ terraform plan

➜ tfp
data.terraform_remote_state.snowflake_default_user_passwords: Reading...
data.terraform_remote_state.snowflake_default_user_passwords: Read complete after 2s

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: open snowflake connection: 394300 (08004): !394300!
│
│   with provider["registry.terraform.io/snowflake-labs/snowflake"],
│   on versions.tf line 24, in provider "snowflake":
│   24: provider "snowflake" {
│
╵
╷
│ Error: open snowflake connection: 394300 (08004): !394300!
│
│   with provider["registry.terraform.io/snowflake-labs/snowflake"].account_admin,
│   on versions.tf line 29, in provider "snowflake":
│   29: provider "snowflake" {
│
╵
╷
│ Error: open snowflake connection: 394300 (08004): !394300!
│
│   with provider["registry.terraform.io/snowflake-labs/snowflake"].security_admin,
│   on versions.tf line 36, in provider "snowflake":
│   36: provider "snowflake" {
│
╵
╷
│ Error: open snowflake connection: 394300 (08004): !394300!
│
│   with provider["registry.terraform.io/snowflake-labs/snowflake"].sys_admin,
│   on versions.tf line 43, in provider "snowflake":
│   43: provider "snowflake" {
│
╵

I am getting an open snowflake connection error every time I run terraform plan

Steps to Reproduce

  1. terraform plan

How much impact is this issue causing?

High

Logs

No response

Additional Information

No response

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

Hey @jacobcbeaudin. Thanks for reporting the issue.

At first glance, it looks like a problem on your side. You mention that the code runs on the other environment. The error code 08004 indicates that the connection was rejected. The error 394300 is mentioned here: https://docs.snowflake.com/en/user-guide/key-pair-auth-troubleshooting#list-of-errors with possible troubleshooting:

394300 JWT_TOKEN_INVALID_USER_IN_ISSUER The user name specified in the issuer does not exist in the Snowflake account. For possible solutions, see Common Errors and Solutions.

@jacobcbeaudin
Copy link
Contributor Author

This resolved my issue, thanks!

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 category:provider_config
Projects
None yet
Development

No branches or pull requests

3 participants