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: account and User must be set in provider config, ~/.snowflake/config, or as an environment variable #2137

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

Comments

@lzitka
Copy link

lzitka commented Oct 19, 2023

Provider Version
Installed snowflake-labs/snowflake v0.74.0
id did not happened with - Installed snowflake-labs/snowflake v0.73.0
Terraform Version

1.5.7

Describe the bug

image

Expected behavior

It is not well documented how to configure the provider, on main page README.md file

Code samples and commands

This is current documentation:
image

@lzitka lzitka added the bug Used to mark issues with provider's incorrect behavior label Oct 19, 2023
@smith-m
Copy link

smith-m commented Oct 19, 2023

Seeing the same issue following the Snowflake Terraform demo:
https://quickstarts.snowflake.com/guide/terraforming_snowflake/index.html#4

fixed by forcing version 0.73.0

@simonepm
Copy link

simonepm commented Oct 19, 2023

Latest release 0.74.0 screwed up login completely!

The examples in the readme are not working anymore when using a private key:

export SNOWFLAKE_USER="..."
export SNOWFLAKE_PRIVATE_KEY_PATH="~/.ssh/snowflake_key.p8"
export SNOWFLAKE_PRIVATE_KEY_PASSPHRASE="...

But it returns:

Γöé Error: 260002: password is emptys]
Γöé
Γöé with provider["registry.terraform.io/snowflake-labs/snowflake"].SYSADMIN,
Γöé on main.tf line 24, in provider "snowflake":
Γöé 24: provider "snowflake" {m 43s]

@sfaller98
Copy link

Latest release 0.74.0 screwed up things completely!

The examples in the readme are not working anymore when using a private key:

export SNOWFLAKE_USER="..." export SNOWFLAKE_PRIVATE_KEY_PATH="~/.ssh/snowflake_key.p8" export SNOWFLAKE_PRIVATE_KEY_PASSPHRASE="...

But it returns:

Γöé Error: 260002: password is emptys] Γöé Γöé with provider["registry.terraform.io/snowflake-labs/snowflake"].SYSADMIN, Γöé on main.tf line 24, in provider "snowflake": Γöé 24: provider "snowflake" {m 43s]

I really do not understand how touching the login methods in this way sounded like a good idea.

Did you find a way around this? we need the new release! I guess todays job will be looking for a way around this

@simonepm
Copy link

Nope, reverted to 0.73.0 - I see an hotfix is coming in 0.74.1; but I do not know if it is solving the private key issue or just the "account and User must be set" issue.

@sfaller98
Copy link

sfaller98 commented Oct 19, 2023

Nope, reverted to 0.73.0 - I see an hotfix is coming in 0.74.1; but I do not know if it is solving the private key issue or just the "account and User must be set" issue.

So the terraform variables don't work but if i set both the account and user as variables i got it to work.
SNOWFLAKE_USER=... SNOWFLAKE_ACCOUNT=...
i noticed in ur example u didnt export the account. Could u try that?
#2138
yeah - looks like they are aware of the issue!

They also deprecated username and changed it to user but user doesn't actually work in the terraform variables.

@simonepm
Copy link

simonepm commented Oct 20, 2023

Yes, also SNOWFLAKE_USER and SNOWFLAKE_ACCOUNT were set, the error I receive is:

Error: 260002: password is empty

I guess the environment variables for the private key are not read in the correct way anymore in 0.74.0, leading the provider to try the password login anyway, that is in the end empty.

Same as #2133

@matthiasng
Copy link

We have SNOWFLAKE_USER, SNOWFLAKE_ROLE, SNOWFLAKE_ACCOUNT and SNOWFLAKE_PRIVATE_KEY set as environment variable and we also receive the same error: "Error: 260002: password is empty"

@simonepm
Copy link

simonepm commented Oct 26, 2023

"Error: 260002: password is empty" issue still present in 0.75.0: #2133

@pauldraper
Copy link

I'm really, really curious how people are using 0.74.0 and 0.75.0.

Apparently it's not completely broken for someone right? I can't it to work.

@alexeiser
Copy link

I am using this to automate management of a set of snowflake accounts, using vault based dynamic credentials.

With the issues form 0.74&0.75 I decided to move to generating a profile file, with each acocunt under management. That’s worked pretty well, and a little superior than the previous method which had some leaking in tf state.

@simonepm
Copy link

simonepm commented Oct 29, 2023

As far as I understood people that uses plain password should not have any problem. As soon as you make use of a different login method (private key) and/or a passing method (env variables) thing stop working since 0.74.0. The miscommunication happens between the provider config setup and the gosnowflake library under the hood.

In reality the issue in the subject has been solved (account and user), the thread related to the broken login methods is more related to: #2133

@sfc-gh-swinkler
Copy link
Collaborator

As this specific problem has been fixed as of 0.75, I will close the issue. @simonepm has it correct that #2133 with private key is the current issue. I apologize for the issue, and we are working on a fix ASAP.

@attekei
Copy link

attekei commented Nov 20, 2023

This helps: #2169 (comment)

@sfc-gh-asawicki
Copy link
Collaborator

Hey @lzitka. The problem you initially mentioned should have been solved already in v0.76.0. Please confirm and close the issue if so.

@smith-m @simonepm @sfaller98 @matthiasng @pauldraper please consult the thread in #2169 like suggested above by @attekei (thanks).

@lzitka
Copy link
Author

lzitka commented Nov 20, 2023

@sfc-gh-asawicki - I will test during week or next and eventually close this topic. Thx everyone for feedback in this channel.

@sfc-gh-asawicki
Copy link
Collaborator

Closing as fixed.

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