[JIRA] (JENKINS-38447) Bitbucket hooks don't work for Pipeline jobs

45 views
Skip to first unread message

jorrith@crowdynews.com (JIRA)

unread,
Sep 22, 2016, 9:17:01 AM9/22/16
to jenkinsc...@googlegroups.com
Jorrith Schaap created an issue
 
Jenkins / Bug JENKINS-38447
Bitbucket hooks don't work for Pipeline jobs
Issue Type: Bug Bug
Assignee: Unassigned
Components: bitbucket-plugin
Created: 2016/Sep/22 1:16 PM
Environment: Running Ubuntu 14.04.5 LTS with Jenkins 2.23 and latest bitbucket plugin
Priority: Minor Minor
Reporter: Jorrith Schaap

I’ve created a Jenkins Pipeline and now I want to run it automatically once Bitbucket receives a new push to master. Problem is that the Bitbucket webhook works fine for a regular freestyle build, but not for a Pipeline job with a Pipeline script from SCM.

The logs in Bitbucket show that the request succeeded (returns http 200), but in Jenkins I don’t see anything happen, also not in the bitbucket hook log. The Bitbucket hook log in jenkins says ‘Polling has not run yet.’ for a pipeline job, no matter how often scm requests were made. For a freestyle job the hooks work instantly, so it seems to be a problem with the particular Jenkins job type.

Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

hendrik@brinkmann.one (JIRA)

unread,
Oct 7, 2016, 4:00:03 AM10/7/16
to jenkinsc...@googlegroups.com
Hendrik Brinkmann commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

Same problem "normal" Jobs are triggered by Bitbucket-Webhooks but Pipeline-Jobs do not work. It seems that Jenkins ignores the Git-Repo-Config at "Pipeline script from SCM" and cannot match the webhook to any job.

Bitbucket error message (see also my screenshot):

Error: Jenkins response: No Git consumers using SCM API plugin for: ssh://git@**********.git

hendrik@brinkmann.one (JIRA)

unread,
Oct 7, 2016, 4:02:50 AM10/7/16
to jenkinsc...@googlegroups.com

hendrik@brinkmann.one (JIRA)

unread,
Oct 7, 2016, 4:06:01 AM10/7/16
to jenkinsc...@googlegroups.com

hendrik@brinkmann.one (JIRA)

unread,
Oct 7, 2016, 4:07:02 AM10/7/16
to jenkinsc...@googlegroups.com
Hendrik Brinkmann edited a comment on Bug JENKINS-38447
Same problem "normal" Jobs are triggered by Bitbucket-Webhooks but Pipeline-Jobs do not work. It seems that Jenkins ignores the Git-Repo-Config at "Pipeline script from SCM" and cannot match link the webhook to any job.


Bitbucket error message (see also my screenshot):

{code:none}

Error: Jenkins response: No Git consumers using SCM API plugin for: ssh://git@**********.git
{code}

john_stephenson_uk@hotmail.com (JIRA)

unread,
Oct 13, 2016, 7:36:04 AM10/13/16
to jenkinsc...@googlegroups.com

I too can't get this to work. I'm using the cloudbees-bitbucket-branch-source and can't see where I can correctly configure the triggers. From the wiki :

freeStyleJob('test-job') {
  triggers {
    bitbucketPush ( )
  }
}

But my JenkinsFile looks like this (edited):

node {
   /*  triggers{
    bitbucketPush()
  }*/

    stage('Checkout'){
      checkout scm
    }
    stage('Build client') {
      dir('./client') {
        sh 'npm run build'
      }
    }
}

If this can't work with the cloudbees-bitbucket-branch-source plugin it would be good to know and advertise this on the wiki page. Alternative approaches would be appreciated too!

Thanks,
John

hendrik@brinkmann.one (JIRA)

unread,
Oct 20, 2016, 5:19:01 AM10/20/16
to jenkinsc...@googlegroups.com

Its an essential feature. Without Webhooks Jenkins is barely applicable for our integration workflow. Will this bug/ missing feature be fixed soon?

jorrith@crowdynews.com (JIRA)

unread,
Oct 24, 2016, 8:56:01 AM10/24/16
to jenkinsc...@googlegroups.com

For my Jenkins jobs I had both SCM polling and Bitbucket hooks enabled. At some point, after a few builds triggered by the polling, the Bitbucket plugin apparently picked up where the git project was located and I could use the hooks from that moment and disable the polling.

For other projects with the same setup, the Bitbucket logs still show that it's not running and therefore these are still running with polling. Not sure about what is exactly causing this, but I hope it helps.

john_stephenson_uk@hotmail.com (JIRA)

unread,
Oct 24, 2016, 10:32:01 AM10/24/16
to jenkinsc...@googlegroups.com

Thanks for these responses. I'm up and running sort of. I had 2 issues:

1. I was running in AWS and forgot that I need to allow the incoming ports from bitbucket (described here
2. The polling flags where not on

It's strange, as I have a 'run a build every 2 hours regardless of changes pending' setup and it's only building when a change happens. Spent so much time on this, I can't afford to invest any more effort in it ATM.

FWIW, I still think the wiki needs work.

hendrik@brinkmann.one (JIRA)

unread,
Nov 30, 2016, 2:55:01 AM11/30/16
to jenkinsc...@googlegroups.com

hendrik@brinkmann.one (JIRA)

unread,
Dec 2, 2016, 8:33:01 AM12/2/16
to jenkinsc...@googlegroups.com
Hendrik Brinkmann updated an issue
Change By: Hendrik Brinkmann
Component/s: git-plugin
Component/s: scm-api-plugin

JPLemelin@gmail.com (JIRA)

unread,
Dec 5, 2016, 10:31:01 AM12/5/16
to jenkinsc...@googlegroups.com
JP Lemelin commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

When I try to save PipeLine job, with a Bitbucket Pull Request Builder, I got a stack trace with exception:

java.lang.ClassCastException: org.jenkinsci.plugins.workflow.job.WorkflowJob cannot be cast to hudson.model.AbstractProject

It seem the pugin does'nt support PipeLine yet with "Bitbucket Pull Request Builder", it work weel with a Freestyle project.

bel_sander@hotmail.com (JIRA)

unread,
Feb 28, 2017, 8:04:03 AM2/28/17
to jenkinsc...@googlegroups.com

Is this issue being addressed for a future release of Jenkins? I'm facing the same issue with a "pipeline script from SCM". The integration with BitBucket works perfectly fine for a regular job though.

mcneary70@gmail.com (JIRA)

unread,
Feb 28, 2017, 1:56:01 PM2/28/17
to jenkinsc...@googlegroups.com

In the same spot. Freestyle jobs work fine, but the webhooks won't trigger my pipelined jobs.

abedwardsw@gmail.com (JIRA)

unread,
Feb 28, 2017, 8:00:02 PM2/28/17
to jenkinsc...@googlegroups.com
Adam commented on Bug JENKINS-38447

same here, also couldn't get it to work.

stephen.alan.connolly@gmail.com (JIRA)

unread,
Mar 1, 2017, 5:11:03 AM3/1/17
to jenkinsc...@googlegroups.com
Stephen Connolly updated an issue
 
Change By: Stephen Connolly
Labels: scm-api-tidy-scrub

JPLemelin@gmail.com (JIRA)

unread,
Mar 4, 2017, 7:27:03 PM3/4/17
to jenkinsc...@googlegroups.com
JP Lemelin commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

If you want to use a Pipeline with Bitbucket and Pull Request, just use multibranch project with Bitbucket Branch Source plugin 

It really simple to setup: https://jenkins.io/doc/book/pipeline/multibranch/

Plugin: https://plugins.jenkins.io/cloudbees-bitbucket-branch-source

 

This message was sent by Atlassian JIRA (v7.3.0#73011-sha1:3c73d0e)
Atlassian logo

JPLemelin@gmail.com (JIRA)

unread,
Mar 6, 2017, 1:13:03 PM3/6/17
to jenkinsc...@googlegroups.com
JP Lemelin edited a comment on Bug JENKINS-38447
If you want to use a *Pipeline* with *Bitbucket and Pull Request*, just use multibranch project with *Bitbucket Branch Source* plugin 

hendrik@brinkmann.one (JIRA)

unread,
Mar 7, 2017, 3:06:02 AM3/7/17
to jenkinsc...@googlegroups.com

Hello JP Lemelin;

it's a workaround but not really a solution.

hendrik@brinkmann.one (JIRA)

unread,
Mar 8, 2017, 7:53:01 AM3/8/17
to jenkinsc...@googlegroups.com

I testet the multibranch workaround and realized that you can have only one Jenkinsfile named Jenkinsfile for each project. We use serveral Jenkinsfile with different names to provided different types of pipeline (delivery, integration, benchmarks) as long as the Jenkinsfile is not configurable this solution does not work for our workflow.

JPLemelin@gmail.com (JIRA)

unread,
Mar 8, 2017, 2:54:01 PM3/8/17
to jenkinsc...@googlegroups.com

Hi Hendrik Brinkmann

Currently we are using one Jenkinsfile per repository to handle CI/CD. Under a stage we use the condition when to execute the only on a specific branch.

Ex:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                echo 'Build it!'
            }
        }
        stage('Test') {
            steps {
                echo 'Test it!'
            }
        }
        stage('Deploy') {
            when {
                branch 'prod'
            }
                echo 'Deploy it'
            }
        }
    }
}

 

https://jenkins.io/doc/book/pipeline/syntax/#when

hendrik@brinkmann.one (JIRA)

unread,
Mar 10, 2017, 4:02:04 AM3/10/17
to jenkinsc...@googlegroups.com

Thanks for your help but our teams want to maintain the different pipelines in different Jenkinsfiles because it is harder to maintain greate Jenkinsfiles with a lot of case differentations. As soon as the Multibranch Jobs do not support that option this workaround is not applicable for us.

hendrik@brinkmann.one (JIRA)

unread,
Mar 10, 2017, 4:03:03 AM3/10/17
to jenkinsc...@googlegroups.com
Hendrik Brinkmann edited a comment on Bug JENKINS-38447
Thanks for your help but our teams want to maintain the different pipelines in different Jenkinsfiles because it is harder to maintain large Jenkinsfiles with a lot of case differentations differentiations . As soon as the Multibranch Jobs do not support that option this workaround is not applicable for us.

hendrik@brinkmann.one (JIRA)

unread,
Mar 10, 2017, 4:03:03 AM3/10/17
to jenkinsc...@googlegroups.com
Hendrik Brinkmann edited a comment on Bug JENKINS-38447
Thanks for your help but our teams want to maintain the different pipelines in different Jenkinsfiles because it is harder to maintain greate large Jenkinsfiles with a lot of case differentations. As soon as the Multibranch Jobs do not support that option this workaround is not applicable for us.

aburdajewicz@cloudbees.com (JIRA)

unread,
Mar 19, 2017, 4:14:04 AM3/19/17
to jenkinsc...@googlegroups.com

The scenario described in this issue - Bitbucket Plugin + Webhook to Jenkins for Bitbucket - should work. If using this solution, ensure that:

  • *polling is enabled* for your job
  • property *poll* and/or *changelog* is set to true in the checkout/git step (it is by default)

Finally, a *pipeline job need to be run at least once* so that the git notification feature finds the job. See the solution documented there: https://support.cloudbees.com/hc/en-us/articles/226568007-Triggering-a-build-using-hooks-in-Bitbucket-server

There is no bug here as far as I can tell.

aburdajewicz@cloudbees.com (JIRA)

unread,
Mar 19, 2017, 4:14:04 AM3/19/17
to jenkinsc...@googlegroups.com
Allan BURDAJEWICZ edited a comment on Bug JENKINS-38447
The scenario described in this issue - Bitbucket Plugin + [Webhook to Jenkins for Bitbucket |https://marketplace.atlassian.com/plugins/com.nerdwin15.stash-stash-webhook-jenkins/server/overview] - should work. If using this solution, ensure that:

* *
* polling is enabled* * for your job
* property *
* poll* * and/or * * changelog* * is set to true in the checkout/git step (it is by default)

Finally, a *
* pipeline job need to be run at least once* * so that the git notification feature finds the job. See the solution documented there: https://support.cloudbees.com/hc/en-us/articles/226568007-Triggering-a-build-using-hooks-in-Bitbucket-server


There is no bug here as far as I can tell.

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:10:03 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran commented on Bug JENKINS-38447

I am using this webhook https://www.google.com/url?q=https%3A%2F%2Fmarketplace.atlassian.com%2Fplugins%2Fnl.topicus.bitbucket.bitbucket-webhooks%2Fserver%2Foverview&sa=D&sntz=1&usg=AFQjCNEIkxliQurGPnsqmLNtyTU9imgnuA

Recommended by cloubees-bitbucket-branch-source-plugugin.  

It also works with freeslyle job

However, I cant get it to work with pipelie ( i am using declarative pipepline)

there is my check out settings  

    stage ('checkout') {
      steps {
       checkout scm
      }
   }

am I missing any thing?

 

 

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:11:02 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran edited a comment on Bug JENKINS-38447
It also works with freeslyle freestyle job

However, I cant get it to work with
pipelie pipeline ( i am using declarative pipepline)

there this is my check out settings checkout   stage 

    stage ('checkout') \{
      steps \{
       checkout scm
      }
   }

am I missing any thing?

 

 

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:48:02 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran assigned an issue to dan tran
 
Change By: dan tran
Assignee: dan tran

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:49:01 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran assigned an issue to Mark Waite
Change By: dan tran
Assignee: dan tran Mark Waite

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:49:04 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran assigned an issue to Unassigned
Change By: dan tran
Assignee: Mark Waite

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:51:01 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran edited a comment on Bug JENKINS-38447
It also works with freestyle job

However, I cant get it to work
and also with pipeline ( i am using declarative pipepline) pipeline

this This is my checkout what you need   stage

   triggers \{
      //some polling to allow webhook trigger
   
  pollSCM '@daily'
   }

And

   
stage ('checkout') \{

      steps \{
       checkout scm
      }
   }

am I missing any thing?

 

 

dantran@gmail.com (JIRA)

unread,
Mar 19, 2017, 9:52:02 PM3/19/17
to jenkinsc...@googlegroups.com
dan tran edited a comment on Bug JENKINS-38447
It also works with freestyle job and also with declarative pipeline

This is what you need 


   triggers \{
      //some polling to allow webhook trigger
      pollSCM '@daily'
   }

And

    stage ('checkout') \{
      steps \{
       checkout scm
      }
   }

am I missing any thing?

 

 

michael.bollmann@gmail.com (JIRA)

unread,
May 16, 2018, 4:16:04 AM5/16/18
to jenkinsc...@googlegroups.com

Thanks for the suggestion Dane Hart. That seems to fix it for whatever reason... .

michael.bollmann@gmail.com (JIRA)

unread,
May 16, 2018, 4:17:02 AM5/16/18
to jenkinsc...@googlegroups.com
Michael Bollmann edited a comment on Bug JENKINS-38447
Thanks for the suggestion [~cryptobits]. That seems to fix it for whatever reason... -.- .-

cesar.tronlozai@gmail.com (JIRA)

unread,
Jun 22, 2018, 4:14:03 AM6/22/18
to jenkinsc...@googlegroups.com
Cesar Tron-Lozai updated an issue
 
Change By: Cesar Tron-Lozai
Attachment: Screen Shot 2018-06-22 at 09.13.23.png

cesar.tronlozai@gmail.com (JIRA)

unread,
Jun 22, 2018, 4:18:02 AM6/22/18
to jenkinsc...@googlegroups.com
Cesar Tron-Lozai commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

I'm having similar issue with a standard pipeline (i.e. not declarative pipeline) using the multibranch plugin.

Our Jenkins file looks like that (we use Kubernetes plugin to run slave):

 

properties([
        pipelineTriggers([
                triggers: [
                        [
                                $class: 'com.cloudbees.jenkins.plugins.BitBucketTrigger',
                        ]
                ]
        ]),
])


podTemplate(...){
...
}

We use Bitbucket plugin to scan for branches and it creates jobs for the matched branches. When I view the configuration for the master job the Bitbucket trigger option is triggered:

 

I then followed the instruction from here and setup a hook in Bitbucket cloud on push to JENKINS_URL/bitbucket-hook/

The webhook recceives a 200 however nothing happens in Jenkins. I see the same message&nbsp ;

Polling has not run yet.

Am I missing something?

anandasattva@gmail.com (JIRA)

unread,
Jun 22, 2018, 5:57:09 AM6/22/18
to jenkinsc...@googlegroups.com
[~cesartl] you can try to use JENKINS_URL/bitbucket-scmsource-hook/notify to trigger Multibranch Pipeline with Bitbucket checkout. Here is [link|https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-BitBucket-Server-] with details

 

anandasattva@gmail.com (JIRA)

unread,
Jun 22, 2018, 5:57:09 AM6/22/18
to jenkinsc...@googlegroups.com

Cesar Tron-Lozai you can try to use JENKINS_URL/bitbucket-scmsource-hook/notify to trigger Multibranch Pipeline with Bitbucket checkout. Here is link with details

 

anandasattva@gmail.com (JIRA)

unread,
Jun 22, 2018, 5:59:04 AM6/22/18
to jenkinsc...@googlegroups.com
[~cesartl] you can try to use 
{code:java}
JENKINS_URL/bitbucket-scmsource-hook/notify {code}
to trigger Multibranch Pipeline with Bitbucket checkout. Here is a [link|https://support.cloudbees.com/hc/en-us/articles/115000053051-How-to-Trigger-Multibranch-Jobs-from-BitBucket-Server-] with details

 

cesar.tronlozai@gmail.com (JIRA)

unread,
Jun 22, 2018, 6:07:05 AM6/22/18
to jenkinsc...@googlegroups.com

torsten.kleiber@ikb.de (JIRA)

unread,
Jun 22, 2018, 6:44:03 AM6/22/18
to jenkinsc...@googlegroups.com

Do you have Bitbucket Server or Bitbucket Cloud? This seems not to work with Bitbucket Server!

cesar.tronlozai@gmail.com (JIRA)

unread,
Jun 22, 2018, 6:47:02 AM6/22/18
to jenkinsc...@googlegroups.com

I've got Bitbucket Cloud.

It actually works without the need to define the properties object in the pipeline.

dholmes@netapp.com (JIRA)

unread,
Jul 26, 2018, 9:54:02 AM7/26/18
to jenkinsc...@googlegroups.com

From my BB server log in trying the endpoint with a post receive hook.  It looks like a repo ID is sent by BB rather than the project/repo as names like in a git URL that would actually enable matching the pipeline configuration.  I guess somehow the plugin would need to capture and record this ID during configuration.  Would really be good to get this available.

2018-07-26 09:34:27,005 INFO [WebHookProcessor:thread-1] c.a.b.p.h.i.RequestFactoryWebHookProcessorWorker Invalid response from hook 'http://jenkinshost:8080//bitbucket-scmsource-hook/notify', repository ID '486', status: '400' / 'Bad Request'

I'm using this as a workaround https://alexbilbie.com/2016/09/jenkins-multibranch-pipeline-build-bitbucket-commit/.  This is OK, but it does require more setup and a sync with the pipeline name in the configured hook.  So works, but not as simple.

This message was sent by Atlassian JIRA (v7.10.1#710002-sha1:6efc396)

vivek.pandey@gmail.com (JIRA)

unread,
Nov 19, 2018, 10:37:04 AM11/19/18
to jenkinsc...@googlegroups.com
Vivek Pandey updated an issue
 
Change By: Vivek Pandey
Labels: scm-api-tidy-scrub triaged-2018-11
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

maxdule@gmail.com (JIRA)

unread,
Dec 6, 2018, 8:25:06 AM12/6/18
to jenkinsc...@googlegroups.com
Dusan Maksic commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

+1 Pipeline job does not work, and freestyle job does.

 

tbrouhier@cirb.brussels (JIRA)

unread,
Dec 6, 2018, 8:33:06 AM12/6/18
to jenkinsc...@googlegroups.com

Hi,

As said above, the multibranch pipeline or the Bitbucket Team/Project scan the does the job.

maxdule@gmail.com (JIRA)

unread,
Dec 6, 2018, 9:15:07 AM12/6/18
to jenkinsc...@googlegroups.com

Thanks for the reply, but multibranch pipeline is not an option for our workflow.

However, I have missed the solution proposed by dan tran, I'll give that a try.

As a simple (and ugly) workaround - I have added a freestyle job with bitbucket push option whose only work is to trigger another job (pipeline job that needed to be triggered in the first place).

john_stephenson_uk@hotmail.com (JIRA)

unread,
Dec 18, 2018, 4:35:03 PM12/18/18
to jenkinsc...@googlegroups.com

omerha@protonmail.com (JIRA)

unread,
Mar 4, 2019, 8:46:11 AM3/4/19
to jenkinsc...@googlegroups.com

I am using Bitbucket organization, and trying to automatically trigger a build for a multi branch pipeline.

The hook arrives to jenkins but doesnt trigger the job.

 

Jenkins log:

```

INFO: Received commit hook notification for {"scm":"git","website":"","name":"test-repo","links":{"self":

{"href":"https://api.bitbucket.org/2.0/repositories/omerh/test-repo"}

,"html":{"href":"https://bitbucket.org/omerh/test-repo"},"avatar":{"href":"https://bytebucket.org/ravatar/%7B8c189537-3a35-430a-a5e1-26ab25cb16f8%7D?ts=java"}},"project":{"key":"BAC","type":"project","uuid":"

{9359e998-bf48-4adf-9924-356ccdd06686}

","links":{"self":

{"href":"https://api.bitbucket.org/2.0/teams/omerh/projects/BAC"}

,"html":{"href":"https://bitbucket.org/account/user/omerh/projects/BAC"},"avatar":{"href":"https://bitbucket.org/account/user/omerh/projects/BAC/avatar/32"}},"name":"Backend"},"full_name":"omerh/test-repo","owner":{"username":"omerh","display_name":"minerva-prime","type":"team","uuid":"

{4e4e35b7-b1ce-4a47-8286-7789660275ab}

","links":{"self":

{"href":"https://api.bitbucket.org/2.0/teams/omerh"}

,"html":{"href":"https://bitbucket.org/omerh/"},"avatar":{"href":"https://bitbucket.org/account/omerh/avatar/"}}},"type":"repository","is_private":true,"uuid":"{8c189537-3a35-430a-a5e1-26ab25cb16f8}"}

```

 

This bug is couple of years old!, can someone post a workaround or a fix?

omerha@protonmail.com (JIRA)

unread,
Mar 4, 2019, 8:47:06 AM3/4/19
to jenkinsc...@googlegroups.com
omer haim edited a comment on Bug JENKINS-38447
I am using Bitbucket organization, and trying to automatically trigger a build for a multi branch pipeline.

The hook arrives to jenkins but doesnt trigger the job.

 

Jenkins log:

```  
{code:java}
 
INFO: Received commit hook notification for \ {"scm":"git","website":"","name":"test-repo","links":{"self":
{"href":"https://api.bitbucket.org/2.0/repositories/omerh/test-repo"}
,"html": \ {"href":"https://bitbucket.org/omerh/test-repo"},"avatar": \ {"href":"https://bytebucket.org/ravatar/%7B8c189537-3a35-430a-a5e1-26ab25cb16f8%7D?ts=java"}},"project": \ {"key":"BAC","type":"project","uuid":"
{9359e998-bf48-4adf-9924-356ccdd06686}
","links": \ {"self":
{"href":"https://api.bitbucket.org/2.0/teams/omerh/projects/BAC"}
,"html": \ {"href":"https://bitbucket.org/account/user/omerh/projects/BAC"},"avatar": \ {"href":"https://bitbucket.org/account/user/omerh/projects/BAC/avatar/32"}},"name":"Backend"},"full_name":"omerh/test-repo","owner": \ {"username":"omerh","display_name":"minerva-prime","type":"team","uuid":"
{4e4e35b7-b1ce-4a47-8286-7789660275ab}
","links": \ {"self":
{"href":"https://api.bitbucket.org/2.0/teams/omerh"}
,"html": \ {"href":"https://bitbucket.org/omerh/"},"avatar": \ {"href":"https://bitbucket.org/account/omerh/avatar/"}}},"type":"repository","is_private":true,"uuid":" \ {8c189537-3a35-430a-a5e1-26ab25cb16f8}"}
{code}
```  

 

This bug is couple of years old!, can someone post a workaround or a fix?

diogodias2@hotmail.com (JIRA)

unread,
Mar 5, 2019, 5:53:08 AM3/5/19
to jenkinsc...@googlegroups.com

Hi ,

 

Happen same here, there is some branchs that jenkins build automatic, but others I need to "Scan Multibranch pipeline now" to  build the others.

Any help? Thanks

omerha@protonmail.com (JIRA)

unread,
Mar 5, 2019, 8:50:06 AM3/5/19
to jenkinsc...@googlegroups.com

Hi

 

After a lot of web research I found that adding the following hooks (cant say exactly witch one) I guess the first one.

{{}}

https://jenkins-url:port/bitbucket-scmsource-hook/notify

https://jenkins-url:port/bitbucket-hook 

Now it works as expected

 

diogodias2@hotmail.com (JIRA)

unread,
Mar 6, 2019, 7:21:04 AM3/6/19
to jenkinsc...@googlegroups.com

I solved that too. Figured out on a medium website. But thanks for your reply!

I think first you add the webhook:
https://jenkins-url:port/bitbucket-hook
 

After that, you trigger the jenkins for the first time.

When Jenkins go search for another pipeline projects, he automatically add the other:
https://jenkins-url:port/bitbucket-scmsource-hook/notify

mircea.albu@gmail.com (JIRA)

unread,
Apr 12, 2019, 3:00:03 AM4/12/19
to jenkinsc...@googlegroups.com

For me, the trigger works fine for a multi-branch pipeline, but it doesn't work for single(normal) pipeline.

rsc@adr.de (JIRA)

unread,
Nov 28, 2019, 10:23:05 AM11/28/19
to jenkinsc...@googlegroups.com
Stefan Cordes updated an issue
 
Change By: Stefan Cordes
Attachment: branch-sources-https-and-pure-git.png
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

rsc@adr.de (JIRA)

unread,
Nov 28, 2019, 10:26:04 AM11/28/19
to jenkinsc...@googlegroups.com
Stefan Cordes commented on Bug JENKINS-38447
 
Re: Bitbucket hooks don't work for Pipeline jobs

Cesar Tron-Lozai :
With

			pipelineTriggers([
				// build at least build onetime a month
				// MINUTE	HOUR	DOM	MONTH	DOW
				// see https://jenkins.io/doc/book/pipeline/syntax/#triggers
				// # Build at least once a month
				cron('H H(10-17) H * 1-5')
		        // for test every 5 minutes
				//        cron('*/5 * * * *')
				,
				// poll scm nightly to ensure no push events were lost.
				pollSCM('H H(3-7) * * *')
				,
				// https://issues.jenkins-ci.org/browse/JENKINS-38447?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&showAll=true
				[$class: 'com.cloudbees.jenkins.plugins.BitBucketTrigger']
				,
				snapshotDependencies()
			])

it worked for me when using $JENKINS_HOME/bitbucket-hook/ when

  • https bitbucket URL and not ssh
  • git and not bitbucket-source
    in "Project Repository"

(reason: see com.cloudbees.jenkins.plugins.BitbucketJobProbe.match(..))

rsc@adr.de (JIRA)

unread,
Mar 9, 2020, 6:07:04 AM3/9/20
to jenkinsc...@googlegroups.com

The above workaround is valid for existing branches in a multibranch project.

For new branches the Bitbucket trigger still fails.

For that reason I investigated a little bit and found out that the Bitbucket trigger is just checking for instanceof BitBucketTrigger

but the MultiBranch Pipeline is not a BitBucketTrigger but a SCMSourceOwner

So I modified the BitbucketJobProbe to consider jenkins.scm.api.SCMSourceOwner:

https://github.com/jenkinsci/bitbucket-plugin/pull/68

(With that pull request the above "existing branch" Workaround: [$class: 'com.cloudbees.jenkins.plugins.BitBucketTrigger'] (or ,bitbucketPush()) can be removed again)

Can someone merge it, please?

This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages