-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
terraform lock file committed on arm, linux amd deploy, init command throws error with tf 0.14 #1408
Comments
changing the workflow to look like this: + "workflows": {
+ "default": {
+ "apply": {
+ "steps": [
+ "apply"
+ ]
+ },
+ "plan": {
+ "steps": [
+ {
+ "run": "terraform init -input=false -no-color"
+ },
+ "plan"
+ ]
+ }
+ }, I now get this:
despite having my
and
|
I was able to fix the version issue by changing the workflow to |
if you use extra-args it'll use the version you specify in your atlantis.yaml. referencing the binary directly in a custom run command doesn't work if you're using the non-default. We can make this clearer in our docs. |
+1 on this issue as we encountered it with Terraform v0.14. Seems like the two workaround are:
I am going with custom workflow method for now.. Edit: This comment #1408 (comment) identified the issue/fix |
Are extra args deduplicated? Such that if I specify an argument that is already a default (but with a different value), are they both passed to terraform? Or does last arg win? |
They don't seem to get dedup. Adding
|
To follow up on this one... with fix #1651 the
|
For what it's worth, I ran into the same issue, and it appears the root cause of the issue is that the terraform lock file was generated in OS X but Atlantis was running in linux_amd64? Running the following line added extra checksums for the linux_amd64 version of the providers:
After committing and pushing this change to the lockfile, Atlantis is happy to use the cached version of the provider and runs without issues. (I discovered this thanks to https://zenn.dev/shonansurvivors/scraps/7dd3ab1188c956 – I assume this is the same issue based on error messages and the step to fix it, even though I don't read Japanese 😄 ) |
Thanks @Pluies -- that was our issue. And it was the sole reason we were using custom workflows for all of our root It's possible to generate the checksums for multiple architectures in a single go, such that lockfiles will work with old and new macs, intel and amd (Graviton) instances. I added a script #!/usr/bin/env bash
#
# Generates .terraform.lock.hcl file having hashes for each architecture we run on
# https://www.terraform.io/cli/commands/providers/lock
terraform providers lock -platform=darwin_arm64 -platform=darwin_amd64 -platform=linux_amd64 -platform=linux_arm64 |
-upgrade
which is not desirable starting with terraform 0.14-upgrade
which throws an error after tf 0.14
Sounds like the workaround is to either
Thanks for everyone investigating this and coming up with a solution that works. It would be nice to create a new doc to mention how to commit this file properly. |
-upgrade
which throws an error after tf 0.14
Just chiming in - we're not vendoring/committing the lockfiles and we're still running into this. Workaround is to delete the plugin cache dir or vendor/commit the lockfile with the platform atlantis is running on (+ any local envs etc) |
is there a regression on this workaround for Ref: I tried upgrading (listing all changes to highlight the issue seems related to
I am using this in my # Atlantis issues with TF 1.4+
# https://github.com/runatlantis/atlantis/issues/3201
TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE=true
# ...
I do consider finding out a way to make sure the terraform lock files are committed (we run across windows/linux/mac and amd64/arm64 machines so we're not comiting lock files yet, but if anyone has some type of pre-commit checks that help validate the lock file, I'll make sure the lock files are added to resolve this issue instead. the only change log entries mentioning lock files for |
I was storing the So perhaps there's no regression and I just had to |
I ran into the following issue:
and after looking up the error (https://www.terraform.io/docs/cli/commands/providers/lock.html)
I think that
-upgrade
is the problem here, but I can't be sure.The text was updated successfully, but these errors were encountered: