When you perform an action to trigger a webhook and it doesn't work, you can use the Request log and Request detail pages to figure out what went wrong.
Note that you may need to know the Bitbucket Cloud IP addresses to whitelist.
If you aren't sure if a webhook triggered properly, you can look at the details of the request. From the list of webhooks, click the View requests link to open a log page with the last 100 requests for that webhook and what each request returned.
- View requests: Click to see the requests for this webhook.
A page opens with a list of request logs for the webhook. Click the Load new requests button to refresh the page with new requests.
- Events: Lists the events that triggered the webhook.
- Request time: Indicates when the even occurred.
- View details: Click to see the details of event requests.
- Status: Displays the outcome of the request and the response time in milliseconds.
When Bitbucket sends a request, the log indicates outcome of the request with one of these:
- An HTTP status code
- TIMEOUT, if the request timed out before connecting
- NETWORK ERROR, if the request couldn't connect
If the request fails, Bitbucket automatically attempts to resend the response a limited number of times. If an event had multiple attempts, the request log includes only the most recent attempt.
If you want to know the number of attempts made for an event request, click View details and look for the Request attempts number, which includes the number of automatic attempts and any manual attempts you make from the Request details page. This number is also available in the
X-Attempt-Number HTTP header of each request.
When you click the View details link next to a logged event, you see details of the logged request event, the event payload and header that Bitbucket sends to your server, and the response and header your server sends back to Bitbucket.
From this page, you can initiate another attempt by clicking the Resend request button. You may want to resend a request if the webhook URL is working after being down previously. You can also use the button to test a change without going through the steps to trigger the webhook. If you update the webhook URL between attempts, Bitbucket sends the request to the updated URL, not the URL for the previous attempt.
- Event details: The event that triggered the webhook, the time it occurred, and the number of attempts so far.
- Resend button: Click to resend the request to the webhook URL.
- Attempt tabs: Click to see details for each time Bitbucket tried to send and receive payloads for a triggered event.
For explanations of what you may see under the Request Headers and Request Body tabs, see the event payloads. If an error prevents your server from sending a response back to Bitbucket, the Response Headers and Response Body tabs do not appear.