<p>if that is the error you're getting, it is clearly an issue with BitBucket Authentication as that is in the stack trace... the specific API call which is failing is displayed and you can see it is in the authentication process... as to why it is running successfully when invoked manually - it would have to do with a configuration upstream somewhere - check the format of your repo and make sure you use this pattern:</p>

<p><a href="https://user:password@bitbucket.org/user/project_name.git" rel="nofollow noreferrer">https://user:password@bitbucket.org/user/project_name.git</a></p>

CC BY-SA 3.0
2017-12-28T15:12:51.267Z
2017-12-28T18:01:55.293Z
2017-12-28T18:01:55.293Z
randomNerdboy
<p>It took me a while to understand this as well as I had experience with Bitbucket Server and not Bitbucket Cloud which is different.</p>

<p>You do not need to enable the webhook for the Bitbucket Pull Request Builder plugin in Jenkins.</p>

<p>Just ensure you set the <em>RepositoryName</em> and <em>RepositoryOwner</em> properly from the URL of your repo as such: <code>https://bitbucket.org/RepositoryOwner/RepositoryName</code></p>

<p>Once you have that set, a new PR or commit to branch of existing PR will trigger your job.</p>

<p>P.S. There's a bug in the plugin where you can't use git for other repos such as workflow library or pipeline from scm. Git will try to use the same hash to checkout all repos which will fail the build.</p>

<p>P.P.S. The webhook in Bitbucket cloud uses a POST with Json data so that can't be used with the git plugin in Jenkins unless you don't care about the hash or branch.</p>

<p>EDIT:
One last note, I've since moved to use the multibranch pipeline with bitbucket branch plugin and that works great with the webhook as well as allows us to use a workflowlib library</p>

CC BY-SA 4.0
2018-09-12T14:56:35.427Z
2018-09-26T23:33:06.653Z
2018-09-26T23:33:06.653Z
Jean-Serge Gagnon
<p>I have enabled web hooks pull request in Bitbucket like below -</p>

<p><a href="https://i.sstatic.net/auX0w.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/auX0w.png" alt="enter image description here"></a></p>

<p>And my Jenkins job configurations are as follows - </p>

<p><a href="https://i.sstatic.net/hxkYi.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/hxkYi.png" alt="enter image description here"></a></p>

<p>Bitbucket hooks are getting invoked as soon as I create pull request but Jenkins job is not getting invoked. 
Can anyone help please? </p>

CC BY-SA 3.0
2017-08-14T09:29:35.010Z
did you check whether there is a firewall that is blocking the web hooks?
030
CC BY-SA 3.0
2017-08-14T09:33:54.430Z
My push jobs are working fine. only pull jenkins jobs are not getting invoked. If there would be firewall issue then push also didn't work
Pramod Kumar
CC BY-SA 3.0
2017-08-14T09:37:44.150Z
Where does the Jenkins run? If jenkins runs on premise and bitbucket in the cloud it could be possible that bitbucket is not able to trigger jenkins if there is a office firewall in between.
030
CC BY-SA 3.0
2017-08-14T09:41:27.990Z
Jenkins is running on EC2 amazon.
Pramod Kumar
CC BY-SA 3.0
2017-08-14T09:46:19.290Z
I am seeing this error in jenkins cosole - ←[33mAug 14, 2017 9:44:02 AM bitbucketpullrequestbuilder.bitbucketpullrequestbui
lder.bitbucket.ApiClient getAllValues
WARNING: invalid response.
java.io.EOFException: No content to map to Object due to end of input
        at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.ja
va:2775)
Pramod Kumar
CC BY-SA 3.0
2017-08-14T09:53:30.217Z
What version of Jenkins do you run and I assume you are using the cloud version of bitbucket?
030
CC BY-SA 3.0
2017-08-14T10:03:33.170Z
Yes. i am using cloud version if bitbucket. Jenkins version is - 2.60.1
Pramod Kumar
CC BY-SA 3.0
2017-08-14T10:05:45.567Z
INFO: Failure authenticating with BASIC 'Bitbucket.org HTTP'@bitbucket.org:443
←[33mAug 14, 2017 10:01:02 AM bitbucketpullrequestbuilder.bitbucketpullrequestbu
ilder.bitbucket.ApiClient getAllValues......... What does this error means? When i run build manually it works completely fine
Pramod Kumar
CC BY-SA 3.0
2017-08-14T10:17:40.327Z
It seems that Bitbucket cannot authenticate to jenkins. Did you check the username and password?
030
CC BY-SA 3.0
2017-08-14T10:20:21.577Z
If this would be case then it shouldn't run manually. Its connection and fetching repo if i run same job manually
Pramod Kumar
CC BY-SA 3.0
2017-10-12T14:29:59.933Z
FWIW, I have the same issue with ssh authentication.
schaiba
<jenkins><bitbucket>
Bitbucket Pull Request Builder Jenkins job is not getting invoked
Pramod Kumar
# Bitbucket Pull Request Builder Jenkins job is not getting invoked

(Asked by: username_0 on 2017-08-14)

I have enabled web hooks pull request in Bitbucket like below -

[![enter image description here](https://i.sstatic.net/auX0w.png)](https://i.sstatic.net/auX0w.png)

And my Jenkins job configurations are as follows -

[![enter image description here](https://i.sstatic.net/hxkYi.png)](https://i.sstatic.net/hxkYi.png)

Bitbucket hooks are getting invoked as soon as I create pull request but Jenkins job is not getting invoked.
Can anyone help please?

**Tags:** jenkins, bitbucket

> **Comments:**
> **username_1**: did you check whether there is a firewall that is blocking the web hooks?  
> **username_0**: My push jobs are working fine. only pull jenkins jobs are not getting invoked. If there would be firewall issue then push also didn't work  
> **username_1**: Where does the Jenkins run? If jenkins runs on premise and bitbucket in the cloud it could be possible that bitbucket is not able to trigger jenkins if there is a office firewall in between.  
> **username_0**: Jenkins is running on EC2 amazon.  
> **username_0**: I am seeing this error in jenkins cosole - ←[33mAug 14, 2017 9:44:02 AM bitbucketpullrequestbuilder.bitbucketpullrequestbui lder.bitbucket.ApiClient getAllValues WARNING: invalid response. java.io.EOFException: No content to map to Object due to end of input         at org.codehaus.jackson.map.ObjectMapper._initForReading(ObjectMapper.ja va:2775)  
> **username_1**: What version of Jenkins do you run and I assume you are using the cloud version of bitbucket?  
> **username_0**: Yes. i am using cloud version if bitbucket. Jenkins version is - 2.60.1  
> **username_0**: INFO: Failure authenticating with BASIC 'Bitbucket.org HTTP'@bitbucket.org:443 ←[33mAug 14, 2017 10:01:02 AM bitbucketpullrequestbuilder.bitbucketpullrequestbu ilder.bitbucket.ApiClient getAllValues......... What does this error means? When i run build manually it works completely fine  
> **username_1**: It seems that Bitbucket cannot authenticate to jenkins. Did you check the username and password?  
> **username_0**: If this would be case then it shouldn't run manually. Its connection and fetching repo if i run same job manually  
> **username_2**: FWIW, I have the same issue with ssh authentication.  

---

## 2 answers

### Answer by username_4 on 2018-09-12. Score: 1

It took me a while to understand this as well as I had experience with Bitbucket Server and not Bitbucket Cloud which is different.

You do not need to enable the webhook for the Bitbucket Pull Request Builder plugin in Jenkins.

Just ensure you set the *RepositoryName* and *RepositoryOwner* properly from the URL of your repo as such: `https://bitbucket.org/RepositoryOwner/RepositoryName`

Once you have that set, a new PR or commit to branch of existing PR will trigger your job.

P.S. There's a bug in the plugin where you can't use git for other repos such as workflow library or pipeline from scm. Git will try to use the same hash to checkout all repos which will fail the build.

P.P.S. The webhook in Bitbucket cloud uses a POST with Json data so that can't be used with the git plugin in Jenkins unless you don't care about the hash or branch.

EDIT:
One last note, I've since moved to use the multibranch pipeline with bitbucket branch plugin and that works great with the webhook as well as allows us to use a workflowlib library


---

### Answer by username_3 on 2017-12-28. Score: 0

if that is the error you're getting, it is clearly an issue with BitBucket Authentication as that is in the stack trace... the specific API call which is failing is displayed and you can see it is in the authentication process... as to why it is running successfully when invoked manually - it would have to do with a configuration upstream somewhere - check the format of your repo and make sure you use this pattern:

<https://user:password@bitbucket.org/user/project_name.git>


---

