Bitbucket webhook to build jenkins Job 403
Asked by Asif Khalil:

Jenkins is running on my <http://localhost:8080>

\<blockquote id="error"\> 129\<p\>\<b\>Access Denied.\</b\>\</p\> 130\</blockquote\> 131 132\<p\>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.\</p\> 133 134\<p\>Your cache administrator is \<a href="mailto:webmaster"\>webmaster\</a\>.\</p\> 135\<br\> 136\</div\> 137 138\<hr\> 139\<div id="footer"\> 140\<p\>Generated Fri, 22 Oct 2021 14:00:35 GMT by ip-10-101-38-42.net.atlassian.com (squid)\</p\> 141\<!-- ERR_ACCESS_DENIED --\>

Jinkins Webhook URL Configured : <http://localhost:8080/bitbucket-hook>

Please how i fix 403 Access Denied error.


Answers:
author: Theodora Boudale
body: Hi Asif,

Localhost refers to the local computer where a program is running. Bitbucket Cloud cannot access your webhook if you are using localhost, this can only be accessed by the server where Jenkins is running in your local network. You will need to use the public IP address or domain name in the URL, instead of localhost.

In case your server is behind a firewall, you may also need to whitelist our IP addresses for webhook delivery. You can check the following documentation page for this, specifically the section "Valid IP addresses for webhook delivery":

* <https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>

Kind regards,  
Theodora

comments: author: Shyam_corecon
body: Hi Team

I am still getting the same error even after changing localhost to public IP

\<blockquote id="error"\> \<p\>\<b\>Access Denied.\</b\>\</p\> \</blockquote\> \<p\>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.\</p\> \<p\>Your cache administrator is \<a href="mailto:webmaster"\>webmaster\</a\>.\</p\> \<br\>


author: Theodora Boudale
body: Hi [@Shyam_corecon](/t5/user/viewprofilepage/user-id/3150027),

If your server is behind a firewall, you may need to whitelist the IPs used by Bitbucket Cloud for webhook delivery (see my previous answer). Some other configuration on your server or network may also prevent our requests from reaching your server, you'll need to reach out to your network admin about this.

Kind regards,  
Theodora


author: Shivangi Saxena
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,

I am getting the same error. I am using bitbucket cloud and trying to create a request to Jenkins installed on my local setup(laptop). I am using the IP in jenkins URL passed in bitbucket webhook

\<blockquote id="error"\> \<p\>\<b\>Access Denied.\</b\>\</p\> \</blockquote\> \<p\>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.\</p\> \<p\>Your cache administrator is \<a href="mailto:webmaster"\>webmaster\</a\>.\</p\> \<br\>

Is there anything you can help with?


author: Theodora Boudale
body: Hi Shivangi,

Is the IP you are using in Jenkins URL private or public? Bitbucket Cloud needs a public IP address, otherwise, it won't be able to reach your Jenkins.

Kind regards,  
Theodora


author: Shivangi Saxena
body: thanks for your response, yes jenkins IP is private. what needs to do make the successful connection from public bitbucket cloud to private jenkins ip?


author: Pratima Maiti
body: Hi [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) ,

If bitbucket is hosted on public cloud and Jenkins is installed on client network. Then how can we send a successful request from bitbucket to Jenkins?


author: Theodora Boudale
body: Hi Shivangi and Pratima,

Bitbucket Cloud cannot reach a private IP. Private IP addresses are used in an internal network (e.g. your home network) and are assigned to all devices connected to that local network. Bitbucket Cloud can only reach a public IP or a domain name that is accessible over the internet, at least from the IPs that Bitbucket uses for webhook delivery. The IPs that Bitbucket Cloud uses for webhook delivery are here:

* <https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#Outgoing-Connections>

Jenkins is not built by Atlassian so I don't know the exact changes you need to make on Jenkins side. I found the following post that may be useful:

* <https://community.jenkins.io/t/id-like-to-access-my-jenkins-address-outside-of-my-lan-how-can-i-set-that-up/818/5>

If you need further assistance, I would suggest posting a question on the Jenkins forum.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud