-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Environment Details:
Bitbucket Branch Source Plugin: 935.1.3
Jenkins Version: 2.492.3
Bitbucket Enterprise Server
I'm using the Mirror Clone feature of the Bitbucket Branch Source Plugin to improve performance, since our main Bitbucket server is located in the US and we have a local mirror setup.
The mirror functionality works perfectly when cloning public repositories. However, when trying to use it with private repositories (even when the build user has proper read access), the plugin fails to clone from the mirror.
Instead, it falls back to the primary Bitbucket server in the US, which significantly increases build times. This behavior is quite frustrating and took a long time to trace back to the root cause.
Observed Behavior:
✅ Public repository → Mirror clone works as expected.
❌ Private repository (with valid read access) → Mirror URL not work → Falls back to main server.
Expected Behavior:
Private repositories should be cloned from the mirror as long as the build user has the necessary read permissions, just like with public repositories.
Error Message:
Could not determine mirror clone links of MYPROJECT on https://bitbucket.blabalab for org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject@605945c6[test] falling back to primary server com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException: HTTP request error. Status: HTTP/1.1 401 Response: {"errors":[{"context":null,"message":"You are not permitted to access this resource","exceptionName":"com.atlassian.bitbucket.AuthorisationException"}]} Server: nginx/1.20.1 Date: Mon, 14 Apr 2025 Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive X-AREQUESTID: @Y0X9C4x657x1613928x1 X-AUSERID: 42429 X-AUSERNAME: BUILDUSER Cache-Control: no-cache, no-transform Vary: x-ausername,x-auserid,cookie,accept-encoding X-Content-Type-Options: nosniff WWW-Authenticate: OAuth realm="https://mirror.bitbucket.blabalab"
- duplicates
-
JENKINS-75680 Authentication fails when call secured REST API
-
- Closed
-