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

Scanning MultiBranchProject fails with IllegalStateException

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

      Steps to duplicate the problem:

      1. Clone, build, and run the docker instance
          $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
          $ cd JENKINS-41867
          $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
          $ docker build -t jenkins:JENKINS-41867 .
          $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
        
      2. Connect a web browser to that docker instance (http://localhost:8080)
      3. Open the "Git Client Plugin Folder"
      4. Open the "Git Client Branches - Maven" multi-branch job
      5. Click the "Scan Project" link and then the "Run Now" link to start branch indexing
      6. Click the "Log" link to view the log - stack trace will appear in that log

      The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

      Stack trace is:

      Started by user Mark Waite
      [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
      Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
       > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
      Setting origin to https://github.com/MarkEWaite/git-plugin.git
       > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
      Fetching & pruning origin...
      Fetching upstream changes from origin
       > git --version # timeout=11
      using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
       > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
      Getting remote branches...
      Seen branch in repository origin/2.6.x
      Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
      Seen branch in repository origin/master
      Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
      Seen branch in repository origin/master-PR463-add-git-lfs
      Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
      Seen branch in repository origin/master-findbugs-combined
      Seen branch in repository origin/master-findbugs-fixes
      Seen branch in repository origin/ongoing/latest-jenkins-lts
      Seen branch in repository origin/ongoing/lts
      Seen 10 remote branches
      Checking branch master-PR463-add-git-lfs
      Scheduled build for branch: master-PR463-add-git-lfs
      Checking branch ongoing/lts
      Checking branch master
      Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
      ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
      java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
      	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
      	at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
      	at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
      FATAL: Failed to recompute children of Git Plugin Folder ยป Git Branches - Maven
      java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
      	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
      	at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
      	at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
      	at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
      	at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
      	at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
      	at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
      	at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
      	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
      	at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
      	at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:404)
      Finished: FAILURE
      

      Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

      Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

      Third addendum - refer to multi-branch-project-plugin.hpi for a plugin compiled with the proposed pull request that resolves the issue.

        Attachments

          Issue Links

            Activity

            markewaite Mark Waite created issue -
            markewaite Mark Waite made changes -
            Field Original Value New Value
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-xxxxx
              $ cd JENKINS-xxxxx
              $ git checkout -b lts-with-plugins -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-xxxxx .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-xxxxx
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link, and the "Run" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link, and the "Run" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            markewaite Mark Waite made changes -
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link, and the "Run" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            markewaite Mark Waite made changes -
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            markewaite Mark Waite made changes -
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}

            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. I'll need to bisect to identify the root cause.
            markewaite Mark Waite made changes -
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}

            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. I'll need to bisect to identify the root cause.
            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            markewaite Mark Waite made changes -
            Summary Scanning MultiBranchProject with scm-api 2.0.3 fails: IllegalStateException Scanning MultiBranchProject fails with IllegalStateException
            markewaite Mark Waite made changes -
            Component/s core [ 15593 ]
            markewaite Mark Waite made changes -
            Component/s git-plugin [ 15543 ]
            Component/s core [ 15593 ]
            Component/s scm-api-plugin [ 18054 ]
            markewaite Mark Waite made changes -
            Link This issue is blocked by JENKINS-41948 [ JENKINS-41948 ]
            markewaite Mark Waite made changes -
            Component/s core [ 15593 ]
            Component/s git-plugin [ 15543 ]
            markewaite Mark Waite made changes -
            Description Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            markewaite Mark Waite made changes -
            stephenconnolly Stephen Connolly made changes -
            Attachment multi-branch-project-plugin.hpi [ 35945 ]
            stephenconnolly Stephen Connolly made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            stephenconnolly Stephen Connolly made changes -
            Status In Progress [ 3 ] In Review [ 10005 ]
            stephenconnolly Stephen Connolly made changes -
            Remote Link This issue links to "PR#145 (Web Link)" [ 15441 ]
            stephenconnolly Stephen Connolly made changes -
            Component/s multi-branch-project-plugin [ 21127 ]
            Component/s core [ 15593 ]
            stephenconnolly Stephen Connolly made changes -
            Assignee Matthew DeTullio [ mjdetullio ]
            tusilein Lukas Gorniak made changes -
            tusilein Lukas Gorniak made changes -
            Comment [ I'm using the https://github.com/jenkinsci/multi-branch-project-plugin/pull/145/commits/ed8ed0395dcaac9a76a17547a5f770a9f219ec96 patch.

            Now the PROJECTNAME has been replaced by branchname + unique id

            before: [PROJECTNAME]
            after: [s-understanding-ms-longpage-5H3LLON6SLTSHSVS7WO3SYQNGMJGVGTNF4ZNV7MBAP3VQIUBHMTA]




            ]
            markewaite Mark Waite made changes -
            Description Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}
            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}

            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

            markewaite Mark Waite made changes -
            Description Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}

            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

            Initial scan of branches in a multi-branch-project fails with an IllegalStateException.

            Steps to duplicate the problem:
            # Clone, build, and run the docker instance
            {code}
              $ git clone https://github.com/MarkEWaite/docker JENKINS-41867
              $ cd JENKINS-41867
              $ git checkout -b lts-with-plugins dac2eebcf7afc90caf9180a9f6a6de6d98ae26b6 # -t origin/lts-with-plugins
              $ docker build -t jenkins:JENKINS-41867 .
              $ docker run -i --rm --publish 8080:8080 jenkins:JENKINS-41867
            {code}
            # Connect a web browser to that docker instance (http://localhost:8080)
            # Open the "Git Client Plugin Folder"
            # Open the "Git Client Branches - Maven" multi-branch job
            # Click the "Scan Project" link and then the "Run Now" link to start branch indexing
            # Click the "Log" link to view the log - stack trace will appear in that log

            The problem seems to be new with scm-api 2.0.3. Prior versions of scm-api did not show the same behavior.

            Stack trace is:

            {noformat}
            Started by user Mark Waite
            [Wed Feb 08 16:59:22 MST 2017] Starting branch indexing...
            Creating git repository in /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c
             > git init /var/jenkins_home/caches/git-65641b79111589c081c788caa640559c # timeout=11
            Setting origin to https://github.com/MarkEWaite/git-plugin.git
             > git config remote.origin.url https://github.com/MarkEWaite/git-plugin.git # timeout=11
            Fetching & pruning origin...
            Fetching upstream changes from origin
             > git --version # timeout=11
            using GIT_ASKPASS to set credentials intentionally invalid user and password for credentials NPE in multi-branch jobs
             > git fetch --tags --progress origin +refs/heads/*:refs/remotes/origin/* --prune
            Getting remote branches...
            Seen branch in repository origin/2.6.x
            Seen branch in repository origin/3.0.0-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master
            Seen branch in repository origin/master-PR439-add-ATH-subset-to-Jenkinsfile
            Seen branch in repository origin/master-PR463-add-git-lfs
            Seen branch in repository origin/master-PRxxx-move-findbugs-suppressions-into-code
            Seen branch in repository origin/master-findbugs-combined
            Seen branch in repository origin/master-findbugs-fixes
            Seen branch in repository origin/ongoing/latest-jenkins-lts
            Seen branch in repository origin/ongoing/lts
            Seen 10 remote branches
            Checking branch master-PR463-add-git-lfs
            Scheduled build for branch: master-PR463-add-git-lfs
            Checking branch ongoing/lts
            Checking branch master
            Checking branch master-PR439-add-ATH-subset-to-Jenkinsfile
            ERROR: [Wed Feb 08 16:59:24 MST 2017] Could not fetch branches from source d7205f38-9ade-472c-923c-6a839d7ec90d
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            [Wed Feb 08 16:59:24 MST 2017] Finished branch indexing. Indexing took 2.3 sec
            FATAL: Failed to recompute children of Git Plugin Folder » Git Branches - Maven
            java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@689690d2[Git-Folder/git-plugin-freestyle-multi-branch/master-PR4.l4tko8c5k0.enkinsfile] with name master-PR4.l4tko8c5k0.enkinsfile among [master-PR439-add-ATH-subset-to-Jenkinsfile, master-PR463-add-git-lfs]
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
            at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:1957)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:315)
            at jenkins.plugins.git.AbstractGitSCMSource$2.run(AbstractGitSCMSource.java:239)
            at jenkins.plugins.git.AbstractGitSCMSource.doRetrieve(AbstractGitSCMSource.java:209)
            at jenkins.plugins.git.AbstractGitSCMSource.retrieve(AbstractGitSCMSource.java:239)
            at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:300)
            at jenkins.scm.api.SCMSource.fetch(SCMSource.java:210)
            at jenkins.branch.MultiBranchProject.computeChildren(MultiBranchProject.java:625)
            at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder.updateChildren(ComputedFolder.java:219)
            at com.cloudbees.hudson.plugins.folder.computed.FolderComputation.run(FolderComputation.java:141)
            at jenkins.branch.MultiBranchProject$BranchIndexing.run(MultiBranchProject.java:969)
            at hudson.model.ResourceController.execute(ResourceController.java:98)
            at hudson.model.Executor.run(Executor.java:404)
            Finished: FAILURE
            {noformat}

            Addendum - it appears I'm wrong about the root cause. I reverted scm-api 2.0.3, switching back to scm-api 2.0.2 and see the same behavior. Sorry for the false alarm on scm-api 2.0.3. My initial attempts to bisect the problem have failed. Please ignore this bug report until I investigate further.

            Second addendum - this bug is not visible with the updates applied as of 10 Feb 2017, it is now obscured by the more severe bug JENKINS-41948

            Third addendum - refer to [^multi-branch-project-plugin.hpi] for a plugin compiled with the proposed pull request that resolves the issue.
            tusilein Lukas Gorniak made changes -
            Comment [ Applied the attachment.

            At workspace creation got following:

            before:
            Building in workspace /var/lib/jenkins/workspace/<ProjectName>/<branchname>

            after:
            Building in workspace /var/lib/jenkins/workspace/<branchname>-4TOVGLFN5C3CTYYWFGKYLHKOU7QZGTMTJYJZQFYWXZ7XBF3GTW6A




            ]
            mjdetullio Matthew DeTullio made changes -
            Resolution Fixed [ 1 ]
            Status In Review [ 10005 ] Resolved [ 5 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              mjdetullio Matthew DeTullio
              Reporter:
              markewaite Mark Waite
              Votes:
              9 Vote for this issue
              Watchers:
              14 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: