Bitbucket Webhook to Jenkins connection timeout
Asked by Pradeep Dumpala:

Hi Team,

I am trying to set-up a bitbucket(cloud) webhook to trigger a Jenkins pipeline, but some have its not working. You can see the error message at the end of this message.

Jenkins Webhook URL : <https://jenkinsappdev.compay.xyz/bitbucket-hook/>

Jenkins is hosted on our internal network but it have the above public end point which will be accessible only from bitbucket inbound IPs listed below. These IP ranges are whitelisted in our organisation firewall layer to allow inbound, but still its not working.

Please let me know if I miss anything here.

-------

IPv4 inbound for bitbucket.org, api.bitbucket.org, and altssh.bitbucket.org

* 104.192.136.0/21

* 185.166.140.0/22

* 18.205.93.0/25

* 18.234.32.128/25

* 13.52.5.0/25

-----

Error:

body 115:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } 116:lang(he) { direction: rtl; } 117 --\>\</style\> 118\</head\>\<body id=ERR_CONNECT_FAIL\> 119\<div id="titles"\> 120\<h1\>ERROR\</h1\> 121\<h2\>**The requested URL could not be retrieved**\</h2\> 122\</div\> 123\<hr\> 124 125\<div id="content"\> 126\<p\>The following error was encountered while trying to retrieve the URL: \<a href="**[https://jenkinsappdev.eclipx.xyz/\*](https://jenkinsappdev.eclipx.xyz/*)**"\>https://jenkinsappdev.eclipx.xyz/\*\</a\>\</p\> 127 128\<blockquote id="error"\> 129\<p\>\<b\>Connection to \[unknown\] failed.\</b\>\</p\> 130\</blockquote\> 131 132\<p id="sysmsg"\>The system returned: \<i\>(110) Connection timed out\</i\>\</p\> 133 134\<p\>The remote host or network may be down. Please try the request again.\</p\> 135 136\<p\>Your cache administrator is \<a href="mailto:webmaster"\>webmaster\</a\>.\</p\> 137 138\<br\> 139\</div\> 140 141\<hr\> 142\<div id="footer"\> 143\<p\>Generated Tue, 15 Nov 2022 22:37:03 GMT by ip-10-101-38-60.net.atlassian.com (squid)\</p\> 144\<!-- ERR_CONNECT_FAIL --\> 145\</div\> 146\</body\>\</html\>

Regards,

Pradeep


Answers:
author: Theodora Boudale
body: Hi [@Pradeep Dumpala](/t5/user/viewprofilepage/user-id/4482814),

The IP ranges for webhook delivery are different, as mentioned here:

<https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/#Valid-IP-addresses-for-webhook-delivery>

This includes a link to the following doc:

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

If you need to whitelist IP addresses only for webhook delivery, you can whitelist the ranges mentioned in **Outgoing connections** only.

Kind regards,  
Theodora

comments: author: Pradeep Dumpala
body: thank you [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086) for the details. Now I am able to get the firewall allow the inbound from a connectivity perspective.

But its the different issue, the response body is coming as \<null response\>

Response from [https://jenkinsappdev.\*\*\*\*.xyz/bitbucket-web-hook/](https://jenkinsappdev.****.xyz/bitbucket-web-hook/)  
HTTP status: -2

Request time: 5 minutes ago

Headers  
Body  
**\<null response\>**   
Request  
Headers  
X-Hook-UUID c7875cd2-a4e4-49e4-941f-f37cf9755beb  
X-B3-SpanId 14558d8855ace511  
X-B3-Sampled 1  
X-B3-TraceId 14558d8855ace511  
X-Attempt-Number 1  
X-Event-Key repo:push  
X-Request-UUID 26d03104-0d9c-456e-bbec-1d3cdf02e20a  
User-Agent Bitbucket-Webhooks/2.0  
X-Event-Time Wed, 16 Nov 2022 22:23:52 GMT  
Content-Type application/json  
Please let me know if I am missing something here.


author: Theodora Boudale
body: Hi [@Pradeep Dumpala](/t5/user/viewprofilepage/user-id/4482814),

Apologies for the late reply, I was out of office.

If you go to the Repository setting of the repo on Bitbucket Cloud website \> select **Webhooks** \> select **Edit** for the webhook you created, you will see an option **Skip certificate verification**. Is this option checked or unchecked?

If it is unchecked, can you check it (temporarily, for testing purposes), and then see if it works properly the next time an event triggers the webhook?

This is to figure out if the \<null response\> error is related to a problem with the certificate.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud