-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 fails to create new stack workspaces with s3 backend #1517
Comments
Seeing this as well with atlantis v0.16.1 and terraform 0.13.5. |
Can confirm same issue with atlantis v0.16.1, terraform 0.13.6 and GCS backend |
@nishkrishnan @lkysow Do you mind if I raise a PR to revert #1363? I believe it did more harm than good by setting a custom Terraform control variable to a non-default value and must be reverted. It broke Terraform workspaces which now require a workaround to work at all. Users requiring TF_WORKSPACE to be set are free to set it manually via a custom workflow or system-wide and have full control over the value. I see no reason why it should be set by Atlantis to a fixed non-default value, in the same manner as other TF_ variables are neither set nor changed by Atlantis. Making this change might break some existing workflows that rely on #1363, in the same fashion as #1363 broke my and other people's workflows. I believe if it is clearly mentioned in Release Notes as a breaking change (unlike #1363 which was a surprise), the impact should be minimal. |
The workaround does not work for me. I set TF_WORKSPACE to an empty value in both plan and apply in my workflow. Plan works, apply throws this if I try to set my own workspace in atlantis.yaml:
If I don't set a workspace:
|
Apparently your Atlantis starts its It is criticial that your custom workflow runs Repo-level atlantis.yaml: version: 3
automerge: false
projects:
- name: dev
dir: .
workflow: dev
workspace: dev
autoplan:
enabled: true Custom workflow in repos.yaml: workflows:
dev:
plan:
steps:
- init
- plan
apply:
steps:
- apply |
The problem seems to happens before the apply workflow is called, in fact the error seems to came from buildProjectApplyCommand in project_command_builder.go as it expect the workspae to be passed on the CommentCommand, but if is not passed it assumes the DefaultWorkspace (which is 'default') instead of reading that name from the actual workspace in use by terraform. |
Fixes runatlantis#1517 and basically is a rebased version of runatlantis#1578.
Fixes runatlantis#1517 and basically is a rebased version of runatlantis#1578.
After updating to
runatlantis/atlantis:latest
~ 0.17-beta we found that we where unable to create new workspaces beyonddefault
. Creation of workspaces would fail withThis reproduces with terraform
0.14.7
0.14.10
and0.13.6
It seems that introducing
TF_WORKSPACE
in #1363 causes a long standing bug with terraform to resurface (hashicorp/terraform#26127)This can be worked around by causing
TF_WORKSPACE
to become unset. This is accomplished by changing the workflow envThe text was updated successfully, but these errors were encountered: