You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 application of changes fails when there is a dependency between 2 modules, and the dependent one doesn't have any change. A plan runs fine, it shows no changes. But then atlantis apply fails with Apply Failed: Can't apply your project unless you apply its dependencies:.
The wrong behavior is clear from Atlantis comments:
1st comment
Notice the plans ran for 2 projects but changes are in the first one only.
Ran Plan for 2 projects:
project: project1 dir: project1_dir workspace: default
project: project2 dir: project2_dir workspace: default
1. project: project1 dir: project1_dir workspace: default
Show Output
Plan: 0 to add, 1 to change, 0 to destroy.
2nd comment
atlantis apply
3rd comment
Changes are applied in the first project, that's correct. But for some reason it wants to try to apply changes in the second project even when there is no change from the plan.
Also it's strange that it can't apply changes in the 2nd project because the changes in the 1st project hasn't been applied. But as it can be seen in the output, the changes in the first project were applied.
{"level":"error","ts":"2024-10-05T23:11:48.884+0200","caller":"events/instrumented_project_command_runner.go:84","msg":"Failure running apply operation: Can't apply your project unless you apply its dependencies: [project1]","json":{"repo":"<org>/<repo>","pull":"1207"},"stacktrace":"github.com/runatlantis/atlantis/server/events.RunAndEmitStats\n\t/tmp/atlantis/server/events/instrumented_project_command_runner.go:84\ngit.luolix.top/runatlantis/atlantis/server/events.(*InstrumentedProjectCommandRunner).Apply\n\t/atlantis/server/events/instrumented_project_command_runner.go:46\ngit.luolix.top/runatlantis/atlantis/server/events.runProjectCmdsParallel.func1\n\t/atlantis/server/events/project_command_pool_executor.go:29"}
Environment details
Additional Context
At the end of this section in docs is mentioned the Apply Failed: Can't apply your project unless you apply its dependencies: error but it's not clear under what circumstances the error is triggered.
I would expect that if there is a change for the first project only, then atlantis apply applies changes in this project only and doesn't try to apply them in a dependent project with no change.
The text was updated successfully, but these errors were encountered:
Hello @pavelpulec! I'm here to help you with any bugs, questions, or contributions you have. Let's work together to solve the issue you're facing.
A similar issue has been discussed where atlantis apply fails with the error "Can't apply your project unless you apply its dependencies" even when there are no changes in a dependent module. This behavior occurs because Atlantis requires all dependencies to be in an "applied" state or have no changes to apply before proceeding with the apply operation [1].
The logic behind this is implemented in the ValidateProjectDependencies method, which checks if all dependencies have been applied or have no changes planned. If any dependency is not in the AppliedPlanStatus or PlannedNoChangesPlanStatus, the apply will fail with the mentioned error [2].
There is no configuration option in Atlantis to ignore dependencies with no changes during the apply process, as per the available information [1].
The logic behind this is implemented in the ValidateProjectDependencies method, which checks if all dependencies have been applied or have no changes planned.
That's exactly the issue I want to raise. There are no changes planned but the application fails anyway.
Community Note
Overview of the Issue
The application of changes fails when there is a dependency between 2 modules, and the dependent one doesn't have any change. A plan runs fine, it shows no changes. But then
atlantis apply
fails withApply Failed: Can't apply your project unless you apply its dependencies:
.The wrong behavior is clear from Atlantis comments:
1st comment
Notice the plans ran for 2 projects but changes are in the first one only.
2nd comment
3rd comment
Changes are applied in the first project, that's correct. But for some reason it wants to try to apply changes in the second project even when there is no change from the plan.
Also it's strange that it can't apply changes in the 2nd project because the changes in the 1st project hasn't been applied. But as it can be seen in the output, the changes in the first project were applied.
Reproduction Steps
Logs
Logs
Environment details
Additional Context
At the end of this section in docs is mentioned the
Apply Failed: Can't apply your project unless you apply its dependencies:
error but it's not clear under what circumstances the error is triggered.I would expect that if there is a change for the first project only, then
atlantis apply
applies changes in this project only and doesn't try to apply them in a dependent project with no change.The text was updated successfully, but these errors were encountered: