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]: Unexpected error: Error: 260002: password is empty when using env variables #3369

Closed
1 task
sharanya-ve opened this issue Jan 31, 2025 · 7 comments
Closed
1 task
Assignees
Labels
general-usage General help/usage questions

Comments

@sharanya-ve
Copy link

sharanya-ve commented Jan 31, 2025

Terraform CLI Version

v1.10.5

Terraform Provider Version

v1.0.2

Company Name

No response

Terraform Configuration

main.tf:

provider "snowflake" {
  role    = <redacted>
  organization_name = <redacted>
  account_name = <redacted>
  authenticator = "SNOWFLAKE"
}


.env:

SNOWFLAKE_USER=<redacted>
SNOWFLAKE_PASSWORD=<redacted>

Category

category:provider_config

Object type(s)

No response

Expected Behavior

I would expect this configuration to authenticate to Snowflake correctly. According to the documentation for the latest version, the provider should be able to get the password from the SNOWFLAKE_PASSWORD env variable and takes precedence over credentials in a config file.

https://registry.terraform.io/providers/Snowflake-Labs/snowflake/latest/docs#order-precedence

Actual Behavior

I am getting the following error: Error: 260002: password is empty. I confirmed that the variable was set correctly by running echo $SNOWFLAKE_PASSWORD.

Seeing the following line in the debug logs so it looks like this may be due to not having a config file - according to the docs I shouldn't need one if I have an env var set.

[DEBUG] No Snowflake config file found, returning empty config: could not load config file: open /<path>/.snowflake/config: no such file or directory

Steps to Reproduce

  1. Copy the provider above
  2. Export env variables above
  3. Run terraform init
  4. Run terraform plan - it fails to authenticate to Snowflake here.

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

This seems to be new (as of the last 3 or so days). I'm running into this error locally but our CICD process seems fine.

Would you like to implement a fix?

  • Yeah, I'll take it 😎
@sharanya-ve sharanya-ve added the bug Used to mark issues with provider's incorrect behavior label Jan 31, 2025
@sharanya-ve sharanya-ve changed the title [Bug]: [Bug]: Unexpected error: Error: 260002: password is empty when using env variables Jan 31, 2025
@sfc-gh-jmichalak
Copy link
Collaborator

Hi @sharanya-ve 👋

This seems to be new (as of the last 3 or so days). I'm running into this error locally but our CICD process seems fine.

Did this happen after an upgrade? If it's running fine in CI/CD, this looks like a misconfiguration.

This log entry just informs that no TOML config file was found, and it's a fallback to an empty config. This config is then overridden by env and Terraform values.

I just tested it with the same setup, and I also see this log, but I authenticate correctly. Please test something like SNOWFLAKE_PASSWORD=<redacted> terraform plan, and see what happens.

@sharanya-ve
Copy link
Author

Thank you! I think you're right - that test worked so it's a configuration issue on my end. I'll troubleshoot on my own sorry for the false alarm!

@sfc-gh-jmichalak sfc-gh-jmichalak self-assigned this Jan 31, 2025
@sfc-gh-jmichalak sfc-gh-jmichalak added general-usage General help/usage questions and removed bug Used to mark issues with provider's incorrect behavior labels Jan 31, 2025
@rjminchuk
Copy link

I'm finding something similar with 1.0.2. I'm getting Error: 260000: account is empty I have SNOWFLAKE_ACCOUNT set in my ~/.zshrc. I am upgrading from 0.97.0

@rjminchuk
Copy link

rjminchuk commented Feb 3, 2025

I am using the account locator format (xy12345.us-east-1.aws) RE: https://docs.snowflake.com/en/user-guide/admin-account-identifier#format-2-account-locator-in-a-region

I previously had SNOWFLAKE_ACCOUNT and SNOWFLAKE_REGION set in my environment.

I've tried setting SNOWFLAKE_ACCOUNT_NAME="xy12345" and SNOWFLAKE_ORGANIZATION_NAME="ASDFGHJ" but am getting a failure:

open snowflake connection: 261004 (08004): failed to auth for unknown reason. HTTP: 404, URL: https://<REDACTED>-<REDACTED>.snowflakecomputing.com:443

@sfc-gh-asawicki

@rjminchuk
Copy link

I just found this comment #3198 (comment)

I think I had my accountname wrong.. trying again..

@rjminchuk
Copy link

Had my account name wrong. That resolved my issue. Thanks @sfc-gh-asawicki !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general-usage General help/usage questions
Projects
None yet
Development

No branches or pull requests

4 participants