Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-49353

ERROR: Could not do lightweight checkout, falling back to heavyweight

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • Jenkins 2.104
      Jenkins Bitbucket Branch Source Plugin 2.2.9
      Bitbucket Server 5.6.0

      When building a PR that hasn't had changes to the Jenkinsfile within the PR, we see the following error at the beginning of each build:

      Branch event
      ERROR: Could not do lightweight checkout, falling back to heavyweight
      java.io.FileNotFoundException: URL: /rest/api/1.0/projects/TCD/repos/deployer-ish/browse/Jenkinsfile?at=PR-216&start=0&limit=500
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:628)
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getFileContent(BitbucketServerAPIClient.java:867)
      	at com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile.content(BitbucketSCMFile.java:99)
      	at jenkins.scm.api.SCMFile.contentAsString(SCMFile.java:338)
      	at org.jenkinsci.plugins.workflow.multibranch.SCMBinder.create(SCMBinder.java:104)
      	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:271)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      

      This is because Bitbucket Server does not expose the Jenkinsfile on such a PR, i.e.

      // 20180203112420
      // https://stash.my.com//rest/api/1.0/projects/TCD/repos/deployer-ish/browse/Jenkinsfile?at=PR-216&start=0&limit=500
      
      {
        "errors": [
          {
            "context": null,
            "message": "The path \"Jenkinsfile\" does not exist at revision \"PR-216\"",
            "exceptionName": "com.atlassian.bitbucket.content.NoSuchPathException"
          }
        ]
      }
      

      This should not be an error, as if there are no changes to the Jenkinsfile, then Bitbucket will not include the file on that request.

            Unassigned Unassigned
            bengineer Ben Middleton
            Votes:
            24 Vote for this issue
            Watchers:
            31 Start watching this issue

              Created:
              Updated: