"Invalid SFDX auth URL" error in Pipelines

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

Summary

The purpose of this KB article is to provide potential reasons why this error message may occur in Pipelines and suggest potential avenues of troubleshooting for resolving it.

Diagnosis

You are attempting to deploy to a Salesforce environment using SFDX in Bitbucket Pipelines, but the build fails, and the following error is encountered:

1 2 Error (1): Invalid SFDX auth URL. Must be in the format "force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>". Note that the SFDX auth URL uses the "force" protocol, and not "http" or "https". Also note that the "instanceUrl" inside the SFDX auth URL doesn't include the protocol ("https://").

Cause

A likely cause of this error is as the error message suggests:

  • Either the protocol used within your URL is incorrect,the URL syntax is incorrect, or some combination of both.

Solution

  1. Check the URL being called in your YML configuration (this may be stored in plaintext or via repository/workspace/deployment variables) - first, ensure that the force protocol is used in the URL rather than HTTP/HTTPS.

  2. Once this has been checked, analyse the format of the URL - ensure that it is in the following format and that the values contained within are correct by verifying these: force://<clientId>:<clientSecret>:<refreshToken>@<instanceUrl>

  3. Make sure that there are no syntactical errors. For example - there are no extra ":" delimiters present anywhere, as this can cause SFDX to become confused as to what you are trying to indicate when separating these values in the URL

This article is intended to assist users based on past support troubleshooting efforts. Suppose the above instructions don't help in resolving the issue. In that case, you will need to contact Salesforce support for further assistance, as this error is Salesforce-specific and falls outside our support scope for Bitbucket Cloud.

Updated on April 11, 2025

Still need help?

The Atlassian Community is here for you.