[JIRA] (JENKINS-41867) Scanning MultiBranchProject fails with IllegalStateException

12 views
Skip to first unread message

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 8, 2017, 9:37:01 PM2/8/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Jenkins / Bug JENKINS-41867
Scanning MultiBranchProject fails with IllegalStateException
Change By: Mark Waite
Summary: Scanning MultiBranchProject with scm-api 2.0.3 fails : with IllegalStateException
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.1.7#71011-sha1:2526d7c)
Atlassian logo

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 8, 2017, 9:37:01 PM2/8/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Component/s: git-plugin
Component/s: core
Component/s: scm-api-plugin

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 8, 2017, 9:37:01 PM2/8/17
to jenkinsc...@googlegroups.com

jobh@simula.no (JIRA)

unread,
Feb 9, 2017, 11:04:01 AM2/9/17
to jenkinsc...@googlegroups.com
Joachim Haga commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

I see the same issue with incremental scans, after a recent update of many plugins (including scm-api and MultiBranchProject).

Many of the branch names are overwritten with random alphanumerical characters after the first 11 characters of the name, i.e.,
WMAT2-122-m-.jl4t5j.--cache-part
instead of
WMAT2-122-make-it-possible-to-cache-part
This looks similar to what happens in your case ("master-PR4.l4tko8c5k0.enkinsfile"). The random string is usually on the format ".XXXXXX.". Maybe somebody recognizes where this string comes from?

pavel@batanov.me (JIRA)

unread,
Feb 11, 2017, 1:36:02 PM2/11/17
to jenkinsc...@googlegroups.com

Faced the same issue

java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.model.FreeStyleProject@7448a801[bestapps_mapi_stage_deploy/hotfix-api-doc.pprn0n] with name hotfix-api-doc.pprn0n among [production, hotfix%2Fapi-doc, master]

Tries to append .XXXXXX (pprn0n) part to the branch name

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 11, 2017, 1:54:02 PM2/11/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Component/s: core
Component/s: git-plugin

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 11, 2017, 1:54:02 PM2/11/17
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

I no longer see this issue with the latest plugin updates. I now see JENKINS-41948 which seems to interrupt branch scanning before this condition is reached.

pavel@batanov.me (JIRA)

unread,
Feb 11, 2017, 2:48:02 PM2/11/17
to jenkinsc...@googlegroups.com

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 11, 2017, 4:10:02 PM2/11/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
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}

alastair@d-silva.org (JIRA)

unread,
Feb 13, 2017, 7:17:01 PM2/13/17
to jenkinsc...@googlegroups.com
Alastair D'Silva commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

I'm also blocked on this, and have a bunch of angry devs who want their jobs back. Do we have a workaround (such as rolling back a plugin)?

alastair@d-silva.org (JIRA)

unread,
Feb 13, 2017, 7:24:01 PM2/13/17
to jenkinsc...@googlegroups.com
Alastair D'Silva edited a comment on Bug JENKINS-41867
I'm also blocked on this, and have a bunch of angry devs who want their jobs back. Do we have a workaround (such as rolling back a plugin)?


(Note: I did not have this problem running SCM API 2.0.3-SNAPSHOT, built from master, so it's probably not an issue with that plugin)

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 7:25:01 PM2/13/17
to jenkinsc...@googlegroups.com

Alastair D'Silva, the JENKINS-41948 report suggests that reverting the branch API plugin is enough to resolve the issue. I haven't tested the details to see the "fall-back" version, but one user reports that reverting the branch API plugin was enough.

alastair@d-silva.org (JIRA)

unread,
Feb 13, 2017, 7:27:01 PM2/13/17
to jenkinsc...@googlegroups.com

alastair@d-silva.org (JIRA)

unread,
Feb 13, 2017, 7:31:02 PM2/13/17
to jenkinsc...@googlegroups.com
Alastair D'Silva edited a comment on Bug JENKINS-41867
ping [~stephenconnolly] (just in case it's Cloudbees Folders related)

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 7:31:02 PM2/13/17
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-41867
[~evildeece], the JENKINS-41948 report suggests that reverting the branch API plugin is enough to resolve the issue.  I haven't tested the details to see the "fall-back" version, but one user reports that reverting the branch API plugin was enough.

However, since that comment was from you, that may hint that the rollback of branch API is not enough.

I know I had a working configuration in my [docker instance|https://github.com/MarkEWaite/docker] on the [lts-with-plugins branch|https://github.com/MarkEWaite/docker/tree/lts-with-plugins] for a very long time, so it should be possible to bisect the updates that I made and find the "last place that worked".  Unfortunately, I don't have time to do that bisect.

alastair@d-silva.org (JIRA)

unread,
Feb 13, 2017, 9:51:03 PM2/13/17
to jenkinsc...@googlegroups.com

I tried rolling back Cloudbees Folders to 5.16, but too much depended on the newer version to give me a usable environment.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 11:10:02 PM2/13/17
to jenkinsc...@googlegroups.com

I was able to write a little bisect script that helped me locate a configuration that works for me.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 11:11:01 PM2/13/17
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-41867
I was able to write a little bisect script that helped me locate a configuration that works for me.

See  [^JENKINS-multi-branch-known-good.pdf]

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 11:11:01 PM2/13/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Change By: Mark Waite
Attachment: JENKINS-multi-branch-known-good.pdf

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 11:13:01 PM2/13/17
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-41867
I was able to write a little bisect script that helped me locate a configuration that works for me.

See  [^JENKINS-multi-branch-known-good.pdf] , but you can use the latest released git client plugin and the latest released git plugin.  I've been testing a pre-release but you can ignore my testing.

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 13, 2017, 11:20:03 PM2/13/17
to jenkinsc...@googlegroups.com
Mark Waite edited a comment on Bug JENKINS-41867
I was able to write a little bisect script that helped me locate a configuration that works for me.

See  [^JENKINS-multi-branch-known-good.pdf], but you can use the latest released git client plugin and the latest released git plugin.  I've been testing a pre-release but you can ignore my testing the versions of those two plugins .

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:32:02 AM2/14/17
to jenkinsc...@googlegroups.com

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:38:03 AM2/14/17
to jenkinsc...@googlegroups.com
Stephen Connolly updated an issue
 
Change By: Stephen Connolly
Attachment: multi-branch-project-plugin.hpi

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:40:02 AM2/14/17
to jenkinsc...@googlegroups.com
 
Re: Scanning MultiBranchProject fails with IllegalStateException

Attached is a -SNAPSHOT build of the plugin with the fix integrated

$ shasum multi-branch-project-plugin.hpi
ca1d3ae04a09293eb85ba34305a91be6af008dd5  multi-branch-project-plugin.hpi

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:43:02 AM2/14/17
to jenkinsc...@googlegroups.com

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:43:03 AM2/14/17
to jenkinsc...@googlegroups.com
Stephen Connolly started work on Bug JENKINS-41867
 
Change By: Stephen Connolly
Status: Open In Progress

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:44:02 AM2/14/17
to jenkinsc...@googlegroups.com

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 14, 2017, 5:44:02 AM2/14/17
to jenkinsc...@googlegroups.com
Stephen Connolly updated an issue
Change By: Stephen Connolly
Component/s: multi-branch-project-plugin
Component/s: core

alastair@d-silva.org (JIRA)

unread,
Feb 14, 2017, 6:23:01 PM2/14/17
to jenkinsc...@googlegroups.com
Alastair D'Silva commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

Thanks for the quick response Stephen Connolly, that patch fixes the problem for me.

Note that it also depends on Branch API 2.0.5, so anyone who wants to pick up the test build will also need to build Branch API from git.

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 15, 2017, 4:20:06 AM2/15/17
to jenkinsc...@googlegroups.com

Alastair D'Silva please stop recommending people to build from git tags. When people build from a tag they will get an artifact that masquerades as the release version but with a different SHA1. Diagnosing issues with an installation becomes a lot harder when you do not know which are the official releases and which are rebuilds. This can be even more problematic in cases where the plugin maintainer decides to delete the tag and recreate because the release did not deploy. When a plugin maintainer hits that kind of problem they will typically start using mvn release:prepare release:perform -DpushChanges=false while they iterate... if they then forget to delete the first tag and manually push the actual release tag then you can end up in a state where the tag you have built is not the tag of the release code (I do not recommend that pattern for plugin developers, but I have seen it done)

When there is a release version as a dependency, the release must have been cut and will therefore be available from the maven repository, e.g. http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/branch-api/ has the releases for branch-api

In any case, all the updates that this depends on have now been published by the jenkins update center.

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 15, 2017, 4:22:02 AM2/15/17
to jenkinsc...@googlegroups.com

Matthew DeTullio now that the PR has been merged, when do you anticipate cutting a release (FTR the @Ignored tests are not blocking a release, rather they are there for you to enable if you ever think you have a fix for the build and delete behaviour contracts)

alastair@d-silva.org (JIRA)

unread,
Feb 15, 2017, 5:05:03 AM2/15/17
to jenkinsc...@googlegroups.com
Alastair D'Silva edited a comment on Bug JENKINS-41867
Thanks for the quick response [~stephenconnolly], that patch fixes the problem for me.

Note that it also depends on Branch API 2.0.5, so anyone who wants to pick up the test build will also need to build Branch API from git.

vkralik@gmail.com (JIRA)

unread,
Feb 15, 2017, 4:42:03 PM2/15/17
to jenkinsc...@googlegroups.com

I'm going to wait for version 2.0.5

My environment :

scm-api-2.0.4 / Mercurial
Found branch stx-3.0a
No changes detected: stx-3.0a (still at stx-3.0a:4b137defbbb41e4fee70695f8346436895524ad6)
Found branch stx-3.0
ERROR: [Wed Feb 15 21:36:01 UTC 2017] Could not fetch branches from source 4ddeb04b-c82c-4386-b5e4-5c483efb6eaf
java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.maven.MavenModuleSet@5a7d4c2[drg.drg-sk-rules/stx-3-0.l0q718] with name stx-3-0.l0q718 among [stx-3.0, stx-3.0a]
	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2003)
	at hudson.plugins.mercurial.MercurialSCMSource.retrieve(MercurialSCMSource.java:183)
	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:634)
	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:973)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:404)
[Wed Feb 15 21:36:01 UTC 2017] Finished branch indexing. Indexing took 0.68 sec
FATAL: Failed to recompute children of drg.drg-sk-rules
java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.maven.MavenModuleSet@5a7d4c2[drg.drg-sk-rules/stx-3-0.l0q718] with name stx-3-0.l0q718 among [stx-3.0, stx-3.0a]
	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2003)
	at hudson.plugins.mercurial.MercurialSCMSource.retrieve(MercurialSCMSource.java:183)
	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:634)
	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:973)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE

stephen.alan.connolly@gmail.com (JIRA)

unread,
Feb 15, 2017, 5:12:02 PM2/15/17
to jenkinsc...@googlegroups.com

Vladimir Kralik you need to upgrade multi-branch-project-plugin.hpi to get the fix

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 16, 2017, 8:40:01 AM2/16/17
to jenkinsc...@googlegroups.com

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 16, 2017, 8:53:01 AM2/16/17
to jenkinsc...@googlegroups.com

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 17, 2017, 7:28:03 AM2/17/17
to jenkinsc...@googlegroups.com
 
Re: Scanning MultiBranchProject fails with IllegalStateException

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]

moroine.bentefrit@adactive.com (JIRA)

unread,
Feb 17, 2017, 7:53:01 AM2/17/17
to jenkinsc...@googlegroups.com

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 17, 2017, 10:03:02 AM2/17/17
to jenkinsc...@googlegroups.com
Lukas Gorniak updated an issue
Change By: Lukas Gorniak
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]




mark.earl.waite@gmail.com (JIRA)

unread,
Feb 17, 2017, 10:20:05 AM2/17/17
to jenkinsc...@googlegroups.com
Mark Waite commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

Moroine Bentefrit there may be some relationship with JENKINS-42107, but that relationship was not apparent to me when I read that bug report. Have you tried the snapshot build that Stephen Connolly included earlier in the bug report?

moroine.bentefrit@adactive.com (JIRA)

unread,
Feb 17, 2017, 10:48:02 AM2/17/17
to jenkinsc...@googlegroups.com

It works like a charm ! Thanks ! (I didn't saw that attachment :/ )

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 18, 2017, 11:27:05 AM2/18/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
 
Change By: Mark Waite
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

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 18, 2017, 11:28:04 AM2/18/17
to jenkinsc...@googlegroups.com
Mark Waite updated an issue
Third addendum - refer to  [^multi-branch-project-plugin.hpi] for a plugin compiled with the proposed pull request that resolves the issue.

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 20, 2017, 2:46:02 AM2/20/17
to jenkinsc...@googlegroups.com
Lukas Gorniak commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

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

vkralik@gmail.com (JIRA)

unread,
Feb 21, 2017, 1:55:02 AM2/21/17
to jenkinsc...@googlegroups.com


Vladimir Kralik you need to upgrade multi-branch-project-plugin.hpi to get the fix

I've installed the latest version of multi-branch-project-plugin.hpi ( 0.5.1 ) and the problem still persists.

[418D226A0DD6E28D66A2D5E7B1577BFE9FA54AB7-drg-sk-rules-svc-health_hudson-hg] $ hg --config hostfingerprints.hg=18:CF:17:C1:0B:1F:03:A0:C2:06:BE:B2:E3:9E:DA:A1:31:A0:D4:06 --config hostfingerprints.hg.assecosk.local=18:CF:17:C1:0B:1F:03:A0:C2:06:BE:B2:E3:9E:DA:A1:31:A0:D4:06 --config auth.jenkins.prefix=* --config ******** --config ******** --config "auth.jenkins.schemes=http https" heads --template "{node} {branch}\n"

Found branch stx-3.0a
ERROR: [Tue Feb 21 06:52:13 UTC 2017] Could not fetch branches from source f91e81df-0b14-4805-96ab-430dca6b0ab5
java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.maven.MavenModuleSet@51fd39f9[drg.drg-sk-rules/stx-3-0a.0r0cva] with name stx-3-0a.0r0cva among [stx-3.0a]
	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2003)
	at hudson.plugins.mercurial.MercurialSCMSource.retrieve(MercurialSCMSource.java:183)
	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:634)
	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:973)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:404)
[Tue Feb 21 06:52:13 UTC 2017] Finished branch indexing. Indexing took 0.82 sec
FATAL: Failed to recompute children of drg.drg-sk-rules
java.lang.IllegalStateException: Did not call mayCreate, or used the wrong Item.name for hudson.maven.MavenModuleSet@51fd39f9[drg.drg-sk-rules/stx-3-0a.0r0cva] with name stx-3-0a.0r0cva among [stx-3.0a]
	at com.cloudbees.hudson.plugins.folder.computed.ComputedFolder$FullReindexChildObserver.created(ComputedFolder.java:667)
	at jenkins.branch.MultiBranchProject$SCMHeadObserverImpl.observe(MultiBranchProject.java:2003)
	at hudson.plugins.mercurial.MercurialSCMSource.retrieve(MercurialSCMSource.java:183)
	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:634)
	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:973)
	at hudson.model.ResourceController.execute(ResourceController.java:98)
	at hudson.model.Executor.run(Executor.java:404)
Finished: FAILURE

alastair@d-silva.org (JIRA)

unread,
Feb 21, 2017, 2:07:05 AM2/21/17
to jenkinsc...@googlegroups.com

Vladimir Kralik the attached plugin fixed it for me. Did you restart after applying it? If so, could you please post an inventory of your installed plugins? That will make it a bit easier to figure out what the problem is.

mbtcollins@hotmail.co.uk (JIRA)

unread,
Feb 21, 2017, 9:36:01 AM2/21/17
to jenkinsc...@googlegroups.com

Hello, I have found that if I leave the branch-api plugin at my current version (1.11.1), the issue does not occur in our normal system.
I have also tested the above HPI file with the latest plugins in a sandbox Jenkins installation and this also fixed the issue.

lukas.gorniak@virtual-identity.com (JIRA)

unread,
Feb 21, 2017, 9:38:03 AM2/21/17
to jenkinsc...@googlegroups.com
Lukas Gorniak updated an issue
 
Change By: Lukas Gorniak
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




kpop@vandewiele.com (JIRA)

unread,
Feb 22, 2017, 2:50:02 AM2/22/17
to jenkinsc...@googlegroups.com
kpop commented on Bug JENKINS-41867
 
Re: Scanning MultiBranchProject fails with IllegalStateException

The attached plugin also fixes the issue for me. Thank you!

mjdetullio@gmail.com (JIRA)

unread,
Feb 23, 2017, 12:16:05 AM2/23/17
to jenkinsc...@googlegroups.com
Matthew DeTullio updated Bug JENKINS-41867
 

Fixed in version 0.6

Change By: Matthew DeTullio
Status: In Review Resolved
Resolution: Fixed

mark.earl.waite@gmail.com (JIRA)

unread,
Feb 28, 2017, 7:48:05 PM2/28/17
to jenkinsc...@googlegroups.com
Mark Waite closed an issue as Fixed
Change By: Mark Waite
Status: Resolved Closed
Reply all
Reply to author
Forward
0 new messages