Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Webhooks on build start/update won't fire

Maarten van der Schot November 6, 2023

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

image.png

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 8, 2023

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

 

  • 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

Maarten van der Schot November 8, 2023

Hi Theodora,

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

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

 

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

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 10, 2023

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

Like Maarten van der Schot likes this
Maarten van der Schot November 12, 2023

Thanks Theodora, I will submit a ticket. If something comes up that is worth sharing, I will post it here.

 

Kind regards,
Maarten

Like Theodora Boudale likes this
0 votes
Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2023

Hi @Maarten van der Schot ,

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?

Maarten van der Schot November 7, 2023

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

Saxea _Flowie_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 7, 2023

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events