-
Notifications
You must be signed in to change notification settings - Fork 420
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
Crash when MFA used on 2 providers #2681
Comments
Having dug into this a bit deeper, I don't know if this is an issue with the provider or the underlying Go Snowflake library. In Python they handle multiple reads/writes to the temp credential cache using semaphores. The Go stacktrace code appears to be hitting the same file, but I don't know if the issue is in how the TF provider accesses the secret or how Go handles access to the filesystem. |
Hey @Oracen. Thanks for reaching out to us. From the logs provided it seems more like a bug in the underlying gosnowflake driver library. Please file a ticket in https://github.com/snowflakedb/gosnowflake. |
hi folks - so the issue is handled over there in For any viable workaround, I'm not sure if we have any, if your operations on the (tons of) resources cannot complete due to the race condition on the temporal credential cache file. |
A possible workaround would be also to split the current configuration into two separate workspaces so that only a single provider is used in the given run. It may require some work, though. |
short update regarding the timeline and progress: gosnowflake fix merged, and the new version of the driver is expected to be released towards end of April 2024 afterwards, the TF provider also needs to bump the gosnowflake dependency + a new version released which carries the fixed |
Thanks, @sfc-gh-dszmolka, for the update and for the fast fix. I will schedule a bump of the version on the provider side. |
I'll confirm that splitting into separate TF configs with single providers does work, but may require modifications to your RBAC strategy. If you have a nice divide between resources + policies it works well, with only the additional CICD time + mental overhead as a cost. If you're blocked, probably worth doing, but the easier way is to be nice to your DBAs and get them to set |
fix in gosnowflake released with 1.10.0 |
- Bumped gosnowflake driver to the newest 1.10.0 (References #2681) - Bumped some other terraform-related deps - Bumped deps with security vulnerabilities - Changed the dependabot config (it was spamming too much and we were not looking)
Hey @Oracen @sfc-gh-dszmolka. We have bumped the driver to v1.10.0, we should do the release tomorrow. |
Will do so monday |
would be really curious to hear about how it went; did the fix really help ? |
Hey @Oracen. Was your problem fixed with the version bump? :) |
Yes, it was. Worked like a charm. Appreciate it! |
Great to hear that! I am closing the ticket then. Thanks for the help @sfc-gh-dszmolka. |
Terraform CLI and Provider Versions
Terraform Configuration
Also requires a whole application's definition. You need a non-trivial number of resources to trigger this race condition. The key is having both
client_request_mfa_token = true
Expected Behavior
Provider should cache MFA response to prevent hundreds of Duo messages. Each provider should independently store the provider.
Actual Behavior
Plan operation crashes, stack trace attached. I assume this is providers in child modules not namespacing credentials properly, or some kind of operation that needs a Mutex guard.
Steps to Reproduce
terraform plan
How much impact is this issue causing?
Medium
Logs
https://gist.github.com/Oracen/2b818c2d25dabe7bffbd366176b39fea
Additional Information
Workaround for now is to use accounts without 2FA for deployment of our core Snowflake architecture. This will work short term but is obviously undesirable.
The text was updated successfully, but these errors were encountered: