-
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
GitLab 400 Error on apply #1356
Comments
Same here, any updates? @stafot |
Nope to be honest. |
those are comments on your PR or messages in the log on the Atlantis server? |
@jamengual Exactly. |
and does atlantis still works? |
Yes |
Then My guess the gitlab api got updated and now this "enqueue" thing is in deprecating mode. |
Good guess, I have the issue since updating to Gitlab 13.9.1 |
I had the issue with 13.6.x. Today upgraded to 13.9.1 but didn't retry |
Did you have any luck resolving it @Platou ? |
I think it stopped doing this... I’ll have to double check |
I'm at 13.9 and I an experiencing this problem. Atlantis plan works, but apply does not. I can only apply via "-p" option. |
I also upgrade to latest Gitlab and the problem persists. |
@esn89 could you elaborate more the |
applying things per project. so for example: atlantis apply -p nameofproject1 |
@esn89 we did some troubleshooting with @stafot The problem seems to happen when you try to use Atlantis has a prerequisite to find in the working directory the pending plan. Here is the code for this https://github.com/runatlantis/atlantis/blob/master/server/events/project_command_builder.go#L361-L389 |
Thanks for your reply. Right now, I am not using any Is it possible for you to post your atlantis.yaml? |
@esn89 The version: 3
automerge: true
projects:
- dir: .
apply_requirements: [approved, mergeable]
workflow: core The server repo config for atlantis: repos:
- id: /.*/
apply_requirements: ["approved", "mergeable"]
allowed_overrides: [apply_requirements, workflow]
allow_custom_workflows: true
workflows:
default:
plan:
steps: [init, plan]
apply:
steps: [apply]
core:
plan:
steps:
- run: AWS_PROFILE="cloud-team" terraform init
- run: AWS_PROFILE="cloud-team" terraform plan
apply:
steps:
- run: AWS_PROFILE="cloud-team" terraform apply |
Any fix for this?
|
I had a theory, how to reproduce this one. I have a MR with 3 dirs to plan/apply. 1 of them is directory where I removed tf and terragrunt.hcl files. Atlantis is expected apply on dir with deleted files. So even i run plan + apply on 2 dirs with tf files, atlantis anyway expects to run apply and send "pending" to gitlab commits status api call. Based on https://gitlab.com/gitlab-org/gitlab-foss/-/issues/25807. When atlantis sends "pending" event, its get queued on some internal gitlab's queue and rejects. |
I am experiencing a similar issue with Atlantis version 0.17.2 custom workflow repos.yaml
Error
|
This issue has been open for more than 6 months, did anyone find the solution to this problem? |
If i remove all the custom workflow from |
are you using |
No
And this is how i start my atlantis server
|
are you setting TF_CLI_ARGS in that tf-pre-init.sh script?
…On Tue, Oct 26, 2021 at 10:57 AM josephlim75 ***@***.***> wrote:
No -out flag. If I just have my repos.yaml below without the custom
workflow, it works
repos:
- id: "/.*/"
pre_workflow_hooks:
- run: /opt/epsoft/terraform/atlantis/tf-pre-init.sh
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1356 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERD6G5IZFFU4TQXY33TUI3TWZANCNFSM4WIOSY2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Nope, my Below is just a part of the script but the main purpose is to clone additional repository.
|
I do not know if you have tried with the new atlantis version and gitlab
version? I do not use gitlab so I do not know what is the combination here
that is causing this issue but if all gitlab users had this issue I'm
pretty sure we will know about it so there must be something related to the
setup that is causing this issue.
…On Tue, Oct 26, 2021 at 11:04 AM josephlim75 ***@***.***> wrote:
Nope, my tf-pre-init.sh is just to checkout other repos because my
terraform scripts are relying some of the configuration. The script is
purely checking if the external repo is not clone, make sure it clone first
before running the terraform script.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1356 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERG7QTVU2KUXLRFFCGLUI3URPANCNFSM4WIOSY2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
The latest The following link is not working, but works for the rest of version |
we will be fixing the link, thanks for letting us know.
…On Tue., Oct. 26, 2021, 1:54 p.m. josephlim75, ***@***.***> wrote:
The latest 0.17.4 binary is not downloadable. Doesn't seems to have build
the binary. I can try 0.17.3
The following link is not working, but works for the rest of version
https://github.com/runatlantis/atlantis/releases/download/v0.17.4/atlantis_linux_arm64.zip
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1356 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERDARW2ZYSIOGIB5GYTUI4IR5ANCNFSM4WIOSY2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi!
Also, I can see this log inside the atlantis container:
I wonder if it has something to do with terraform/terragrunt versions, or if is directly related to the message: |
Looks like Atlantis is not the only one having issues with this :
https://gitlab.com/gitlab-org/gitlab-foss/-/issues/25807
jenkinsci/gitlab-plugin#885
jenkinsci/gitlab-plugin#885
…On Wed, Oct 27, 2021 at 1:26 PM Ericksson Faustino ***@***.***> wrote:
Hi!
I'm having this problem right now using it with gitlab.com
My plan work, but when I try to apply, I got this in the PR:
Ran Apply for dir: global/aws_organization workspace: global_aws_organization
Found no template. This is a bug!
Also, I can see this log inside the atlantis container:
{"level":"info","ts":"2021-10-27T20:23:50.160Z","caller":"events/events_controller.go:417","msg":"parsed comment as command=\"apply\" verbose=true dir=\"us-east-1/vpc/dev\" workspace=\"us-east-1_vpc_dev\" project=\"\" flags=\"\"","json":{}}
{"level":"info","ts":"2021-10-27T20:23:50.823Z","caller":"runtime/pre_workflow_hook_runner.go:50","msg":"successfully ran \"terragrunt-atlantis-config generate --output atlantis.yaml --autoplan --parallel --create-workspace\" in \"/home/atlantis/.atlantis/repos/memed/sre/terraform-foundation/10/default\"","json":{"repo":"memed/sre/terraform-foundation","pull":"10"}}
{"level":"warn","ts":"2021-10-27T20:23:51.172Z","caller":"events/apply_command_runner.go:94","msg":"unable to update commit status: POST https://gitlab.com/api/v4/projects/memed/sre/terraform-foundation/statuses/e3aaf069b48ad1e5cf9a7c1acb266a9554949be6: 400 {message: Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via \"enqueue\")}","json":{"repo":"memed/sre/terraform-foundation","pull":"10"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\t/home/circleci/project/server/events/apply_command_runner.go:94\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\t/home/circleci/project/server/events/command_runner.go:214 <http://github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run%5Cn%5Ct/home/circleci/project/server/events/apply_command_runner.go:94%5Cngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand%5Cn%5Ct/home/circleci/project/server/events/command_runner.go:214>"}
{"level":"info","ts":"2021-10-27T20:23:52.212Z","caller":"events/apply_command_runner.go:110","msg":"pull request mergeable status: true","json":{"repo":"memed/sre/terraform-foundation","pull":"10"}}
{"level":"info","ts":"2021-10-27T20:23:52.213Z","caller":"events/project_command_context_builder.go:240","msg":"cannot determine which version to use from terraform configuration, detected 0 possibilities.","json":{"repo":"memed/sre/terraform-foundation","pull":"10"}}
{"level":"info","ts":"2021-10-27T20:23:52.213Z","caller":"events/apply_command_runner.go:141","msg":"Running applies in parallel","json":{"repo":"memed/sre/terraform-foundation","pull":"10"}}
I wonder if it has something to do with terraform/terragrunt versions, or
if is directly related to the message:
400 {message: Cannot transition status via :enqueue from :pending
(Reason(s): Status cannot transition via \"enqueue\")}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1356 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERFHOPESHQGDTLHB2OTUJBN6BANCNFSM4WIOSY2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Honestly, I'm not sure the issue is at gitlab or atlantis. I have changed my
|
💡 Hope it will be helpful, I've fixed my custom workflow by generating a plan file ( In case of shell: PLAN_FILE=$(pwd | awk -F"/" '{print $NF}')-default.tfplan and Makefile: PLAN_FILE := $(shell pwd | awk -F"/" '{print $$NF}')-default.tfplan The minimalistic Makefile would look like this: TERRAFORM = terraform${ATLANTIS_TERRAFORM_VERSION}
export TF_IN_AUTOMATION := true
PLAN_FILE := $(shell pwd | awk -F"/" '{print $$NF}')-default.tfplan
init:
@${TERRAFORM} init -no-color
plan:
@${TERRAFORM} plan -no-color -out ${PLAN_FILE}
apply:
@${TERRAFORM} apply -no-color ${PLAN_FILE}
|
@ivanilves Also, for your $PLAN_FILE value, what is it supposed to be? |
I have the same issue, atlantis v0.17.5 . In my case I am running custom workflows with terragrunt. gitlab version {"level":"warn","ts":"2021-12-09T15:19:13.379Z","caller":"events/apply_command_runner.go:94","msg":"unable to update commit status: POST https://somegitlabserver/api/v4/projects/myproject/statuses/5a7c6bbddb2f1e99e3e2936e66bd76a5a3a7a920: 400 {message: Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via \"enqueue\")}","json":{"repo":"some/gitlab/repo/project","pull":"145"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\t/home/circleci/project/server/events/apply_command_runner.go:94\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\t/home/circleci/project/server/events/command_runner.go:214"} |
PRs are welcome!!! most of Atlantis maintainers are using github so If any
of you want to take a look at this and see if the gitlab api changed and
maybe fix this we will be more than welcome to review it.
…On Sat., Dec. 11, 2021, 6:39 a.m. Jonathan Colby, ***@***.***> wrote:
I have the same issue, atlantis v0.17.5 . In my case I am running custom
workflows with terragrunt.
{"level":"warn","ts":"2021-12-09T15:19:13.379Z","caller":"events/apply_command_runner.go:94","msg":"unable to update commit status: POST https://somegitlabserver/api/v4/projects/myproject/statuses/5a7c6bbddb2f1e99e3e2936e66bd76a5a3a7a920: 400 {message: Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via \"enqueue\")}","json":{"repo":"olxeu/u2u/chat/chat-terraform-infrastructure","pull":"145"},"stacktrace":"github.com/runatlantis/atlantis/server/events.(*ApplyCommandRunner).Run\n\t/home/circleci/project/server/events/apply_command_runner.go:94\ngit.luolix.top/runatlantis/atlantis/server/events.(*DefaultCommandRunner).RunCommentCommand\n\t/home/circleci/project/server/events/command_runner.go:214"}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1356 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ3ERAIX2RR3FEJYIZR25DUQNPCVANCNFSM4WIOSY2Q>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
does anyone have this issue constantly to the point that renders Atlantis basically useless? if someone has the time to be more proactive in debugging this, maybe we can offer some help but without that, it is impossible for us to replicate the exact scenario. |
My GitLab MR was stuck in The problem here is that the status is trying to go from I fixed that by changing it to curl --request POST --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" "https://gitlab.com/api/v4/projects/PROJECTID/statuses/COMMITSHA?state=running&name=atlantis%2Fapply" And then to curl --request POST --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" "https://gitlab.com/api/v4/projects/PROJECTID/statuses/COMMITSHA?state=success&name=atlantis%2Fapply" ISTM if the |
I’m finding the plan works fine, but Atlantis logs the following warning on the subsequent apply: Unable to update commit status: POST https://gitlab[redacted]: 400 {message: Cannot transition status via :enqueue from :pending (Reason(s): Status cannot transition via "enqueue")}
Helm chart version: 3.12.4
VCS: Gitlab
Result: The pipeline gets stuck to pending forever.
ref. runatlantis/helm-charts#27
The text was updated successfully, but these errors were encountered: