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

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

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • Jenkins:
      Core: 2.89
      Plugins: latest on experimental update center, including Blue Ocean 1.3.2
      bitbucket-branch-source 2.2.7

      Client:
      Fedora Workstation 26
      Chrome 62.0.3202.89

      SCM:
      Bitbucket Server 5.2.3
    • Pipeline - December

      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.

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

          [JENKINS-47984] Adding Bitbucket server with http instead of https URL breaks Creation flow

          Karl Shultz created issue -
          Karl Shultz made changes -
          Summary Original: Unable to create Jenkinsfile in existing Bitbucket Server repo which doesn't have one New: Unable to create or modify Jenkinsfiles in Bitbucket Server repos
          Karl Shultz made changes -
          Attachment New: screenshot-1.png [ 40302 ]
          Karl Shultz made changes -
          Attachment New: screenshot-2.png [ 40303 ]
          Karl Shultz made changes -
          Attachment New: screenshot-3.png [ 40304 ]

          Karl Shultz added a comment -

          Update:
          It's actually nothing to do with creation of a Jenkinsfile in an existing repo which doesn't have one. I've tried some other things, and can't modify existing Jenkinsfiles, either.

          1. Using the same local repo, I checked out a new branch, created a Jenkinsfile in it, and pushed to the remote:

          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [master|…16] 
          19:42 $ git checkout -b "not-using-editor"
          Switched to a new branch 'not-using-editor'
          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|…16] 
          19:42 $ vi Jenkinsfile
          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●1…1] 
          19:44 $ git status
          On branch not-using-editor
          Changes to be committed:
            (use "git reset HEAD <file>..." to unstage)
          
          	new file:   Jenkinsfile
          
          Untracked files:
            (use "git add <file>..." to include in what will be committed)
          
          	.gitignore
          
          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●1…1] 
          19:44 $ git add .gitignore 
          ✘-1 ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●2] 
          19:45 $ git commit -m "Editor not being used for this. See if I can build in BO after the Jenkinsfile is up. If I can, we have an issue."
          [not-using-editor 715d51c] Editor not being used for this. See if I can build in BO after the Jenkinsfile is up. If I can, we have an issue.
           2 files changed, 37 insertions(+)
           create mode 100644 .gitignore
           create mode 100644 Jenkinsfile
          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|✔] 
          19:45 $ git push
          fatal: The current branch not-using-editor has no upstream branch.
          To push the current branch and set the remote as upstream, use
          
              git push --set-upstream origin not-using-editor
          
          ✘-128 ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|✔] 
          19:45 $ git push --set-upstream origin not-using-editor
          warning: redirecting to https://bitbucket.beescloud.com/scm/nov/simple-maven-project-with-tests.git/
          Counting objects: 4, done.
          Delta compression using up to 4 threads.
          Compressing objects: 100% (3/3), done.
          Writing objects: 100% (4/4), 775 bytes | 775.00 KiB/s, done.
          Total 4 (delta 0), reused 0 (delta 0)
          remote: 
          remote: Create pull request for not-using-editor:
          remote:   http://bitbucket.beescloud.com/projects/NOV/repos/simple-maven-project-with-tests/compare/commits?sourceBranch=refs/heads/not-using-editor
          remote: 
          To http://bitbucket.beescloud.com/scm/nov/simple-maven-project-with-tests.git
           * [new branch]      not-using-editor -> not-using-editor
          Branch not-using-editor set up to track remote branch not-using-editor from origin.
          ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor|✔]
          

          2. Verify that the Jenkinsfile made it over to the new branch:

          3. I deleted the repo, and rediscovered it using Blue Ocean. The original branch not-using-editor built successfully.

          4. I then edited the Pipeline using the editor, and attempted to save my changes to a new branch:

          5. Same result when attempting to save to the new branch:

          Karl Shultz added a comment - Update: It's actually nothing to do with creation of a Jenkinsfile in an existing repo which doesn't have one. I've tried some other things, and can't modify existing Jenkinsfiles, either. 1. Using the same local repo, I checked out a new branch, created a Jenkinsfile in it, and pushed to the remote: ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [master|…16] 19:42 $ git checkout -b "not-using-editor" Switched to a new branch 'not-using-editor' ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|…16] 19:42 $ vi Jenkinsfile ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●1…1] 19:44 $ git status On branch not-using-editor Changes to be committed: (use "git reset HEAD <file>..." to unstage) new file: Jenkinsfile Untracked files: (use "git add <file>..." to include in what will be committed) .gitignore ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●1…1] 19:44 $ git add .gitignore ✘-1 ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|●2] 19:45 $ git commit -m "Editor not being used for this. See if I can build in BO after the Jenkinsfile is up. If I can, we have an issue." [not-using-editor 715d51c] Editor not being used for this. See if I can build in BO after the Jenkinsfile is up. If I can, we have an issue. 2 files changed, 37 insertions(+) create mode 100644 .gitignore create mode 100644 Jenkinsfile ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|✔] 19:45 $ git push fatal: The current branch not-using-editor has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin not-using-editor ✘-128 ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor L|✔] 19:45 $ git push --set-upstream origin not-using-editor warning: redirecting to https://bitbucket.beescloud.com/scm/nov/simple-maven-project-with-tests.git/ Counting objects: 4, done. Delta compression using up to 4 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (4/4), 775 bytes | 775.00 KiB/s, done. Total 4 (delta 0), reused 0 (delta 0) remote: remote: Create pull request for not-using-editor: remote: http://bitbucket.beescloud.com/projects/NOV/repos/simple-maven-project-with-tests/compare/commits?sourceBranch=refs/heads/not-using-editor remote: To http://bitbucket.beescloud.com/scm/nov/simple-maven-project-with-tests.git * [new branch] not-using-editor -> not-using-editor Branch not-using-editor set up to track remote branch not-using-editor from origin. ✔ ~/Documents/CloudBees/Work/BlueOcean1.4/bitbucket-branch-source-repos/simple-maven-project-with-tests [not-using-editor|✔] 2. Verify that the Jenkinsfile made it over to the new branch: 3. I deleted the repo, and rediscovered it using Blue Ocean. The original branch not-using-editor built successfully. 4. I then edited the Pipeline using the editor, and attempted to save my changes to a new branch: 5. Same result when attempting to save to the new branch:

          Karl Shultz added a comment -

          Just happened to be tailing my Jenkins log, and spotted this:

          Nov 14, 2017 1:20:38 AM jenkins.branch.MultiBranchProject$BranchIndexing run
          INFO: simple-maven-project-with-tests #20171114.012038 branch indexing action completed: SUCCESS in 0.31 sec
          Nov 14, 2017 1:20:43 AM io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout
          INFO: Automatically favorited simple-maven-project-with-tests/not-using-editor for kshultz
          Nov 14, 2017 1:20:53 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish
          INFO: simple-maven-project-with-tests/not-using-editor #1 completed: SUCCESS
          Nov 14, 2017 1:22:01 AM org.apache.http.impl.execchain.RetryExec execute
          INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://bitbucket.beescloud.com:80: Broken pipe
          Nov 14, 2017 1:22:01 AM org.apache.http.impl.execchain.RetryExec execute
          INFO: Retrying request to {}->http://bitbucket.beescloud.com:80
          

          Karl Shultz added a comment - Just happened to be tailing my Jenkins log, and spotted this: Nov 14, 2017 1:20:38 AM jenkins.branch.MultiBranchProject$BranchIndexing run INFO: simple-maven-project-with-tests #20171114.012038 branch indexing action completed: SUCCESS in 0.31 sec Nov 14, 2017 1:20:43 AM io.jenkins.blueocean.autofavorite.FavoritingScmListener onCheckout INFO: Automatically favorited simple-maven-project-with-tests/not-using-editor for kshultz Nov 14, 2017 1:20:53 AM org.jenkinsci.plugins.workflow.job.WorkflowRun finish INFO: simple-maven-project-with-tests/not-using-editor #1 completed: SUCCESS Nov 14, 2017 1:22:01 AM org.apache.http.impl.execchain.RetryExec execute INFO: I/O exception (java.net.SocketException) caught when processing request to {}->http://bitbucket.beescloud.com:80: Broken pipe Nov 14, 2017 1:22:01 AM org.apache.http.impl.execchain.RetryExec execute INFO: Retrying request to {}->http://bitbucket.beescloud.com:80

          Michael Neale added a comment -

          kshultz and this is specific to 2.2.7 or 2.2.6? ie not before

           

          https://github.com/jenkinsci/blueocean-plugin/pull/1492 has test that can help cover this too BTW. 

           

          Hey vivek any ideas if this is a regression in BBBS or blue ocean? 

          Michael Neale added a comment - kshultz and this is specific to 2.2.7 or 2.2.6? ie not before   https://github.com/jenkinsci/blueocean-plugin/pull/1492  has test that can help cover this too BTW.    Hey vivek any ideas if this is a regression in BBBS or blue ocean? 
          Michael Neale made changes -
          Epic Link New: JENKINS-35759 [ 171771 ]
          Michael Neale made changes -
          Sprint New: Blue Ocean 1.4 - beta 3 [ 416 ]

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

              Created:
              Updated:
              Resolved: