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

Lightweight checkout not working for branches that contain forward slash '/'

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • Jenkins version 2.73.3
      bitbucket-branch-source-plugin version 2.2.7

      I am using bitbucket-branch-source-plugin version 2.2.7 (currently the latest one) and lightweight checkout for Jenkinsfile fails for branches that contain forward slash '/'. I tried with different branches like ft/*. 

      The functionality fallbacks to heavyweight checkout, so it keeps working. Here is the exception that I get:

      ERROR: Could not do lightweight checkout, falling back to heavyweight
      java.io.FileNotFoundException: URL: https://api.bitbucket.org/2.0/repositories/owner/repository/src/ft%2Fci/Jenkinsfile
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getRequestAsInputStream(BitbucketCloudApiClient.java:558)
      	at com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient.getFileContent(BitbucketCloudApiClient.java:719)
      	at com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile.content(BitbucketSCMFile.java:81)
      	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:263)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:421)

       

      The functionality works perfectly for branches like master, dev, development and release.

          [JENKINS-47978] Lightweight checkout not working for branches that contain forward slash '/'

          Georgi Hristov created issue -

          Stephan Budge added a comment -

          This is also affecting me.

          Stephan Budge added a comment - This is also affecting me.

          Luke Mondy added a comment -

          I've had this same issue, I've put up a pull-request to hopefully fix it:

          https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/84

          Luke Mondy added a comment - I've had this same issue, I've put up a pull-request to hopefully fix it: https://github.com/jenkinsci/bitbucket-branch-source-plugin/pull/84
          Andrew Bayer made changes -
          Link New: This issue duplicates JENKINS-47911 [ JENKINS-47911 ]
          Andrew Bayer made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          abayer, this is a similar problem, but not exactly the same. I think that the one that you are referring to ( JENKINS-47911 ) was fixed in 2.2.7.

          In this version (2.2.7) the escaping of the '/' character is fixed and the exception is not thrown, but the escaped branch name can't be found by the Bitbucket API and the functionality fallbacks to the heavyweight checkout.

          Georgi Hristov added a comment - abayer , this is a similar problem, but not exactly the same. I think that the one that you are referring to ( JENKINS-47911 ) was fixed in 2.2.7. In this version (2.2.7) the escaping of the '/' character is fixed and the exception is not thrown, but the escaped branch name can't be found by the Bitbucket API and the functionality fallbacks to the heavyweight checkout.

          Luke Mondy added a comment -

          ghristov88 I found 2.2.7 still had the '/' not being escaped, hence my PR - but I think you are also right about the branch name not working.

          Luke Mondy added a comment - ghristov88 I found 2.2.7 still had the '/' not being escaped, hence my PR - but I think you are also right about the branch name not working.

          Wasn't the complete fix

          Stephen Connolly added a comment - Wasn't the complete fix
          Stephen Connolly made changes -
          Resolution Original: Duplicate [ 3 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

          2.2.8

          Stephen Connolly added a comment - 2.2.8
          Stephen Connolly made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Reopened [ 4 ] New: Resolved [ 5 ]

            jetersen Joseph Petersen
            ghristov88 Georgi Hristov
            Votes:
            6 Vote for this issue
            Watchers:
            20 Start watching this issue

              Created:
              Updated:
              Resolved: