Bitbucket pipeline is failing with Exceeded build time limit error

Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.

Summary

Your Pipelines build fails with the error:

Exceeded build time limit of 120 minutes

Cause

This error occurs because your step's commands take longer to run than the step's maximum time.

By default, the maximum time a Pipelines step can run is 120 minutes.

The step max-time can also be configured manually on the bitbucket-pipelines.yml file, so you may see a different value in your error message instead of 120.

Solution

A step's max-time can be configured to any positive integer between 1 and 720 (this represents minutes). This is the case both for steps running on Atlasian infrastructure and for steps running with a self-hosted runner.

If a certain step needs more than the default max of 120 minutes to run, you can adjust the max-time in your bitbucket-pipelines.yml file for this step (or for all steps).

If you would like to troubleshoot time-consuming processes in your Pipelines build, you can follow the steps below:

Troubleshooting Steps

Check if there are time consuming processes in the Pipeline build. You can execute the command date +"%T" before and after each build command to find out which processes are taking more time than expected in the Pipeline. Also, test the build locally using the command date +"%T" to check which processes are consuming a large number of minutes.

If your Pipelines step runs on Atlassian's infrastructure or with a self-hosted Linux Docker runner, you can debug it locally following the steps outlined on Debug pipelines locally with Docker page.

Builds running with a self-hosted Linux Shell, MacOS, or Windows runner, use Bash (Linux Shell and MacOS) and PowerShell (Windows) to run steps directly on the host machine. You can clone the repo, reset to the commit of the failed build, and run the commands from your step's script directly on the host machine in Bash or PowerShell (depending on the OS).

Are the processes taking a similar amount of time in the Pipelines and local builds?

YES

  • Investigate the processes and identify why they are running for a longer time. Use the online resources based on the command and technology being used to identify what measures can be taken to reduce the process durations.

  • If there is a command waiting for user interaction, make sure these commands are run in a non-interactive mode.

  • If a certain command needs more memory or CPU to run faster, you can try increasing the build container size to 2x, 4x, 8x, or 16x as mentioned in the size option of a step. This is only applicable to builds running on Atlassian's infrastructure or with a self-hosted Linux Docker runner. The other types of runners (Linux Shell, MacOS, and Windows) have no restriction on the amount of memory and CPU used (they use what is available on the host).

NO

Updated on September 11, 2025

Still need help?

The Atlassian Community is here for you.