Jenkins 管道不是由 Bitbucket Server 推送/PR 触发的,但 freestyle 项目可以

问题描述 投票:0回答:1

我正在配置 Jenkins 设置,每次在 Bitbucket Server 存储库上发出推送或拉取请求时,都应触发管道。有趣的是,此设置对于自由式项目可以无缝工作,但对于管道项目似乎无法激活。

这是我的配置:

  • 詹金斯版本:2.427
  • Bitbucket 服务器:8.14.1

插件:

  • Bitbucket 推拉请求:2.8.4
  • Git 插件:5.2.0

在我的配置中,我选择的唯一选项显示在这个屏幕截图中。对于源代码管理 (SCM),我使用 Git。当我测试连接时,我收到以下消息:

Jenkins 成功连接到主服务器上 bitbucket-management 的 jenkins/sample

Bitbucket 端的 Webhook 也已正确设置,并且我已确认它在访问自定义端点时返回 200 OK 状态。

但是,存在异常情况:当我尝试将更改从 staging 分支合并到 master 分支时,它会触发自由式项目,但不会触发管道项目。

这是我迄今为止在 Jenkins 日志中发现的内容

如您所见,webhook 本身确实触发了

Bitbucket 日志

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

有人遇到过类似的问题或对如何解决这个问题有建议吗?

git jenkins jenkins-pipeline bitbucket jenkins-plugins
1个回答
0
投票

此插件需要安全连接。

即通过端口 443。

向我的 Bitbucket 服务器颁发证书已经解决了这个问题。

© www.soinside.com 2019 - 2024. All rights reserved.