"after-script:" is not triggered when "artifacts" failed.

Issue #19122 open
Soonthorn Ativanichayaphong created an issue

https://bitbucket.org/pryoninc/api-tests-go/addon/pipelines/home?utm_term=pipeline&utm_source=bb-slack&utm_medium=referral-external&atlOrigin=eyJpIjoiMWRiZjlmZjhkYmE3NDg0Mzk3NWI3ODZhZjczNGQyODQiLCJwIjoiYmItY2hhdHMtaW50ZWdyYXRpb24ifQ#!/results/4702

Hi,

I understood that you had an incident yesterday that caused pipelines to fail to create an artifact.

https://bitbucket.status.atlassian.com/incidents/cqdkw0ywy34q

What I am asking here is that, in the situation that your pipelines steps failed internally (in this case “artifacts“ failed), could you please ensure that “after-script:” still triggered so that we have a chance to clean up our expensive resources.

Please let me know if you have any question.

Comments (5)

  1. aneita staff
    • changed status to open

    Thanks for reaching out and for bringing this to our attention.

    I’ve created a ticket in our backlog to investigate this in more detail. I’ll keep you updated on our progress via this ticket.

  2. aneita staff

    Just to clarify, when is the after-script configured to run? Is it expected to run regardless of whether the pipeline passes or fails?

  3. Soonthorn Ativanichayaphong reporter

    Hi Aneita,

    Thank you for looking into it. Yes, the “after-script” is expected to run regardless of whether the step has failed or succeeded. We also use BITBUCKET_EXIT_CODE environment variable to check the status code returned from the last command run in “script”.

    Please note that this is working in a normal situation. It doesn’t work when there is an “error” due to Bitbucket’s “internally” issues as shown in the screenshot attached in this case.

  4. Luke Siler

    If pipeline encounters a failure that will prevent steps from continuing then we ask that after script be called with BITBUCKET_EXIT_CODE that indicates failure. This will give us a chance to run proper clean-up of resources provisioned in our public cloud accounts by the pipeline.

  5. Log in to comment