gitlab-branch-source-plugin icon indicating copy to clipboard operation
gitlab-branch-source-plugin copied to clipboard

Multi Branch Job Executed in jenkins but Pipeline status is still running state in GitLab

Open prasad-clouduser opened this issue 1 year ago • 7 comments

Jenkins and plugins versions report

Environment
Paste the output here

What Operating System are you using (both controller, and any agents involved in the problem)?

GitLab deployed on VM (RHEL)

Reproduction steps

  1. Created GitLab server connection with detected the Projects in GitLab. (Added webhook config)
  2. Created a multi branch pipeline using this plugin and discovered the branches.
  3. Open a merge request in GitLab project and trigger the Multi Branch Pipeline.
  4. Multi Branch Pipeline detected the Open MR and Ran the Job and completed successfully.
  5. But in GitLab It is showing Pipeline is still in running state because of which can't merge the MR (unless pipeline status shows as success in Gitlab)

Expected Results

Pipeline in GitLab should display the status and allow the merge request to merge successfully.

Actual Results

Pipeline is always in Running State and not displaying the success or failure status.

Anything else?

No response

Are you interested in contributing a fix?

No response

prasad-clouduser avatar Jan 31 '24 13:01 prasad-clouduser

PIC See the screenshot, which is still running state even though pipeline is completed in Jenkins.

prasad-clouduser avatar Jan 31 '24 13:01 prasad-clouduser

We are also encountering this issue from time to time. See my comment at https://issues.jenkins.io/browse/JENKINS-70010?focusedId=443439&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-443439 Could this be the reason for you as well?

lmife avatar Feb 01 '24 14:02 lmife

In the console log, the [GitLab Pipeline Status] Notified message will be missing. Normally, a build should end like this:

[GitLab Pipeline Status] Notifying branch build status: SUCCESS build/name #17: This commit looks good.
[GitLab Pipeline Status] Notified
Finished: SUCCESS

lmife avatar Feb 01 '24 14:02 lmife

https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/395

In the console log, the [GitLab Pipeline Status] Notified message will be missing. Normally, a build should end like this:

[GitLab Pipeline Status] Notifying branch build status: SUCCESS build/name #17: This commit looks good.
[GitLab Pipeline Status] Notified
Finished: SUCCESS

Check this one more issue I opened yesterday, when I opened custom script, it was not returning the status. https://github.com/jenkinsci/gitlab-branch-source-plugin/issues/395

prasad-clouduser avatar Feb 01 '24 14:02 prasad-clouduser

we experience the exact same thing here.

we also see this in the logs: image

banholzer avatar Feb 20 '24 16:02 banholzer

Hi @banholzer ,

I'm not sure if this is the same error. We had error with jersey library too before. It was because 2 Jenkins plugins using this library but with different version. We delete artifactory plugin et it works after.

Turiok avatar Jul 20 '24 19:07 Turiok

Not sure if it applies to the situation of the Issue creator, but we encountered this never-ending "Running" issue when multiple Jenkins instances were set up with Organization Folders for the same GitLab namespaces. i.e. in the "Webhooks" section of my GitLab projects, there were two separate webhooks for two different Jenkins URLs. I didn't bother investigating exactly why that situation was problematic because I didn't want or need two Jenkins instances building my projects -- it was inadvertently added. Removing the second webhook and/or removing duplicate Org Folder solved the issue.

We also noticed the stuck "Running" state under some unknown circumstances when a git push was quickly followed by a Merge Request creation using that source branch, while the source branch build was still in-progress. It seemed to have some relation to the selected gitLabBranchDiscovery strategy (https://github.com/jenkinsci/gitlab-branch-source-plugin/tree/master?tab=readme-ov-file#default-traits). Unfortunately, I can't explain that in any more detail because I never looked into it in depth.

egherrmann avatar Aug 09 '24 20:08 egherrmann