jenkinsci / bitbucket-push-and-pull-request-plugin

Plugin for Jenkins v2.138.2 or later, that triggers job builds on Bitbucket's push and pull request events.

Home Page:https://plugins.jenkins.io/bitbucket-push-and-pull-request

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bitbucket-push-and-pull-request-plugin stopped working with Bitbucket cloud

shahalam72 opened this issue · comments

Hello,
bitbucket-push-and-pull-request-plugin not working with Bitbucket cloud.
on Bitbucket Webhook we are getting the following HTTP 403 error:

<title>Error 403 No valid crumb was included in the request</title>

HTTP ERROR 403 No valid crumb was included in the request

URI:/bitbucket-ppr-webhook
STATUS:403
MESSAGE:No valid crumb was included in the request
SERVLET:Stapler

Powered by Jetty:// 10.0.15

========== Versions =========

Jenkins: 2.414.2
bitbucket-push-and-pull-request-plugin: 3.0.1
Bitbucket Plugin: 241.v6d24a_57f9359

We removed "Bitbucket Plugin" and only had bitbucket-push-and-pull-request-plugin, but that still gets the same error.
We tried createing a new PR webhook "https://buildpp.pacelabs.com:8443/bitbucket-ppr-webhook", which is separate from default webhook "https://buildpp.pacelabs.com:8443/bitbucket-hook/", but still get 403 error for PR webhook.

I will appreciate your quick response on this issue.

Thanks,
Shah Alam

Hello,
I will appreciate an update on this issue. One of our developer found that mongo shell for v6 wasn't installed right, so he reinstalled it using following commands.
dnf erase -qy mongodb-mongosh
dnf install -qy mongodb-mongosh-shared-openssl3

We are not seeing 403 error in Bitbucket Webhook after that for PR, but PR build still not getting triggered Jenkins.

Thank you.

Hallo @shahalam72,

As I read, you are not having problems with the 443 anymore, and the issue is now that the job, where you configured the plugin, is not being triggered as a pull request is coming in.

I have 2questions:

  • Did the plugin already work in the past or is it the first time you are using it?
  • Did you trigger manually the Jenkins job for its first time execution? That’s necessary to use the plugin with pipeline jobs

May you provide logs of the plugin, after removing eventual sensitive information.

Thanks

I am also facing a similar issue. Getting 200 from the bitbucket cloud but Jenkins job is not getting triggered. Using the plugin for the first time with Bitbucket Cloud

I am getting below error. Is this because bitbucket plugin is also installed?
"java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Expected 1 instance of io.jenkins.plugins.bitbucketpushandpullrequest.config.BitBucketPPRPluginConfig but got 2 [in thread "Handling POST /bitbucket-ppr-webhook/ from XXXXXXXXX : Jetty (winstone)-173"]"

Hello,
apologize for delayed response. As you can see in attached image the webhook has return code 200, but nothing happens on Jenkins Server (log attached). I did trigger the Jenkins job manually when it was created.

web jenkins.log hook

Hallo @shahalam72

From the log I cannot find any errors related to the plugin, it seems to me that the Job was triggered. See following:

ˋˋˋ
2023-07-25 21:39:25.050+0000 [id=225] INFO c.c.j.p.BitBucketTriggerRunnable#buildJob: SCM changes detected in [build-dev]. Triggering [ #12]
2023-07-25 21:39:34.435+0000 [id=250] INFO o.j.p.b.BitbucketBuildStatusNotifierStep$Execution#run: Got commit id null
2023-07-25 21:39:34.435+0000 [id=250] INFO o.j.p.b.BitbucketBuildStatusNotifierStep$Execution#run: Got repo slug = null
2023-07-25 21:39:34.939+0000 [id=250] INFO o.j.p.b.BitbucketBuildStatusHelper#sendBuildStatusNotification: This request was sent: {
"state": "INPROGRESS",
"key": "c963ed106f1c29f4589c7dff8288c7f2",
"url": "https://jenkins_server:8443/job/b2bservices/job/build-dev/12/display/redirect",
"name": "b2bservices/build-dev #12"
}

(…)

2023-07-25 21:39:46.446+0000 [id=250] INFO o.j.p.b.BitbucketBuildStatusHelper#sendBuildStatusNotification: This request was sent: {
"state": "SUCCESSFUL",
"key": "c963ed106f1c29f4589c7dff8288c7f2",
"url": "https://jenkins_server:8443/job/b2bservices/job/build-dev/12/display/redirect",
"name": "b2bservices/build-dev #12"
}
ˋˋˋ
May you send the logs only for this specific plugin to the finest Level? Maybe there can be found more…

I am getting below error. Is this because bitbucket plugin is also installed? "java.lang.ExceptionInInitializerError: Exception java.lang.IllegalStateException: Expected 1 instance of io.jenkins.plugins.bitbucketpushandpullrequest.config.BitBucketPPRPluginConfig but got 2 [in thread "Handling POST /bitbucket-ppr-webhook/ from XXXXXXXXX : Jetty (winstone)-173"]"

hallo @malikdaman24
I think, this is a different issue. May you open a new one? Thank you.