-
Notifications
You must be signed in to change notification settings - Fork 63
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
Random failure to decrypt when we have multiple(>=7) files to decrypt in .tf #126
Comments
Hey @mrdntgrn, I cannot reproduce this, I'm afraid. Do you have a gpg-agent running that might interfere? |
Hey @carlpett Thank you for your response and checking the issue, I have prepared an complete sample with docker compose to run all inside container so that no platform/os/configuration impact should be. You will need to have docker installed/run on your laptop and run the following commands to reproduce the issue: docker compose up -d # to run container
docker compose exec tf /bin/sh # to go inside the container
gpg --import testing-key.pgp # to import pgp key
terraform init # to initiate terraform
terraform plan # to reproduce the issue run this command multiple times, most of the runs will fail and some may succeed Here is the screen of the files what I used to reproduce the issue, Here are the files zipped: The content of my-gpg-encrypted-data.yaml has been encrypted by using /test/testing-key.pgp key from this repo, Please let me know if you need more help |
Thanks for taking the time to create a self-contained repro case! It took quite a few more re-runs than I expected, but when I did get the error, this is the report:
Is this the same error message you got? Sort of peculiar that it says out of memory, since it isn't actually out of memory. I would suspect that it is rather racing itself somewhere which lacks a mutex. I still cannot reproduce outside of the container environment even with the same .tf file, so there's something environment specific happening. |
When we have more than 6 (>=7) sops_file data blocks in tf code the decode(for example when we run
terraform plan
) fails randomly. The files to decrypt have been encrypted by usingsops -e -i <file-name>
based on gpg with passphrase. One can think that they typed wrong passphrase but the issue appears randomly and sometime decrypt can succeed. Thesops -d <file-name>
succeeds always.By increasing the count of sops_file data blocks the probability of failures also increase, so that for 15 items only 1 from 10 may succeed.
The number 7 maybe fixed or maybe depend on system performance, I tested on Apple MacBook m3 pro (and also on ubuntu linux on local and remote docker based terraform ci/cd pipeline). When we having only few(less than 7) sops_file blocks in tif no failures can be seen.
Tested with latest terraform and sops provider version (same issue also can be seen with old terraform and sops provider versions).
Here is the tools version informations:
Here is sample tf code which can be used to reproduce the issue with 10 sops_file data blocks:
please let me know if you need more info
The text was updated successfully, but these errors were encountered: