#atlantis (2021-07)
Discuss the Atlantis (<http://runatlantis.io | runatlantis.io>) |
**Archive: ** https://archive.sweetops.com/atlantis/
2021-07-07
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
Hey question about Atlantis checks, we’re experiencing an issue where after an apply is run, even after there are errors in stdout
the apply check marks as successful, is this behaviour expected?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Nope.
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
We’re using a Terragrunt worfklow.
apply:
steps:
- env:
name: TERRAGRUNT_TFPATH
command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
- run: terragrunt apply-all -no-color --terragrunt-parallelism 4 --terragrunt-non-interactive | grep -v 'terragrunt'
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Yeah, because you are using $action-all which fucks with stdout
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
Ah lame =(
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
Maybe alluring, but really not safe.
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
Thanks for the quick response @joshmyers! Very alluring, but yes, we recognise that it’s not good practice. Originally was using it for larger deployments that were modular, so we were creating atlantis projects to run the commands with the dependencies
block. Since moved away from that but still using the same workflow
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
Easy fix, thanks again
![Callum Robertson avatar](https://avatars.slack-edge.com/2019-06-20/659129332226_04b6b33e0a3f105d3bc7_72.jpg)
@joshmyers do you use -auto-approve
flag in your workflow that doesn’t have the *-all
?
![joshmyers avatar](https://avatars.slack-edge.com/2018-11-20/483958217281_8117d6f6c62807ce9912_72.jpg)
2021-07-08
![Piotr Hryszko avatar](https://secure.gravatar.com/avatar/81194e235790ffb0ded5ce4770f174b2.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0013-72.png)
hey, i have a project that uses .tfvars files, a file per environment. Each environment uses it’s own backend stored in the same account as all other resources. What would be a good way to do terraform init
for each environment and pass different configuration?
![Piotr Hryszko avatar](https://secure.gravatar.com/avatar/81194e235790ffb0ded5ce4770f174b2.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0013-72.png)
i guess this section of docs applies here https://www.runatlantis.io/docs/custom-workflows.html#custom-backend-config however I’m not sure how the content of custom backend file
would look like, ant pointers please?
![Piotr Hryszko avatar](https://secure.gravatar.com/avatar/81194e235790ffb0ded5ce4770f174b2.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0013-72.png)
please ignore the question, it’s just standard terraform backend config file
2021-07-28
![Arjun Venkatesh avatar](https://avatars.slack-edge.com/2020-11-13/1486290027687_1847598c416abd14f87a_72.jpg)
Hey There, We are currently using Terragrunt for Atlantis workflow and recently updated the Atlantis image to the latest one. Now, when we try to do a plan, it succeeds and shows the plan out put as:
![Arjun Venkatesh avatar](https://avatars.slack-edge.com/2020-11-13/1486290027687_1847598c416abd14f87a_72.jpg)
but, when we try to comment the apply command it throws 2 different types of errors:
- When you just comment “atlantis apply”
Ran Apply for 0 projects:
- When you comment “atlantis apply -d test/myproject”, it throws the following error ``` exit status 1: running “terragrunt apply -no-color $$PLANFILE” in “/home/atlantis/.atlantis/repos/myrepo/myproject”:
Error: Failed to load “2408PLANFILE” as a plan file
Error: stat 2408PLANFILE: no such file or directory time=2021-07-28T17:40:15Z level=error msg=1 error occurred: * exit status 1 ```
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
I have no seen this
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
and that showing the name of the planfile is weird
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
that about the atlantis logs?
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
atlantis checkout the repo and the repo becomes the working directory
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
so when the plan is done is where the plan file will be safe UNLESS you have custom command or custom plan that outputs the plan file to another directory
![Arjun Venkatesh avatar](https://avatars.slack-edge.com/2020-11-13/1486290027687_1847598c416abd14f87a_72.jpg)
so, I kinda of gotten it to work. The issue looks like was caused from having $$PLANFILE
changed it to $PLANFILE
and it worked fine
![Arjun Venkatesh avatar](https://avatars.slack-edge.com/2020-11-13/1486290027687_1847598c416abd14f87a_72.jpg)
No, we dont have any custom commands or plans configured output. This what we have as workflow steps:
terragrunt plan -no-color -out $PLANFILE
terragrunt apply -no-color -out $PLANFILE
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
so you do have a custom workflow
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
in my atlantis setups I never expecified the PLANFILE
![Arjun Venkatesh avatar](https://avatars.slack-edge.com/2020-11-13/1486290027687_1847598c416abd14f87a_72.jpg)
anyone faced something like this before? or any pointers on what I should be looking at?
![Jurgen avatar](https://secure.gravatar.com/avatar/915965c8a95b0d97f7d201423fdff980.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
so, I started up atlantis for my terraform code base, it was working fine… Now I am getting this error on init
Error: Failed to install provider from shared cache
How do I resolve it? Do I really just not commit the lock files like threads are suggesting, seems broken.
The weird thing is, it worked for a few plans/PR’s/commits and now its coming up with this.
![Jurgen avatar](https://secure.gravatar.com/avatar/915965c8a95b0d97f7d201423fdff980.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
ok, so I think its because I moved to a custom image and installed openssl.
I have deleted the cache and this plan has run, I will let you know if another plan has worked.
![Jurgen avatar](https://secure.gravatar.com/avatar/915965c8a95b0d97f7d201423fdff980.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
so yeah, a second plan using the downloaded cache now fails again.
![Jurgen avatar](https://secure.gravatar.com/avatar/915965c8a95b0d97f7d201423fdff980.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
ok, so what is atlantis doing, I can see its running update and adding hashes to the lock file….
![Jurgen avatar](https://secure.gravatar.com/avatar/915965c8a95b0d97f7d201423fdff980.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0011-72.png)
got it
terraform providers lock -platform=linux_amd64 -platform=darwin_amd64
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
Atlantis just run terraform
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
nothing else
![jose.amengual avatar](https://secure.gravatar.com/avatar/32f267b819eac9e0ea6a8324b53064a0.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
no magic
![Reinholds Zviedris avatar](https://secure.gravatar.com/avatar/348ae8e0fd10fc2e78acbe448dd598b2.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2Fdf10d%2Fimg%2Favatars%2Fava_0024-72.png)
True, Atlantis just runs Terraform, so you can try runing TF code yourself. If you experience the same behaviour then something is wrong with TF install or perms. That could be the issue also in case of custom built Atlantis image.