1

Why does the Bitbucket Branch Source Plugin throw an error?

Hello,

I have installed your "Bitbucket Branch Source Plugin" in Jenkins. In the Settings I have added a Bitbucket Server with url http://Jenkins:7990. "Manage Hooks" checkbox is disabled.

In Bitbucket server I have added the Webhook on push for the url http://Jenkins/bitbucket-scmsource-hook/notify.

The Multi-Branch-Pipeline project has this configuration:

Server: Jenkins (http://Jenkins:7990)
Credentials: Admin/****** (Bitbucket Admin - User/PW)
Owner: PROJ
Repositoryname: project


Behaviours:
Discover Branches
Strategy: All Branches

Discover pull requests from origin
Strategy: Merging the pull request with the current target branch revision

Discover pull requests from forks
Strategy: Merging the pull request with the current target branch revision
Trust: Forks in the same account

Property strategy: All Branches get the same properties

 

In Bitbucket I am receiving on commit an error: 

java.lang.IllegalStateException: Request cannot be executed; I/O reactor status: STOPPED

The request is this:

Header

X-Request-Id: a398f1c5-014a-44a1-9c93-ea5ee5b27f83
Content-Type: application/json; charset=utf-8
X-Event-Key: repo:refs_changed

Body

{"eventKey":"repo:refs_changed","date":"2017-10-23T10:22:07+0200","actor":{"name":"myname","emailAddress":"myemail","id":53,"displayName":"Patrick Spiegel","active":true,"slug":"myname","type":"NORMAL"},"repository":{"slug":"project","id":1,"name":"Project","scmId":"git","state":"AVAILABLE","statusMessage":"Available","forkable":false,"project":{"key":"PROJ","id":2,"name":"Projects","public":false,"type":"NORMAL"},"public":true},"changes":[{"ref":{"id":"refs/heads/feature/MultibranchFile","displayId":"feature/MultibranchFile","type":"BRANCH"},"refId":"refs/heads/feature/MultibranchFile","fromHash":"2b1fefacf1db16461ac7de2fe6cff81afb9fc06b","toHash":"4b77fae3b9ccd5a981ea259512ecef80437eb93f","type":"UPDATE"}]}

When I manually execute the request I get this answer:

java.lang.Exception: X-Event-Key HTTP header invalid: repo:refs_changed
at org.kohsuke.stapler.HttpResponses.error(HttpResponses.java:83)
at com.cloudbees.jenkins.plugins.bitbucket.hooks.BitbucketSCMSourcePushHookReceiver.doNotify(BitbucketSCMSourcePushHookReceiver.java:99)

But when im changing the X-Event-Kex to repo:push I get an empty response back and the build is not triggered.

Is there any way for me to fix this issue?

 

Jenkins ver. 2.73.2

Atlassian Bitbucket v5.4.1

0 comments

Please sign in to leave a comment.