Lesstep
Bitbucket Cloud · Pipelines · Checked October 30, 2026

Bitbucket Pipelines: "Step exceeded processing limits and has timed out"

The step hangs for about two hours, then fails, and this message appears next to the build log. Atlassian's article on it (Bitbucket pipeline build fails with error "Step exceeded processing limits") gives one cause: the names and values of all workspace, repository and deployment variables available to the build, put together, are longer than 120,000 characters. The same cause can also leave a pipeline queued with no end. The article puts the cause in the variables, not in your commands.

Not the same as "Exceeded build time limit"

Both messages can appear after two hours. "Exceeded build time limit of 120 minutes" means a command in the step ran longer than its max-time. This one is about the size of the variables. If your total is under 120,000 characters and you still get this message, Atlassian asks you to raise a support ticket with the build's URL.

Where the variables are

The value of a secured variable is not shown on these screens. Bitbucket's API returns it empty too (the Pipelines API reference: “If the variable is secured, this will be empty.”). You have to know those values and add their lengths yourself.

Add them up with a script

This Python 3 script, with nothing to install, reads the three levels through Bitbucket's API and prints the total for steps without a deployment and for each deployment environment. Secured values count as zero, and the script prints their names so you know what to add. Create an API token with the scope read:pipeline:bitbucket; it signs in with your Atlassian account email and the token (Atlassian's Using API tokens).

import base64, json, os, sys
from urllib.parse import quote
from urllib.request import (
    Request, urlopen)

API = "https://api.bitbucket.org/2.0"
ws, repo = sys.argv[1], sys.argv[2]
who = os.environ["BB_EMAIL"] + ":"
who += os.environ["BB_TOKEN"]
auth = "Basic " + base64.b64encode(
    who.encode()).decode()
head = {"Authorization": auth}


def values(path):
    url = API + path
    while url:
        req = Request(url, headers=head)
        res = urlopen(req)
        page = json.load(res)
        yield from page["values"]
        url = page.get("next")


def size(path, at):
    n = 0
    for v in values(path):
        k = v["key"]
        n += len(k)
        n += len(v.get("value") or "")
        if v.get("secured"):
            print(at, "secured:", k)
    return n


r = f"/repositories/{ws}/{repo}"
base = size(
    f"/workspaces/{ws}"
    "/pipelines-config/variables",
    "workspace")
base += size(
    r + "/pipelines_config/variables",
    "repository")
print("no deployment:", base)
for e in values(r + "/environments"):
    at = e.get("name", e["uuid"])
    u = quote(e["uuid"])
    n = size(
        r + "/deployments_config"
        f"/environments/{u}/variables",
        at)
    print(at + ":", base + n)

Save it as vars.py and run it with your workspace and repository as they appear in the repository's address:

export BB_EMAIL=you@example.com
export BB_TOKEN=...
python3 vars.py my-workspace my-repo

It adds up every variable at the three levels, as Atlassian's article describes, including a repository variable with the same name as a workspace variable. We ran the script against a local server that answers the way Bitbucket's API reference describes (pages with next links, environment UUIDs in braces, secured values empty) and got the totals we expected. We have not run it against a real workspace.

Make the total smaller

Atlassian's fix is to remove variables or shorten very long values until the total is under 120,000 characters. Look first at values that hold a whole file, such as a certificate, a keystore or a key file in base64: base64 is a third longer than the file, so a 30 KB file alone is 40,000 characters. Then:

Atlassian's request for a clearer error in this case is still open: BCLOUD-20105 (opened in April 2020, “Gathering Interest”).

See the failed step from IntelliJ IDEA

Pipeline Inbox for Bitbucket Pipelines, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, lists the pipelines of all your Bitbucket Cloud repositories in an IDE tool window, with their steps. When Bitbucket ends a step itself, the plugin shows the reason Bitbucket gave, then the command that was running and its last lines. After you shorten the variables there is no new commit to push: with Pro, Run again builds the same commit once more from the IDE. The list, steps and logs are free; running, re-running and stopping pipelines are Pro (US$1.50 a month, with a 30-day trial).

Get it on JetBrains Marketplace

Atlassian, Bitbucket and Bitbucket Pipelines are trademarks of Atlassian; Python is a trademark of the Python Software Foundation; AWS is a trademark of Amazon.com, Inc. or its affiliates; Google Cloud is a trademark of Google LLC; Vault is a trademark of HashiCorp; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by any of them.

More: "Exceeded build time limit of 120 minutes" · "No space left on device" · "No online runner available" · "We couldn't clone the repository" · Submodules not cloned · "command not found" · "unexpected system error" · The cache is not used · Pipelines did not run after a push · "Container 'Build' exceeded memory limit." · "Container 'docker' exceeded memory limit." · The artifact is missing in the next step · The build passed before and fails now · Build setup takes too long · "You've run out of build minutes" · "Permission denied to update branch" · "You have reached your pull rate limit" (Docker Hub) · "There is an error in your bitbucket-pipelines.yml" · "This pipeline was paused" (deployments) · Bitbucket Pipelines plugins for IntelliJ IDEA, compared · 日本語