Builds were successful earlier, but started failing recently
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary

Solution
Possible causes:
Code change
Build image change by the vendor
Workspace/Repository/Deployment variables change
Third party dependency outage/change
Bitbucket Outage
Pipeline Infrastructure change
Troubleshooting Steps:
Rerun the last successful build by selecting the build number and clicking on the Rerun button. Is it still successful on re-run?
YES :
Review code changes between successful and failed builds and investigate why the build is failing.
NO :
Abstract Bitbucket pipelines infrastructure and test build locally by following the steps outlined on Troubleshoot failed pipelines locally with Docker.
If the same build fails locally, then this is not an issue with Bitbucket pipelines infrastructure or configuration and you need to continue troubleshooting steps until you are able to run this build successfully with docker.
If the same build is successful when testing locally with docker, then please raise a Support Ticket and share the logs from your locally run build.
Other things to consider
Compare the build image SHA (example: build : docker.io/library/python@sha256:03ac9e...) between successful and failed builds in the Build setup section of the build log. You can find the Build setup section as the first section in the Build tab in the Pipeline log. If there is a change, use the image hash from the successful build by pinning the exact image SHA in the bitbucket-pipelines.yml as instructed Pin images by digest section on this page and run the build.
Check if there is a recent change in the Workspace, Repository, and Deployment variables. If there is a change, use the previous values of variables and rerun the failed build.
Are you using any 3rd party platform for images? If yes, check if they are having an outage by going to the appropriate status page. The following list provides links to some major third-party image platforms. You may have to reach out to the third-party platform’s support team and raise the ticket.
Other dependencies can also change. Pin the versions of code dependencies if packages were installed using e.g. via apt, yum, apk, those versions may have changed
Check if Bitbucket Cloud had or is currently having an outage by visiting the Bitbucket status page. If there is an incident that could be causing the run failure, then re-run the failed build once the incident is resolved.
Check if Bitbucket Pipelines has a recent infrastructure update by visiting the Bitbucket Infrastructure. Use the recommendations if there are any.
Was this helpful?