Webhooks on build start/update won't fire
Asked by Maarten van der Schot:

Hi,

I want to receive webhooks on our own event infra when our BitBucket Pipelines are running. We've enabled the webhooks in the repo settings and selected build start and build update. But the webhooks won't fire.

I've enabled the call history, and no calls show up. We are running our own BitBucket runners and they properly run our BB pipelines.

Does anybody has this problem? Thanks!

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/290340i462CD31B66808B52/image-dimensions/250x369?v=v2 "image.png")

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/290339iF374A1C9E6CF94D8/image-size/large?v=v2&px=999 "image.png")


Answers:
author: Theodora Boudale
body: Hi Maarten,

The webhook with these triggers should get triggered when a commit's build status is created or updated, so the page to check that would be the **Commits** page of the repo:

![Screenshot 2023-11-08 at 12.06.36.png](https://community.atlassian.com/t5/image/serverpage/image-id/290722i2B85B50F133EB416/image-size/large?v=v2&px=999 "Screenshot 2023-11-08 at 12.06.36.png")

* In the column **Builds** , is there a status for the commit that triggered your pipeline?  

* Did you run any builds after you enabled history collection for the webhook? Requests that were triggered before you enabled it, will not show on this page.  

* If history collection is enabled now and you trigger a new build, does selecting the **Load new requests** link show this event after the build is finished?

I tried to reproduce this issue with a self-hosted Linux Docker runner, but I haven't been able to. If you provide also the following info, I can try to reproduce a use case similar to yours:

* What type of runner are you using (Linux Docker, Linux Shell, Windows, or MacOS) and what is the version of the runner?
* What type of definition did these pipelines run on (was it the default, branches, tags, pull-requests, or custom)?
* In case the build did not run automatically, how did you trigger it?

Kind regards,  
Theodora

comments: author: Maarten van der Schot
body: Hi Theodora,

Yes, on the commits page we have the build status, like so:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/290761iB07B33B5E593C38A/image-dimensions/250x127?v=v2 "image.png")

We run builds at push actions and run builds every night by schedule. No requests appear in at the webhooks, even after clicking "Load new requests":

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/290763i3DF4617C09BF3EEF/image-dimensions/278x46?v=v2 "image.png")

This is our setup now:

* We are using Linux Docker runners. (they live on a vm using docker compose)
* Runner version is 1.518
* The definition in my testcase "default"
* In my bitbucket-pipelines.yml I'm using a php base image (not atlassian/default-image:2 if that's of any effect. Who is firing the webhooks? BitBucket or my runners?)

Thanks for your help!

Best regards,  
Maarten


author: Theodora Boudale
body: Hi Maarten,

Thank you for the info. The image you specify in your bitbucket-pipelines.yml file shouldn't make a difference. When the build finishes, it's the runner that updates the build status of the commit (with failed or successful status) with an API call. After the commit's build status is created, it's Bitbucket that should trigger the webhook.

I still cannot reproduce this issue with a setup similar to yours, and since the commit statuses are there, I can't think of a reason why the webhook shows no requests.

I would suggest creating a ticket with the support team; if we have a support ticket, the engineer working on it will be able to check the repo's configuration and our logs to investigate this further.

You can create a ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product. When you are asked to provide the workspace URL, please make sure you enter the URL of the workspace that is on a paid billing plan to proceed with ticket creation.

Please feel free to let me know if you have any questions!

Kind regards,  
Theodora


author: Maarten van der Schot
body: Thanks Theodora, I will submit a ticket. If something comes up that is worth sharing, I will post it here.

Kind regards,  
Maarten


author: Saxea _Flowie_
body: Hi [@Maarten van der Schot](/t5/user/viewprofilepage/user-id/2286447) ,

These events are only triggered at the end of the build. So, if you want to know when the pipeline is running you probably need to subscribe to events that actually trigger your build like 'repo:push' and 'pullrequest:created'. Or alternatively, have the pipeline trigger your webhook.

Having said that, it should still have triggered those events after the build. Did it create a build status on the PR/commit?

comments: author: Maarten van der Schot
body: In this case I want to see if pipelines succeed of fail. If I handle the webhooks in my pipeline steps, it's possible that they never fire.

I agree that they should fire on "Build status created" and "Build status created". In my repo I sure see the build statusses:

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/290434i7A745651B575E3DE/image-dimensions/375x235?v=v2 "image.png")


author: Saxea _Flowie_
body: That's odd - I've created some dummy webhooks for these events in a test repo and they are being triggered correctly. It's not using runners though, not sure if this would affect in this case.


Tags: bitbucket-cloud

cloud