Jenkins fails to start due to Multi-Branch Project Plugin in Windows

Issue

  • Jenkins fails to start with the following stacktrace:
hudson.util.HudsonFailedToLoad: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
	at hudson.WebAppMain$3.run(WebAppMain.java:237)
Caused by: org.jvnet.hudson.reactor.ReactorException: java.lang.Error: java.lang.reflect.InvocationTargetException
	at org.jvnet.hudson.reactor.Reactor.execute(Reactor.java:269)
	at jenkins.InitReactorRunner.run(InitReactorRunner.java:44)
	at jenkins.model.Jenkins.executeReactor(Jenkins.java:916)
	at jenkins.model.Jenkins.<init>(Jenkins.java:815)
	at hudson.model.Hudson.<init>(Hudson.java:85)
	at hudson.model.Hudson.<init>(Hudson.java:81)
	at hudson.WebAppMain$3.run(WebAppMain.java:225)
Caused by: java.lang.Error: java.lang.reflect.InvocationTargetException
	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:110)
	at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:176)
	at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
	at jenkins.model.Jenkins$7.runTask(Jenkins.java:905)
	at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
	at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:106)
	... 8 more
Caused by: java.io.IOException: Tried to treat 'D:\Jenkins_Home\jobs\my-job\lastStable' as a directory, but could not get a listing
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.getConfigFiles(TemplateDrivenMultiBranchProject.java:717)
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.getConfigFiles(TemplateDrivenMultiBranchProject.java:732)
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.getConfigFiles(TemplateDrivenMultiBranchProject.java:732)
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.getConfigFiles(TemplateDrivenMultiBranchProject.java:732)
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.getConfigFiles(TemplateDrivenMultiBranchProject.java:732)
	at com.github.mjdetullio.jenkins.plugins.multibranch.TemplateDrivenMultiBranchProject.migrate(TemplateDrivenMultiBranchProject.java:758)
	... 13 more

Environment

Related Issues

Resolution

This is related to the latest version 0.5.1 of the Multi-Branch Project Plugin. It includes a migration process on start up. This process go recursively through the $JENKINS_HOME/jobs folder, looking for config.xml files. Unfortunately in Windows this process fails when it encounters symbolic links. It is captured by JENKINS-36896.

If you already have Multi-Branch projects or want to use Multi-Branch project, you must downgrade to the specific version 0.5. Otherwise the workaround is to uninstall the plugin.

Solution 1: Uninstall

  • Stop Jenkins
  • Disable the Multi Branch Project plugin manually by creating an empty file $JENKINS_HOME/plugins/multi-branch-project-plugin.jpi.disabled
  • Delete all the .symlink files entitled “lastStable” and “lastSuccessful” from the jobs folders
  • Restart Jenkins
  • Uninstall the Multi Branch Project Plugin

Solution 2: Downgrade

If you already have Multi-Branch projects or want to use Multi-Branch project, you must downgrade to the specific version 0.5:

  • Download the multi-branch-project-plugin.hpi of Multi-Branch Project plugin 0.5
  • Stop Jenkins
  • Remove the Multi Branch Project plugin manually by removing the files/directory matching the pattern multi-branch-project-plugin* under $JENKINS_HOME/plugins/
  • Copy the downloaded multi-branch-project-plugin.hpi under $JENKINS_HOME/plugins/
  • Delete all the .symlink files entitled “lastStable” and “lastSuccessful” from the jobs folders
  • Start Jenkins
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.