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

"Repository name" in the first Bitbucket Server branch source clears when I change "Project name" in another branch source of the same multibranch project

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Trivial Trivial
    • Jenkins 2.277.3
      Bitbucket Server Integration plugin 2.1.3
      Git plugin 4.7.1
      Git client plugin 3.7.1
      Pipeline: Multibranch plugin 2.23
      SCM API plugin 2.6.4

      I had a Multibranch Pipeline project in Jenkins, with a Bitbucket Server branch source that refers to a repository in Bitbucket Server. That worked OK. Then I added a second Bitbucket Server branch source to the same Jenkins project, now referring to a personal fork of the repository. The original repository and the fork have only one branch each, and the names of these branches are not the same, so I hoped that Jenkins would find both branches. However, when I typed the name of my profile in the "Project name" field of the second branch source, the configuration screen cleared the "Repository name" of the first branch source. I did not originally notice that before saving, and the empty "Repository name" field then caused the following exception:

      [Thu Apr 29 10:50:15 EEST 2021] Starting branch indexing...
      ERROR: [to huhtikuuta 29 10:50:15 EEST 2021] Could not fetch branches from source 5b61467d-72cb-4a41-b24d-c27900d1093d
      java.lang.NullPointerException
      	at hudson.Util.getDigestOf(Util.java:636)
      	at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
      	at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
      	at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
      	at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      [Thu Apr 29 10:50:15 EEST 2021] Finished branch indexing. Indexing took 1 ms
      FATAL: Failed to recompute children of [REDACTED]
      java.lang.NullPointerException
      	at hudson.Util.getDigestOf(Util.java:636)
      	at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
      	at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
      	at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
      	at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
      	at hudson.model.ResourceController.execute(ResourceController.java:97)
      	at hudson.model.Executor.run(Executor.java:429)
      Finished: FAILURE
      

      Editing one branch source on the configuration screen should not automatically clear or change any fields of other branch sources.

          [JENKINS-65509] "Repository name" in the first Bitbucket Server branch source clears when I change "Project name" in another branch source of the same multibranch project

          Kalle Niemitalo created issue -

          I tried the same with Bitbucket Branch Source plugin 2.9.8 and that worked just fine, even generated the appropriate "Bitbucket" sidebar link pointing to the correct repository of each branch. So yeah, this seems a bug in the Bitbucket Server Integration plugin.

          Kalle Niemitalo added a comment - I tried the same with Bitbucket Branch Source plugin 2.9.8 and that worked just fine, even generated the appropriate "Bitbucket" sidebar link pointing to the correct repository of each branch. So yeah, this seems a bug in the Bitbucket Server Integration plugin.

          Oops, I edited the configuration of the Multibranch Pipeline project again and I found that the "Repository name" field in the first branch source (which was supposed to refer to the original repository) was blank. I typed the repository name there and now the exception no longer occurs. So the actual bug here is that, when I select a Bitbucket Server project for the second branch source, the configuration UI clears the repository name from the first branch source as well.

          Kalle Niemitalo added a comment - Oops, I edited the configuration of the Multibranch Pipeline project again and I found that the "Repository name" field in the first branch source (which was supposed to refer to the original repository) was blank. I typed the repository name there and now the exception no longer occurs. So the actual bug here is that, when I select a Bitbucket Server project for the second branch source, the configuration UI clears the repository name from the first branch source as well.
          Kalle Niemitalo made changes -
          Summary Original: NullPointerException within BitbucketSCMSource.retrieve when Multibranch Pipeline project has two Bitbucket Server SCM sources New: Changing "Project name" in another branch source clears "NullPointerException within BitbucketSCMSource.retrieve when Multibranch Pipeline project has two Bitbucket Server SCM sources
          Kalle Niemitalo made changes -
          Summary Original: Changing "Project name" in another branch source clears "NullPointerException within BitbucketSCMSource.retrieve when Multibranch Pipeline project has two Bitbucket Server SCM sources New: "Repository name" in the first Bitbucket Server branch source clears when I change "Project name" in another branch source of the same multibranch project
          Kalle Niemitalo made changes -
          Description Original: I had a Multibranch Pipeline project in Jenkins, with a Bitbucket Server SCM source that refers to a repository in Bitbucket Server. That worked OK. Then I added a second Bitbucket Server SCM source to the same Jenkins project, now referring to a personal fork of the repository. The original repository and the fork have only one branch each, and the names of these branches are not the same, so I hoped that Jenkins would find both branches. Instead, I got the following exception. I'm not sure whether the problem is in the Bitbucket Server Integration plugin or in some other plugin.

          {noformat}
          [Thu Apr 29 10:50:15 EEST 2021] Starting branch indexing...
          ERROR: [to huhtikuuta 29 10:50:15 EEST 2021] Could not fetch branches from source 5b61467d-72cb-4a41-b24d-c27900d1093d
          java.lang.NullPointerException
          at hudson.Util.getDigestOf(Util.java:636)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
          at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
          at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
          at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
          at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          [Thu Apr 29 10:50:15 EEST 2021] Finished branch indexing. Indexing took 1 ms
          FATAL: Failed to recompute children of [REDACTED]
          java.lang.NullPointerException
          at hudson.Util.getDigestOf(Util.java:636)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
          at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
          at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
          at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
          at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          {noformat}
          New: I had a Multibranch Pipeline project in Jenkins, with a Bitbucket Server branch source that refers to a repository in Bitbucket Server. That worked OK. Then I added a second Bitbucket Server branch source to the same Jenkins project, now referring to a personal fork of the repository. The original repository and the fork have only one branch each, and the names of these branches are not the same, so I hoped that Jenkins would find both branches. However, when I typed the name of my profile in the "Project name" field of the second branch source, the configuration screen cleared the "Repository name" of the first branch source. I did not originally notice that before saving, and the empty "Repository name" field then caused the following exception:

          {noformat}
          [Thu Apr 29 10:50:15 EEST 2021] Starting branch indexing...
          ERROR: [to huhtikuuta 29 10:50:15 EEST 2021] Could not fetch branches from source 5b61467d-72cb-4a41-b24d-c27900d1093d
          java.lang.NullPointerException
          at hudson.Util.getDigestOf(Util.java:636)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
          at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
          at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
          at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
          at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          [Thu Apr 29 10:50:15 EEST 2021] Finished branch indexing. Indexing took 1 ms
          FATAL: Failed to recompute children of [REDACTED]
          java.lang.NullPointerException
          at hudson.Util.getDigestOf(Util.java:636)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1391)
          at jenkins.plugins.git.AbstractGitSCMSource.getCacheEntry(AbstractGitSCMSource.java:1218)
          at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:339)
          at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:566)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource$CustomGitSCMSource.accessibleRetrieve(BitbucketSCMSource.java:505)
          at com.atlassian.bitbucket.jenkins.internal.scm.BitbucketSCMSource.retrieve(BitbucketSCMSource.java:233)
          at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:373)
          at jenkins.scm.api.SCMSource.fetch(SCMSource.java:283)
          at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:641)
          at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:278)
          at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:165)
          at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:1032)
          at hudson.model.ResourceController.execute(ResourceController.java:97)
          at hudson.model.Executor.run(Executor.java:429)
          Finished: FAILURE
          {noformat}

          Editing one branch source on the configuration screen should not automatically clear or change any fields of other branch sources.
          Martin Henschke made changes -
          Assignee Original: Kristy Hughes [ khughes ]
          Naj made changes -
          Priority Original: Minor [ 4 ] New: Trivial [ 5 ]
          Naj made changes -
          Labels New: triaged

          I get the same behaviour when trying to add a second Bitbucket Server repository inside Multiple SCMs: the first repository name is cleared.

           

          Environment:

          Jenkins 2.303.1
          Bitbucket Server Integration plugin 2.1.3
          Git plugin 4.8.2
          Git client plugin 3.9.0
          Multiple SCMs plugin: 0.8
          SCM API plugin 2.6.5

          Jonathan Gowland added a comment - I get the same behaviour when trying to add a second Bitbucket Server repository inside Multiple SCMs: the first repository name is cleared.   Environment: Jenkins 2.303.1 Bitbucket Server Integration plugin 2.1.3 Git plugin 4.8.2 Git client plugin 3.9.0 Multiple SCMs plugin: 0.8 SCM API plugin 2.6.5

            Unassigned Unassigned
            kon Kalle Niemitalo
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: