XRAY: Frogbot in Azure DevOps: How to resolve “couldn't find remote ref” error message

XRAY: Frogbot in Azure DevOps: How to resolve “couldn't find remote ref” error message

Products
JFrog_Xray
Content Type
Installation_Setup
AuthorFullName__c
David Lee
articleNumber
000006453
FirstPublishedDate
2025-05-22T06:09:53Z
lastModifiedDate
2025-05-21
VersionNumber
1
Introduction 

After installing Frogbot in Azure Devops and setting the required environment variables, Frogbot scans may fail with the following error:
16:57:52 [Error] git clone <branch-name> from https://test.azure.com/test/project/_git/JFrog failed with error: couldn't find remote ref "refs/heads/<branch-name>"

This article will walk you through resolving the error message.


Resolution
 


1. The Azure Pipelines predefines the $JF_GIT_BASE_BRANCH variable to “$(Build.SourceBranchName)”, which resolves to refs/heads/feature/<branch-name>. Due to this, Frogbot will attempt to find the remote ref using this path causing an error.
2. To resolve the issue, we will want to update the predefined JF_GIT_BASE_BRANCH variable to properly set the branch name without the “refs/heads” prefix:
JF_GIT_BASE_BRANCH: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]

Please refer to our Frogbot installation guide here for additional information.