Bitbucket "Your build exceeded the maximum build time"
By Daniel Zoghalchali·Latchkey
A step ran longer than its build-time limit (120 minutes by default, configurable via max-time) and Bitbucket killed it. The step is stopped mid-run, not failed by your code.
What this error means
A step is terminated with "Your build exceeded the maximum build time and was stopped." The logs simply cut off where the limit hit - there is no error from your own command.
Bitbucket log
Your build exceeded the maximum build time and was stopped.
Common causes
The step genuinely takes too long
A slow test suite, large build, or heavy install can exceed the default 120-minute cap (or a lower max-time you set).
A hang or deadlock
A command waiting on input, a deadlocked test, or a process that never exits will run until the limit and then be killed.
How to fix it
Raise the step max-time
Set max-time (in minutes) on the step or globally. The cap depends on your plan; you cannot exceed the plan maximum.
Add timeouts to network calls and test runners so a hang fails fast.
Ensure no command waits on stdin in CI.
Cache dependencies so install time does not eat the budget.
How to prevent it
Cache dependencies and build outputs to cut step duration.
Parallelize long test suites across steps.
Add per-command timeouts so hangs surface quickly.
Frequently asked questions
What causes ""exceeded the maximum build time""?
A slow test suite, large build, or heavy install can exceed the default 120-minute cap (or a lower max-time you set).
How do I fix "exceeded the maximum build time"?
Set max-time (in minutes) on the step or globally. The cap depends on your plan; you cannot exceed the plan maximum.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.