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

Revert "fix: Delete locks and workdirs with potentially stale previous plans which fixes 1624" #2316

Conversation

jamengual
Copy link
Contributor

Reverts #1704

@jamengual jamengual requested a review from a team as a code owner June 13, 2022 21:11
@jamengual jamengual closed this Jun 13, 2022
@jamengual jamengual deleted the revert-1704-delete_locks_and_workdirs_with_potentially_stale_previous_plans_which_fixes_1624 branch June 13, 2022 21:13
@ascandella
Copy link
Contributor

@jamengual can you shed light on why this revert was closed? I think I just ran into an issue due to #1704 being included with v0.19.5-pre.20220622 (which i just updated to in order to verify the streaming PR I included there is working correctly).

I'm not 100% sure it's related to this, but I wasn't seeing it before I updated to a master build a couple of weeks ago. Happy to open a new issue, but not sure if this is something you're already aware of.

When autoplanning the second time (pushing an update to an open PR), I'm getting:

{"level":"debug","ts":"2022-06-23T19:14:28.399Z","caller":"events/plan_command_runner.go:113","msg":"deleting locks and workdir(s) with previous plans","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"info","ts":"2022-06-23T19:14:28.423Z","caller":"events/plan_command_runner.go:122","msg":"Running plans in parallel","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.642Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.update_status.execution_success","value":1,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2022-06-23T19:14:28.642Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.github.get_modified_files.execution_success","value":1,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2022-06-23T19:14:28.642Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.projects","value":2,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2022-06-23T19:14:28.642Z","caller":"metrics/debug.go:42","msg":"counter","json":{"name":"atlantis.cmd.autoplan.builder.execution_success","value":1,"tags":{},"type":"counter"}}
{"level":"debug","ts":"2022-06-23T19:14:28.726Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.30325934,"tags":{},"type":"timer"}}
{"level":"info","ts":"2022-06-23T19:14:28.729Z","caller":"events/project_locker.go:80","msg":"acquired lock with id \"myorg/myrepo/roots/prod/myproject/default\"","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.729Z","caller":"events/project_command_runner.go:364","msg":"acquired lock for project","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"info","ts":"2022-06-23T19:14:28.729Z","caller":"events/github_app_working_dir.go:26","msg":"Refreshing git tokens for Github App","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.729Z","caller":"events/git_cred_writer.go:36","msg":"git credentials file has expected contents, not modifying","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"info","ts":"2022-06-23T19:14:28.729Z","caller":"events/working_dir.go:208","msg":"creating dir \"/root/.atlantis/repos/myorg/myrepo/47/default\"","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.790Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.366829503,"tags":{},"type":"timer"}}
{"level":"info","ts":"2022-06-23T19:14:28.792Z","caller":"events/project_locker.go:80","msg":"acquired lock with id \"myorg/myrepo/roots/staging/myproject/default\"","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.792Z","caller":"events/project_command_runner.go:364","msg":"acquired lock for project","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"info","ts":"2022-06-23T19:14:28.792Z","caller":"events/github_app_working_dir.go:26","msg":"Refreshing git tokens for Github App","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.792Z","caller":"events/git_cred_writer.go:36","msg":"git credentials file has expected contents, not modifying","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:28.792Z","caller":"events/working_dir.go:90","msg":"clone directory \"/root/.atlantis/repos/myorg/myrepo/47/default\" already exists, checking if it's at the right commit","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"warn","ts":"2022-06-23T19:14:28.793Z","caller":"events/working_dir.go:105","msg":"will re-clone repo, could not determine if was at correct commit: git rev-parse HEAD: exit status 128: HEAD\nfatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.\nUse '--' to separate paths from revisions, like this:\n'git <command> [<revision>...] -- [<file>...]'\n","json":{"repo":"myorg/myrepo","pull":"47"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*FileWorkspace).Clone\n\tgithub.com/runatlantis/atlantis/server/events/working_dir.go:105\ngithub.com/runatlantis/atlantis/server/events.(*GithubAppWorkingDir).Clone\n\tgithub.com/runatlantis/atlantis/server/events/github_app_working_dir.go:54\ngithub.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandRunner).doPlan\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:374\ngithub.com/runatlantis/atlantis/server/events.(*DefaultProjectCommandRunner).Plan\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:208\ngithub.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).updateProjectPRStatus\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:169\ngithub.com/runatlantis/atlantis/server/events.(*ProjectOutputWrapper).Plan\n\tgithub.com/runatlantis/atlantis/server/events/project_command_runner.go:149\ngithub.com/runatlantis/atlantis/server/events.RunAndEmitStats\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:39\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Plan\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:13\ngithub.com/runatlantis/atlantis/server/events.runProjectCmdsParallel.func1\n\tgithub.com/runatlantis/atlantis/server/events/project_command_pool_executor.go:28"}
{"level":"info","ts":"2022-06-23T19:14:28.794Z","caller":"events/working_dir.go:208","msg":"creating dir \"/root/.atlantis/repos/myorg/myrepo/47/default\"","json":{"repo":"myorg/myrepo","pull":"47"}}
{"level":"debug","ts":"2022-06-23T19:14:29.478Z","caller":"metrics/debug.go:52","msg":"timer","json":{"name":"atlantis.github.update_status.execution_time","value":0.342609789,"tags":{},"type":"timer"}}
{"level":"error","ts":"2022-06-23T19:14:29.478Z","caller":"events/instrumented_project_command_runner.go:43","msg":"Error running plan operation: running git clone --branch update-ecs-amis --depth=1 --single-branch https://x-access-token:<redacted>@github.com/myorg/myrepo.git /root/.atlantis/repos/myorg/myrepo/47/default: Cloning into '/root/.atlantis/repos/myorg/myrepo/47/default'...\nfatal: Unable to read current working directory: No such file or directory\nfatal: fetch-pack: invalid index-pack output\n: exit status 128","json":{"repo":"myorg/myrepo","pull":"47"},"stacktrace":"github.com/runatlantis/atlantis/server/events.RunAndEmitStats\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:43\ngithub.com/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Plan\n\tgithub.com/runatlantis/atlantis/server/events/instrumented_project_command_runner.go:13\ngithub.com/runatlantis/atlantis/server/events.runProjectCmdsParallel.func1\n\tgithub.com/runatlantis/atlantis/server/events/project_command_pool_executor.go:28"}

image

@jamengual jamengual restored the revert-1704-delete_locks_and_workdirs_with_potentially_stale_previous_plans_which_fixes_1624 branch June 24, 2022 00:22
@jamengual
Copy link
Contributor Author

I merged by mistake but if I remember correctly was because of the last comment : #1633

@ascandella
Copy link
Contributor

Gotcha. Did you want to merge this revert, or should I open an issue for the behavior I’m seeing on the latest prerelease?

@jamengual
Copy link
Contributor Author

jamengual commented Jun 25, 2022 via email

…_potentially_stale_previous_plans_which_fixes_1624
@jamengual jamengual merged commit 77706cb into master Jun 29, 2022
@jamengual jamengual deleted the revert-1704-delete_locks_and_workdirs_with_potentially_stale_previous_plans_which_fixes_1624 branch June 29, 2022 00:54
@jamengual
Copy link
Contributor Author

jamengual commented Jun 29, 2022

Gotcha. Did you want to merge this revert, or should I open an issue for the behavior I’m seeing on the latest prerelease?

New prerelease has this reverted, please test and report back. Thanks

@ascandella
Copy link
Contributor

@jamengual just tested the latest prerelease and can confirm that the issue I saw above is fixed. Thanks!

krrrr38 pushed a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
@nitrocode nitrocode added this to the v0.19.5 milestone Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants