Skip to content
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

Atlantis output in GitHub PRs unexpectedly showing "Initializing backend..." and "Refreshing state..." #3386

Closed
abemusic opened this issue May 8, 2023 · 9 comments · Fixed by #3518
Labels
feature New functionality/enhancement go Pull requests that update Go code help wanted Good feature for contributors terragrunt

Comments

@abemusic
Copy link

abemusic commented May 8, 2023

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

The output of the terraform plan results in our Github PRs are showing a lot of unnecessary output, including backend initialization and terraform state refreshing

Initializing the backend...

Successfully configured the backend "s3"! Terraform will automatically
use this backend unless the backend configuration changes.
Initializing modules...
- redacted
- 
Initializing provider plugins...
- Reusing previous version of hashicorp/local from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Reusing previous version of harness/harness from the dependency lock file
- Installing hashicorp/local v2.4.0...
- Installed hashicorp/local v2.4.0 (signed by HashiCorp)
- Installing hashicorp/aws v4.61.0...
- Installed hashicorp/aws v4.61.0 (signed by HashiCorp)
- Installing harness/harness v0.17.0...
- Installed harness/harness v0.17.0 (signed by a HashiCorp partner, key ID A1A83E0CC7A69F1D)

Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html

Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

followed by hundreds of lines including Refreshing state...

Reproduction Steps

Atlantis configuration:

repos:
  - id: github.internal.com/org/repo
    branch: /.*/
    plan_requirements: [undiverged]
    apply_requirements: [approved, mergeable]
    import_requirements: [approved, mergeable]
    pre_workflow_hooks:
      - run: terragrunt-atlantis-config generate --output atlantis.yaml --autoplan --parallel --create-workspace
    workflow: terragrunt
workflows:
  terragrunt:
    plan:
      steps:
        - env:
            name: TERRAGRUNT_TFPATH
            command: 'echo "terraform${ATLANTIS_TERRAFORM_VERSION}"'
        - run: terragrunt plan -input=false -out=$PLANFILE
        - run: terragrunt show -json $PLANFILE > $SHOWFILE

Running in a podman container with this startup command:

podman run \
    -d \
    --restart unless-stopped \
    --name=atlantis \
    -e ATLANTIS_GH_HOSTNAME=github.internal.com \
    -e ATLANTIS_GH_TOKEN=redacted \
    -e ATLANTIS_GH_USER=redacted \
    -e ATLANTIS_GH_WEBHOOK_SECRET=redacted \
    -e ATLANTIS_REPO_ALLOWLIST=github.internal.com/org/repo \
    -e ATLANTIS_REPO_CONFIG=/home/atlantis/atlantis-repo-config.yaml \
    -e HARNESS_PLATFORM_API_KEY=redacted \
    -h internal-atlantis \
    -p 4141:4141 \
    atlantis:local server

Logs

{"level":"debug","ts":"2023-05-08T17:01:26.468Z","caller":"server/middleware.go:45","msg":"POST /events – from 10.0.2.100:59004","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:26.468Z","caller":"events/events_controller.go:101","msg":"handling GitHub post","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:26.468Z","caller":"events/events_controller.go:167","msg":"request valid","json":{"gh-request-id":"X-Github-Delivery=f7f87640-edc1-11ed-92b7-51ad996b98c7"}}
{"level":"info","ts":"2023-05-08T17:01:26.469Z","caller":"events/events_controller.go:545","msg":"parsed comment as command=\"plan\" verbose=false dir=\"\" workspace=\"\" project=\"\" flags=\"\"","json":{"gh-request-id":"X-Github-Delivery=f7f87640-edc1-11ed-92b7-51ad996b98c7"}}
{"level":"debug","ts":"2023-05-08T17:01:26.469Z","caller":"events/events_controller.go:577","msg":"executing command","json":{"gh-request-id":"X-Github-Delivery=f7f87640-edc1-11ed-92b7-51ad996b98c7"}}
{"level":"debug","ts":"2023-05-08T17:01:26.469Z","caller":"server/middleware.go:72","msg":"POST /events – respond HTTP 200","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:26.620Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.get_pull_request.execution_time","value":0.149792665,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:26.620Z","caller":"events/pre_workflow_hooks_command_runner.go:58","msg":"pre-hooks configured, running...","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:26.620Z","caller":"events/pre_workflow_hooks_command_runner.go:64","msg":"got workspace lock","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:26.620Z","caller":"events/working_dir.go:223","msg":"creating dir \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:26.909Z","caller":"events/working_dir.go:255","msg":"ran: git clone --depth=1 --branch INTERSIGHT-20037-test-atlantis --single-branch https://internal-user:<redacted>@github.internal.com/internal-org/internal-repo.git /home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default. Output: Cloning into '/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default'...","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:26.999Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.08921925,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"info","ts":"2023-05-08T17:01:27.047Z","caller":"runtime/pre_workflow_hook_runner.go:76","msg":"successfully ran \"terragrunt-atlantis-config generate --output atlantis.yaml --autoplan --parallel --create-workspace\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.134Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.087562168,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.135Z","caller":"vcs/github_client.go:323","msg":"GET /repos/internal-org/internal-repo/pulls/3/reviews","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:27.244Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.pull_is_approved.execution_time","value":0.109631213,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.343Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.pull_is_mergeable.execution_time","value":0.098960431,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github_event.comment_created.success_200","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:27.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.pull_is_mergeable.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:27.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.update_status.execution_success","value":2,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:27.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.get_pull_request.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:27.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.pull_is_approved.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:27.435Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.091943351,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.435Z","caller":"vcs/github_client.go:143","msg":"[attempt 1] GET /repos/internal-org/internal-repo/pulls/3/files","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:27.496Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.get_modified_files.execution_time","value":0.060284955,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.496Z","caller":"events/project_command_builder.go:284","msg":"1 files were modified in this pull request","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.496Z","caller":"events/project_command_builder.go:326","msg":"got workspace lock","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.496Z","caller":"events/working_dir.go:97","msg":"clone directory \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default\" already exists, checking if it's at the right commit","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/working_dir.go:124","msg":"repo is at correct commit \"561cc4e036cec500d782b147bf2dafd3eaac6d84\" so will not re-clone","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_command_builder.go:351","msg":"successfully parsed atlantis.yaml file","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_command_builder.go:358","msg":"moduleInfo for /home/atlantis/.atlantis/repos/internal-org/internal-repo/3/default (matching \"\") = map[]","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_finder.go:185","msg":"found downstream projects for \"path/to/changes/inputs/teams/intersight_docs.hcl\": []","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_finder.go:192","msg":"checking if project at dir \"path/to/changes\" workspace \"internal-workspace_stuff-here\" was modified","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_finder.go:233","msg":"file \"path/to/changes/inputs/teams/intersight_docs.hcl\" matched pattern","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_command_builder.go:365","msg":"1 projects are to be planned based on their when_modified config","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_command_builder.go:368","msg":"determining config for project at dir: \"path/to/changes\" workspace: \"internal-workspace_stuff-here\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:293","msg":"MergeProjectCfg started","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting allow_custom_workflows: false from default server config","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting delete_source_branch_on_merge: false from default server config","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting repo_locking: true from default server config","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting plan_requirements: [undiverged] from repos[1], id: github.internal.com/internal-org/internal-repo","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting apply_requirements: [approved,mergeable] from repos[1], id: github.internal.com/internal-org/internal-repo","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting import_requirements: [approved,mergeable] from repos[1], id: github.internal.com/internal-org/internal-repo","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting workflow: \"terragrunt\" from repos[1], id: github.internal.com/internal-org/internal-repo","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:571","msg":"setting allowed_overrides: [] from default server config","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"valid/global_cfg.go:359","msg":"final settings: plan_requirements: [undiverged], apply_requirements: [approved,mergeable], import_requirements: [approved,mergeable], workflow: terragrunt","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.498Z","caller":"events/project_command_context_builder.go:96","msg":"Building project command context for plan","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.498Z","caller":"terraform/terraform_client.go:316","msg":"Cannot determine which version to use from terraform configuration, detected 0 possibilities.","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.499Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.builder.execution_time","value":0.063274877,"tags":{},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:27.499Z","caller":"events/plan_command_runner.go:241","msg":"deleting previous plans and locks","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.501Z","caller":"events/plan_command_runner.go:252","msg":"Running plans in parallel","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.588Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.086270606,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"info","ts":"2023-05-08T17:01:27.590Z","caller":"events/project_locker.go:86","msg":"acquired lock with id \"internal-org/internal-repo/path/to/changes/internal-workspace_stuff-here\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.590Z","caller":"events/project_command_runner.go:407","msg":"acquired lock for project","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.590Z","caller":"events/working_dir.go:223","msg":"creating dir \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.846Z","caller":"events/working_dir.go:255","msg":"ran: git clone --depth=1 --branch INTERSIGHT-20037-test-atlantis --single-branch https://internal-user:<redacted>@github.internal.com/internal-org/internal-repo.git /home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here. Output: Cloning into '/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here'...","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.846Z","caller":"models/shell_command_runner.go:93","msg":"starting \"echo \\\"terraform${ATLANTIS_TERRAFORM_VERSION}\\\"\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:27.847Z","caller":"models/shell_command_runner.go:156","msg":"successfully ran \"echo \\\"terraform${ATLANTIS_TERRAFORM_VERSION}\\\"\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:27.847Z","caller":"models/shell_command_runner.go:93","msg":"starting \"terragrunt plan -input=false -out=$PLANFILE\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:28.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.builder.projects","value":1,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:28.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.builder.execution_success","value":1,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:28.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.update_status.execution_success","value":2,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:28.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.get_modified_files.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"info","ts":"2023-05-08T17:01:45.442Z","caller":"models/shell_command_runner.go:156","msg":"successfully ran \"terragrunt plan -input=false -out=$PLANFILE\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:45.443Z","caller":"models/shell_command_runner.go:93","msg":"starting \"terragrunt show -json $PLANFILE > $SHOWFILE\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:47.736Z","caller":"models/shell_command_runner.go:156","msg":"successfully ran \"terragrunt show -json $PLANFILE > $SHOWFILE\" in \"/home/atlantis/.atlantis/repos/internal-org/internal-repo/3/internal-workspace_stuff-here/path/to/changes\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:47.834Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.096845411,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"info","ts":"2023-05-08T17:01:47.834Z","caller":"events/instrumented_project_command_runner.go:87","msg":"plan success. output available at: https://github.internal.com/internal-org/internal-repo/pull/3","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:47.834Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.execution_time","value":20.33224683,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3","project":"","project_path":"path/to/changes","terraform_version":"","workspace":"internal-workspace_stuff-here"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:47.834Z","caller":"vcs/github_client.go:192","msg":"POST /repos/internal-org/internal-repo/issues/3/comments","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:48.172Z","caller":"server/middleware.go:45","msg":"POST /events – from 10.0.2.100:40810","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:48.172Z","caller":"events/events_controller.go:101","msg":"handling GitHub post","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:48.172Z","caller":"events/events_controller.go:167","msg":"request valid","json":{"gh-request-id":"X-Github-Delivery=04f02a00-edc2-11ed-9fd6-5623c4e721c7"}}
{"level":"debug","ts":"2023-05-08T17:01:48.172Z","caller":"server/middleware.go:72","msg":"POST /events – respond HTTP 200","json":{}}
{"level":"debug","ts":"2023-05-08T17:01:48.181Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.create_comment.execution_time","value":0.347249494,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:48.181Z","caller":"events/db_updater.go:25","msg":"updating DB with pull results","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:48.272Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.089278228,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"info","ts":"2023-05-08T17:01:48.272Z","caller":"events/plan_command_runner.go:281","msg":"Running policy check for command=\"plan\" verbose=false dir=\"\" workspace=\"\" project=\"\" flags=\"\"","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"info","ts":"2023-05-08T17:01:48.272Z","caller":"events/policy_check_command_runner.go:42","msg":"no projects to run policy_check in","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:48.272Z","caller":"events/policy_check_command_runner.go:47","msg":"setting VCS status to success with no projects found","json":{"repo":"internal-org/internal-repo","pull":"3"}}
{"level":"debug","ts":"2023-05-08T17:01:48.342Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.069672201,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:48.342Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.cmd.comment.plan.execution_time","value":21.872049005,"tags":{},"type":"timer"}}
{"level":"debug","ts":"2023-05-08T17:01:48.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github_event.comment_created.success_200","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:48.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3","project":"","project_path":"path/to/changes","terraform_version":"","workspace":"internal-workspace_stuff-here"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:48.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.update_status.execution_success","value":3,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}
{"level":"debug","ts":"2023-05-08T17:01:48.424Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.create_comment.execution_success","value":1,"tags":{"base_repo":"internal-org/internal-repo","pr_number":"3"},"type":"counter"}}

Environment details

  • atlantis version:
  • terraform version: v1.4.5
  • terragrunt version: v0.45.8
  • terragrunt-atlantis-config: v1.16.0
  • deployment method: docker (podman)
  • If not running the latest Atlantis version have you tried to reproduce this issue on the latest version: yes, tried latest dev build with same result, moved back to latest stable version

Additional Context

@abemusic abemusic added the bug Something isn't working label May 8, 2023
@nitrocode
Copy link
Member

Has this always been the case or is this only on a recent version?

Can you modify the terragrunt command to omit some of the noisy output?

@miguelaferreira
Copy link

I think it was like this already, unless I missed a version that implemented a way to filter out the output.

The terragrunt command I've been using has a few filters (grep -v) in front to remove the output, but that gets in the way of the plan live stream. While the output is being filtered so it doesn't show up in the GitHub comments, it also doesn't show up in the stream, making it an all black screen almost to the end.

- run: "terragrunt plan --terragrunt-log-level error -input=false -no-color -refresh -out=$PLANFILE | grep -v \": Refreshing state...\" | grep -v \": Reading...\" | grep -v \": Read complete after \""

@GenPage GenPage added feature New functionality/enhancement help wanted Good feature for contributors go Pull requests that update Go code terragrunt and removed bug Something isn't working labels May 11, 2023
@X-Guardian
Copy link
Contributor

X-Guardian commented May 24, 2023

You can remove the Terraform suggestion text from the output by adding the TF_IN_AUTOMATION environment variable to your Atlantis Terragrunt custom workflow. I've raised PR #3443 to update the docs with this.

@nitrocode
Copy link
Member

@X-Guardian
Copy link
Contributor

Not for custom workflows, like this Terragrunt one.

@jamengual
Copy link
Contributor

jamengual commented May 24, 2023

actually @nitrocode is right, we set this in the client setup , did you actually see a difference while setting it up as an ENV for terragrunt @X-Guardian ?

maybe terragrunt set it up to =false by default?

@X-Guardian
Copy link
Contributor

Yes, without manually setting the TF_IN_AUTOMATION as in env var in the custom workflow, I see the full verbose Terraform output as seen in this issue discussion. Setting the env var produces the 'less verbose' output.

@nitrocode
Copy link
Member

nitrocode commented May 24, 2023

If we set this in some places and not other places then it seems like a bug. The workaround is to use env step to add it manually but it should be fixed in the server... Or removed completely from the server. Right now the current implementation seems to cover only certain use cases, perhaps?

@miguelaferreira
Copy link

Even while setting the env var TF_IN_AUTOMATION explicitly in the workflow, atlantis still posts the entire output of the refresh phase of a terragrunt workflow back to github. That doesn't seem to happen with a terraform workflow, where the refresh phase output is filtered out from the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality/enhancement go Pull requests that update Go code help wanted Good feature for contributors terragrunt
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants