Bitbucket Cloud - Pipelines API Error: The value provided is not a valid uuid

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

Summary

While listing the steps for a pipeline or retrieving the log file for a step in a pipeline using the API, you may encounter the following error:

Get log file for a step API request

1 2 3 4 5 6 curl --request GET -u "${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}" --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_FULL_NAME}/pipelines/${BITBUCKET_PIPELINE_UUID}/steps/${BITBUCKET_STEP_UUID}/log" output: {"error": {"message": "Not found", "detail": "The value provided is not a valid uuid."}}

Cause

In Bitbucket Pipelines, the BITBUCKET_PIPELINE_UUID & BITBUCKET_STEP_UUID are predefined environment variables, that hold the UUID (Universally Unique Identifier) of the current pipeline execution. Their values are enclosed within curly braces {}.

Example:

1 BITBUCKET_PIPELINE_UUID={11d87b82-13c6-47a3-8e28-73a2bc378675}

While performing the API request, the variable value is being expanded without braces {}, which leads to an invalid UUID and triggers the error.

Example:

1 /2.0/repositories/abc/efg/pipelines/11d87b82-13c6-47a3-8e28-73a2bc378675/steps/372c1080-d00f-4990-82af-9c3685563f88/log

Solution

To include the curly braces in the API request URL, one needs to encode them as they have special meaning in URLs. In the command, one should replace the curly braces {} with their URL-encoded counterparts %7B for { and %7D for }.

Here's the sample modified command with the URL-encoded curly braces:

1 curl -vvvv --request GET -u "${BITBUCKET_USERNAME}:${BITBUCKET_APP_PASSWORD}" --url "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_FULL_NAME}/pipelines/%7B${BITBUCKET_PIPELINE_UUID}%7D/steps/%7B${BITBUCKET_STEP_UUID}%7D/log"

This will ensure that the variable values are being expanded with braces {}.

sample output:

1 /2.0/repositories/abc/efg/pipelines/{11d87b82-13c6-47a3-8e28-73a2bc378675}/steps/{372c1080-d00f-4990-82af-9c3685563f88}/log
Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.