Open ronaldmiranda opened 1 year ago
please fill the other details, like version of atlantis, debug logs etc.
@jamengual i just accidentally submitted, im still editing.
ahhh ok, no problem
@jamengual ping
what do you see in the logs when you run plan? did you enable debug?
I have no idea about terragrunt so I can't help there.
if you are in slack you can ask the same there and see if anyone else run into this issue. A lot of people use terragrunt and atlantis.
@jamengual the thing is not about terragrunt, but why atlantis is showing 0 things to apply, since have previously detected a change on the atlantis plan
command. and when i put the project on the flag -p it works.
@jamengual i have enabled the debug but it shows nothing useful. does not even throw any errors in any log level.
are you running multiple atlantis pods?
@jamengual only one.
the only way this could happen is that the pod somehow lost the Atlantis-data dir ( got replaced ) or the pre_workflow hook failed for some reason and generated an empty atlantis.yaml file.
or a bug, that is possible too.
@jamengual the atlantis-data is persistent to a cloud disk, the atlantis .yaml is not empty, because the status check on github says that 0/1 where applied:
@jamengual and it stills on that pending state forever.
can you downgrade to 0.22.x and see if still happens?
@jamengual still happens the same.
can we see your log file? maybe from a fresh restart and then when the plan does not work?
could it be this ?
- '*.hcl'
- '*.tf*'
- '**/*.hcl'
- '**/*.tf*'
- ../terragrunt.hcl
- ../../../terraform_v2/google/iam/service_accounts/*.tf*
- ../../../terraform_v2/google/iam/service_accounts/main/*.tf*
- ../../../terraform_v2/google/management/services/*.tf*```
you notice that some have single quotes and some don't?
@jamengual no, because this is generated by the terragrunt-atlantis-config and actually it works on atlantis plan
command.
you are right otherwise no commands will work
please post the debug log file when possible
@ronaldmiranda if you downgrade to v0.19.8, does it work as expected?
thank you @nitrocode, i tested as well but still happening the same, is it possible to something related to github side?
i also have tested without using project marker as well and only the atlantis plan
command works. the apply still giving the same message "Ran Apply for 0 projects"
i'm only using one apply requirement the 'approved' and the PR is approved as well.
Here @jamengual
{"level":"info","ts":"2023-04-04T00:33:26.666Z","caller":"events/events_controller.go:533","msg":"parsed comment as command=\"apply\" verbose=false dir=\"\" workspace=\"\" project=\"\" flags=\"\"","json":{"gh-request-id":"X-Github-Delivery=****"}}
{"level":"info","ts":"2023-04-04T00:33:27.281Z","caller":"events/github_app_working_dir.go:26","msg":"Refreshing git tokens for Github App","json":{"repo":"**/**","pull":"933"}}
{"level":"info","ts":"2023-04-04T00:33:40.659Z","caller":"runtime/pre_workflow_hook_runner.go:50","msg":"successfully ran \" terragrunt-atlantis-config generate --create-project-name --apply-requirements approved --output atlantis.yaml \" in \"/atlantis-data/repos/**/**/933/default\"","json":{"repo":"**/**","pull":"933"}}
{"level":"info","ts":"2023-04-04T00:33:40.678Z","caller":"runtime/pre_workflow_hook_runner.go:50","msg":"successfully ran \"yq -i '.projects = (.projects | map(select(.workflow == \\\"terragrunt_nonprd\\\"))) ' atlantis.yaml\" in \"/atlantis-data/repos/**redacted**/***/933/default\"","json":{"repo":"***/**","pull":"933"}}
what is that jq command you are running? what are the chances that command is exiting with non 0 every so often?
you mentioned that you tested without the autogenerated Atlantis config, correct?
what are your server startup options and repo. yaml?
@jamengual this command jq is similar of the filter feature, but here i'm manipulating the yaml to only show atlantis projects that is using the same workflow. the exit of this command is correct, and it also runs on the plan command.
@jamengual im only configuring the atlantis server with the environment variables above, with no other flags. Here is the repo.yml:
repos:
- id: /.*(\/infrastructure-terraform)$/
branch: /^(?i)(develop|lc[a-zA-Z]{1,3}-(\d+))$/
allowed_overrides: [apply_requirements, workflow, delete_source_branch_on_merge]
apply_requirements: [approved]
delete_source_branch_on_merge: true
pre_workflow_hooks:
- run: '
terragrunt-atlantis-config generate
--create-project-name
--apply-requirements approved
--output atlantis.yaml
'
- run: yq -i '.projects = (.projects | map(select(.workflow == "terragrunt_nonprd"))) ' atlantis.yaml
workflows:
terragrunt_nonprd:
plan:
steps:
- run: terragrunt plan -no-color -out=${PULL_NUM}.plan
apply:
steps:
- run: terragrunt apply -no-color ${PULL_NUM}.plan
Try commenting out the yq command. I bet that's what is causing the issue.
@nitrocode hello! im testing another way without the yq and now i splitted the generated atlantis.yaml file in 2, one for prod and nonprod, the issue still happens.
also im using the repo_config_file
the the server level config
Overview of the Issue
The Alantis returns 0 projects to apply even if the plan was made previously. The
atlantis apply
command only works specifying the -p (project)Reproduction Steps
Using terragrunt structure like:
also we are using terragrunt-atlantis-config to autogenerate the repo side config. and using the
--use-project-markers --project-hcl-files project.hcl
flags, poins each project dir to a specific environment folder to make able to run terragrunt run-all on top of that.Logs
Environment details
If not already included, please provide the following:
Atlantis server-side config file:
Repo
atlantis.yaml
file:Additional Context
Running without specifying project:
specifying project: