Troubleshoot Webhooks

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.

Request Logs

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.

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.

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 status code in the payload response is not in the 200-299 range or if the request times out after 10 seconds, Bitbucket automatically resends the response up to three times, with one minute between each attempt. 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.

Request Details

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.

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.

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport