I'm working on configuring a Jenkins setup where a pipeline should be triggered every time there's a push or pull request made on a Bitbucket Server repository. Interestingly, this setup works seamlessly for freestyle projects, but it doesn't seem to activate for pipeline projects.
Here's my configuration:
Plugins:
In my configuration, the only option I've selected is shown in this screenshot. For source code management (SCM), I'm using Git. When I test the connection, I receive the following message:
Jenkins successfully connected to bitbucket-managed's jenkins/sample on Primary Server
The webhook on the Bitbucket side is also set up correctly, and I've confirmed it returns a 200 OK status when hitting a custom endpoint.
However, here's the anomaly: when I try to merge changes from the staging branch to the master branch, it triggers a freestyle project but not the pipeline project.
Here's what I found in Jenkins logs so far
As you can see, the webhook itself did trigger
Bitbucket Logs
2023-10-11 08:08:08,438 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.p.InternalPullRequestCommitHelper Indexing: linking PR 3070 with 26 commit(s) using include: 6c880405f0d63e97b54d3ce080bba38383618e03
2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for WatcherAddedEvent until AFTER_COMMIT
2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for PullRequestActivityEvent until AFTER_COMMIT
2023-10-11 08:08:08,484 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Deferring publishing for AnalyticsPullRequestOpenedEvent until AFTER_COMMIT
2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing WatcherAddedEvent after commit
2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing PullRequestActivityEvent after commit
2023-10-11 08:08:08,532 DEBUG [http-nio-7990-exec-5] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.e.TransactionAwareEventPublisher Publishing AnalyticsPullRequestOpenedEvent after commit
2023-10-11 08:08:08,533 DEBUG [threadpool:thread-2] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.n.DefaultNotificationManager Managing notification: PullRequestActivityNotification{admin=InternalNormaladmin{id=753, adminname=admin}, timestamp=Wed Oct 11 08:08:08 IDT 2023, pullRequest=jenkins:9, activity=InternalPullRequestActivity{id=66284, admin=InternalNormaladmin{id=753, adminname=admin}, action=OPENED, pullRequest.id=9}}
2023-10-11 08:08:08,533 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Queueing RemoteEvent com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>]
2023-10-11 08:08:08,533 DEBUG [threadpool:thread-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.n.DefaultNotificationManager Managing notification: PullRequestOpenedNotification{admin=InternalNormaladmin{id=753, adminname=admin}, timestamp=Wed Oct 11 08:08:08 IDT 2023, pullRequest=jenkins:9}
2023-10-11 08:08:08,534 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventDispatcher RemoteEvent com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>] consumable by []
2023-10-11 08:08:08,534 DEBUG [AtlassianEvent::thread-3] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.e.r.impl.RemoteEventListener Batch size not exceeded for com.atlassian.stash.plugin.remote.event.StashPullRequestOpenedRemoteEvent@c9decd7[fromBranch=refs/heads/main,fromProjectKey=JENKINS,fromRepositorySlug=jenkins,id=9,toBranch=refs/heads/master,toProjectKey=JENKINS,toRepositorySlug=jenkins,sourceId=<null>,sourceUrl=<null>]
2023-10-11 08:08:08,534 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.m.b.listener.AbstractEventListener Creating Event for: com.atlassian.stash.internal.pull.AnalyticsPullRequestOpenedEvent[source=com.atlassian.stash.internal.pull.DefaultPullRequestService@2bad091d]
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is true, class : PullRequestProcessor
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor isEventAccepted for event type: PULL_REQUEST_OPENED
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor isEventAccepted result: true
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.m.b.listener.AbstractEventListener nl.topicus.bitbucket.processor.PullRequestProcessor accepted event by type: PULL_REQUEST_OPENED
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor Processing event with type: PULL_REQUEST_OPENED
2023-10-11 08:08:08,535 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor sendPullRequestEvent: PULL_REQUEST_OPENED
2023-10-11 08:08:08,614 DEBUG [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" c.a.s.i.s.g.m.MeshPullRequestRefHelper JENKINS/jenkins[203]: Pull request 9@0 merged automatically without conflicts
2023-10-11 08:08:08,627 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.PullRequestProcessor sendPullRequestEvent prUrl: http://192.168.200.23:7990/projects/JENKINS/repos/jenkins/pull-requests/9
2023-10-11 08:08:08,627 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents event type: PULL_REQUEST_OPENED
2023-10-11 08:08:08,628 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents getting configuration for repo: 203
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.s.WebhookConfigurationService Always add project configurations: false
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.s.WebhookConfigurationService Always add global configurations: false
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor sendEvents enabledWebHookConfigurations count: 0
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : RepositoryRefsChangedProcessor
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : BuildStatusSetProcessor
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.p.ProjectRepositoryModificationProcessor Event PULL_REQUEST_OPENED accepted: false
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.bitbucket.service.LicenseManager Plugin licensed.
2023-10-11 08:08:08,629 INFO [moveworkforward-bitbucket-1] admin @Y7JMOKx488x3198x0 hxbgmf 10.212.134.101 "POST /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests HTTP/1.1" n.t.b.processor.AbstractProcessor isEventAccepted for event type: PULL_REQUEST_OPENED, and result is false, class : RepositoryMirrorSynchronizedProcessor
2023-10-11 08:08:09,302 DEBUG [http-nio-7990-exec-6] admin @Y7JMOKx488x3200x0 hxbgmf 10.212.134.101 "GET /projects/JENKINS/repos/jenkins/pull-requests/9/overview HTTP/1.1" c.a.s.i.p.w.f.RequestCacheClientPageDataHandler Context bitbucket.web.repository.clone.dialog.options was required already. Ignoring.
2023-10-11 08:08:10,225 DEBUG [http-nio-7990-exec-7] admin @Y7JMOKx488x3205x1 hxbgmf 10.212.134.101 "GET /rest/client-plugins/1.0/client-plugins/items HTTP/1.1" c.a.s.i.i18n.PluginI18nService No values found in any valid locale for key and locales [en_US, en]
2023-10-11 08:08:10,508 DEBUG [http-nio-7990-exec-2] admin @Y7JMOKx488x3211x0 hxbgmf 10.212.134.101 "GET /rest/api/latest/projects/JENKINS/repos/jenkins/pull-requests/9/activities HTTP/1.1" c.a.s.i.p.c.d.DriftCommentUpdateProcessor 203:9@0: No rescopes are pending drift
2023-10-11 08:08:10,512 DEBUG [http-nio-7990-exec-4] admin @Y7JMOKx488x3213x2 hx
Has anyone faced a similar issue or have suggestions on how to resolve this?
This plugin requires a secure connection.
i.e over port 443.
Issuing a certificate to my Bitbucket server has solved this issue.