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

Adding Bitbucket server with http instead of https URL breaks Creation flow

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Environment:
    • Epic Link:
    • Sprint:
      Pipeline - December
    • Similar Issues:

      Description

      Summary:
      After successfully connecting to a repo on a Bitbucket server which has code, but does not have a Jenkinsfile in it, attempting to create one fails in Blue Ocean. The only error message shown is the word "Found" in red text. This is caused by setting up the Bitbucket server with an HTTP URL, rather than an HTTPS URL. Changing from HTTP to HTTPS resolves the issue.

      Routing:
      It's unclear to me at the moment if this is an issue in bitbucket-branch-source, in BO itself, in the editor, or somewhere else.

      Steps to recreate:
      1. Make a local clone of the simple-maven-project-with-tests repo found here.

      2. On your Bitbucket server, create a repository, which you'll use as a remote for this repo you just cloned:

      3. Using Blue Ocean, connect to this Bitbucket server by providing your credentials. Shown below, I've gotten as far as having found the repo, but have not yet selected it:

      4. Click "Create Pipeline." You'll be told there are no Jenkinsfiles, which is expected.

      5. Click the second "Create Pipeline" button which was just generated, and you'll be taken to the editor:

      6. Leave Agent set to any (the default), and click the button to create a stage. Add a Shell Script step, and enter mvn -X clean package as the step:

      7. Click Save, enter a commit message, and leave the default setting of Commit to master. Click Save and Run, and notice the Error at the top of this same dialog:

      8. This can also be recreated by using a different branch name than master.

      Why this is a problem:

      • I've been given no direction as far as what has gone wrong.
      • There's nothing at all in the Jenkins log

      Later this evening, I'll capture a HAR file while retracing my steps.

        Attachments

        1. 172.18.40.95.har
          1.59 MB
        2. image-2017-11-13-17-36-29-175.png
          image-2017-11-13-17-36-29-175.png
          376 kB
        3. image-2017-11-13-17-38-30-222.png
          image-2017-11-13-17-38-30-222.png
          306 kB
        4. image-2017-11-13-17-39-14-912.png
          image-2017-11-13-17-39-14-912.png
          323 kB
        5. image-2017-11-13-17-39-47-604.png
          image-2017-11-13-17-39-47-604.png
          298 kB
        6. image-2017-11-13-17-42-01-061.png
          image-2017-11-13-17-42-01-061.png
          311 kB
        7. image-2017-11-13-17-44-04-291.png
          image-2017-11-13-17-44-04-291.png
          352 kB
        8. screenshot-1.png
          screenshot-1.png
          427 kB
        9. screenshot-2.png
          screenshot-2.png
          400 kB
        10. screenshot-3.png
          screenshot-3.png
          400 kB
        11. screenshot-4.png
          screenshot-4.png
          569 kB
        12. screenshot-5.png
          screenshot-5.png
          361 kB
        13. screenshot-6.png
          screenshot-6.png
          354 kB

          Issue Links

            Activity

            Hide
            michaelneale Michael Neale added a comment -

            Vivek Pandey ok in that case I revoke my statement, yes should be honoured. The fact that github say this implies they would likely change their mind and move apis around, so should follow it (I guess Bitbucket would have same policy). Good digging 

            Show
            michaelneale Michael Neale added a comment - Vivek Pandey ok in that case I revoke my statement, yes should be honoured. The fact that github say this implies they would likely change their mind and move apis around, so should follow it (I guess Bitbucket would have same policy). Good digging 
            Hide
            vivek Vivek Pandey added a comment -

            Michael NealeKarl Shultz bitbucket API docs do not talk about handling of 302. So I talked to Bitbucket guys about it. They suggested disabling auto-redirect. I think its best we report error and tell users that bitbucket is suggesting a different URL to be used and users should use that instead.

            Show
            vivek Vivek Pandey added a comment - Michael Neale Karl Shultz bitbucket API docs do not talk about handling of 302. So I talked to Bitbucket guys about it. They suggested disabling auto-redirect. I think its best we report error and tell users that bitbucket is suggesting a different URL to be used and users should use that instead.
            Hide
            vivek Vivek Pandey added a comment -

            Reduced scope to Minor as using incorrect URL (http instead of https if bb server is running behind https) is expected to fail during creation flow. The fix is going to be fail early/fast instead of at the very end when Jenkinsfile is saved.

            Show
            vivek Vivek Pandey added a comment - Reduced scope to Minor as using incorrect URL (http instead of https if bb server is running behind https) is expected to fail during creation flow. The fix is going to be fail early/fast instead of at the very end when Jenkinsfile is saved.
            Show
            vivek Vivek Pandey added a comment - PR opened: https://github.com/jenkinsci/blueocean-plugin/pull/1558
            Hide
            kshultz Karl Shultz added a comment -

            Testing Notes:

            • A test is already part of the PR.
            Show
            kshultz Karl Shultz added a comment - Testing Notes: A test is already part of the PR .

              People

              • Assignee:
                vivek Vivek Pandey
                Reporter:
                kshultz Karl Shultz
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: