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

Lightweight checkout fails when Pipeline JenkinsFile is in a subfolder

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • Jenkins 2.73.2
      Bitbucket Branch Source Plugin 2.2.7

      The following error appears in a build output: 

      ERROR: Could not do lightweight checkout, falling back to heavyweight
      java.io.FileNotFoundException: URL: /rest/api/1.0/projects/PROJNAME/repos/reponame/browse/devopsJenkinsfile-CI/?at=master&start=0&limit=500
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getRequest(BitbucketServerAPIClient.java:517)
      	at com.cloudbees.jenkins.plugins.bitbucket.server.client.BitbucketServerAPIClient.getFileContent(BitbucketServerAPIClient.java:723)
      	at com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile.content(BitbucketSCMFile.java:81)
      

      We have the JenkinsFile within a subdirectory of the repo, not the root directory, and the job is configured the same with the Pipeline Jenkinsfile as follows:

      devops/Jenkinsfile-CI
      

      When pasting the path into a browser, it returns:

      {"errors":[{"context":null,"message":"The path \"devopsJenkinsfile-CI/\" does not exist at revision \"master\"","exceptionName":"com.atlassian.bitbucket.content.NoSuchPathException"}]}
      

      If we move the forward slash to the correct place in the URL

      /rest/api/1.0/projects/PROJNAME/repos/reponame/browse/devops/Jenkinsfile-CI?at=master&start=0&limit=500

      Then Bitbucket server returns the contents on the file in JSON.

            Unassigned Unassigned
            robertd Robert D
            Votes:
            9 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: