49

I've enabled the option - Settings/General/Merge Requests/Merge Checks - Pipelines must succeed.

Since then every merge requests automatically starts execution of the pipeline which is actually what i want. The problem is that this is running forever , i'm receiving message : Checking pipeline status If i run the pipeline manually from CI/CD Pipelines - Run pipeline finish immediately. I don't understand what is wrong and why it stuck , can i check logs somewhere or something ?

For testing , the pipeline is really simple , just exit 1 .. but still not working ..

At this stage , "running pipeline" is not listed in pipeline list even if the status in merge request is

Checking pipeline status

Liam
  • 27,717
  • 28
  • 128
  • 190
Harry Birimirski
  • 858
  • 1
  • 8
  • 21
  • I have the same issue: it's really frustrating.. I feel you – polortiz40 Mar 11 '21 at 05:19
  • @Harry Biriminski. Did you find out anything? I have a similar issue (with no pipelines configured at all). If you google for it, you'll find some related issues from others. I think this one contains most of the topics: https://gitlab.com/gitlab-org/gitlab/-/issues/229738 – Kai Huppmann Mar 15 '21 at 08:47
  • I am experiencing that issue, but while I am looking for help and ended up in that subject here, I concluded Gitlab is just slow, it seems to have a huge delay (several minutes) between the message "Checking pipeline status" and it have created a new pipeline. – Luciano Mar 14 '22 at 19:20
  • disabling the option fixed it for me `Settings/General/Merge Requests/Merge Checks - Pipelines must succeed` – Aziz Jun 21 '23 at 21:17

12 Answers12

12

We ran into a case where a merge request does not contain the .gitlab-ci.yml file. The fix is simply to do a rebase

For troubleshooting purposes, pipelines can be run manually on particular branches at CI/CD -> Pipelines -> Run Pipeline

Poh Zi How
  • 1,489
  • 3
  • 16
  • 38
  • In my case, the `.gitlab-ci.yml` file was empty on the `master` branch. Getting a non-empty one into master seemed to fix it. Thank you for the hint! – K.Sy Dec 20 '21 at 01:15
10

For me what happened that .gitlab-ci.yml file was having issue as I have mentioned "master" as value for "only" label .. , then everything worked after updating it with my correct branch name which IMO should be "main"

vikanksh nath
  • 359
  • 3
  • 5
  • For me it was the same, the specific directory I was updating was not mentioned in the "only" configuration in `gitlab-ci.yml` – Tomor May 02 '22 at 15:10
7

Encountered this myself just now, using Gitlab shared runners. Tried re-running one individual job from the pipeline in the hope that it would resolve the issue. It did not. The best way is to change the commit id of the latest change in the MR. You can either create an empty commit as suggested by @Bhargav11 or, to keep a cleaner commit history, do

$ git commit --amend --no-edit
$ git push --force

on your branch.

Marcus Ilgner
  • 6,935
  • 2
  • 30
  • 44
7

This happens to me with pipelines that has no job that triggers on merge-requests.

If I have no tests or anything I wish to run during a merge requests I create a "dummy" job that doesn't do anything.

Rule to trigger on merge requests:

rules:
    - if: $CI_PIPELINE_SOURCE == 'merge_request_event'

Then add a simple echo in the script section:

script: echo "Dummy job for merge-request"
Kilathaar
  • 91
  • 1
  • 3
  • 2
    Will be solved in https://gitlab.com/gitlab-org/gitlab/-/issues/334281. For now you can also disable *Settings -> Merge requests -> Pipelines must succeed* option. – iOS Feb 23 '23 at 10:06
3

From GitLab documentation: "Checking pipeline status" message

This message is shown when the merge request has no pipeline associated with the latest commit yet. This might be because:

  • GitLab hasn't finished creating the pipeline yet

  • You are using an external CI service and GitLab hasn't heard back from the service yet.

  • You are not using CI/CD pipelines in your project.

  • You are using CI/CD pipelines in your project, but your configuration prevented a pipeline from running on the source branch for your merge request.

  • The latest pipeline was deleted (this is a known issue).

Hamza AZIZ
  • 2,582
  • 1
  • 9
  • 18
3

check if current branch you are checking the pipeline status and branch specified in "only: field" are same

  only:
    - master

enter image description here

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • 3
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 19 '22 at 14:44
2

Just add an empty commit to trigger it again.

git commit -n -m "commit comment"
2

In our case, simply creating a copy of the branch (git checkout -b new-branch-name) and making a new MR with the identical code allowed us to work around the issue. The new MR pipeline executed successfully.

dokkaebi
  • 71
  • 3
  • thank you! This was the only thing which fixed my situation. Must have been some weird state gitlab got itself into. I just had to copy my dev branch to dev-2 and then delete dev, and create it again from dev-2. Then it magically started working again.. EDIT: nevermind.. this did in fact not work, just that creating a new branch triggers the pipeline – Matthias Mar 09 '23 at 11:31
1

I found what was wrong in my case. The problem was with the runners. There was "Shared runners" enabled by default which caused the confusion. I've just disabled them and enable my own runner and everything started to work as expected. You can check this in CI / CD Settings, I think they are enabled by default. Basically , pipelines are nothing more than a trigger for the runner... then the runner is responsible for the execution.

Wayne Walker
  • 2,316
  • 3
  • 23
  • 25
Harry Birimirski
  • 858
  • 1
  • 8
  • 21
0

In my case, I had made a typo on the filename and had forgotten to add a dot before it.

Please ensure the filename is .gitlab-ci.yml

How did I debug this?

On the GitLab UI, I went into CI/CD editor and couldn't see my file.

swateek
  • 6,735
  • 8
  • 34
  • 48
0

I had made sure it was allowing the correct branch, however I had it detecting only changes for a subset of files, not including the gitlab-ci.yml file..

  only:
    changes:
      - files/**/*

which meant it didn't trigger when changing it. Removing those lines solved the issue for me.

Matthias
  • 3,160
  • 2
  • 24
  • 38
0

Rebasing my branch to the original resolved this issue for me.

git rebase -i pull push

Roger
  • 427
  • 4
  • 13