Bitbucket Pull Requests fail with 'ERROR: Could not do lightweight checkout, falling back to heavyweight'

Article ID:360051726072
1 minute readKnowledge base


Bitbucket Pull Requests fail with "ERROR: Could not do lightweight checkout, falling back to heavyweight"

ERROR: Could not do lightweight checkout, falling back to heavyweight URL: /path/to/my/awesome/project/Jenkinsfile?at=pull-requests%2F59%2Fmerge&start=0&limit=500
	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(
	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getFileContent(
	at com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile.content(
	at jenkins.scm.api.SCMFile.contentAsString(
	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(
	at hudson.model.ResourceController.execute(


Here is the relevent comment from the JIRA

The linked comment below indicates that in BitBucket 7 Atlassian has removed the ability to do lightweight checkout while using the "Merging" strategy. This is "intentional" and "by-design" behavior implemented by Atlassian. It is beyond the control of Jenkins project to fix this at this time. If your build fails while attempting to checkout, be sure you’ve enabled "Call changes API" for your Bitbucket 7 endpoints.

The solution is to enable the Call changes API for your BitBucket server endpoint. This setting can be enabled per BitBucket server endpoint under Jenkins > Manage Jenkins > Bitbucket Endpoints:

bitbucket call changes api

Please note the Call changes API setting was added in version 2.9.0 of the bitbucket-branch-source plugin. You will need to upgrade the Bitbucket Branch Source plugin to version 2.9.0 or higher. If you are a CloudBees customer, you may need to temporarily disable the CloudBees Assurance Program (CAP) in order to find the update as explained here: Plugins missing from Update Center after installing CloudBees Jenkins v2.x — CloudBees Support