Hi,
We have our Jenkins instances that run on Linux installed on the filer. E.g. $JENKINS_HOME points to the filer, the build folders are local.
I was asked to do the same thing for the Windows Jenkins, but I don’t get it to work. The Windows Service won’t start up because it can’t find the Service binary when its not a local drive.
Any ideas to make this work? The reason we want to have the home folder on the network is that it is automatically backed up and easily accessible from different machines.
Here are 3 different test cases I tried to move a local Jenkins install onto a network share
Testcase 1), move the folder locally (to make sure that changing the image works when moving JENKINS_HOME)
- Stop the Jenkins service
- rename % JENKINS_HOME % folder
- Change the ImagePath in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\jenkins to point to the new folder
- Start the service à Everything works
Testcase 2), move JENKINS_HOME to a network share
- Stop the Jenkins service
- copy %JENKINS_HOME% folder to a mapped network drive
- Change the “ImagePath” in the registry under “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\jenkins” to the network location
- Start the service à start fails with “Could not start the Jenkins service on Local Computer. Error 3: the system cannot find the path specified”
Testcase 3), leave the Jenkins.war, xml and exe on a local folder, but change %JENKINS_HOME% to the network share (and copy everything there)
- Stop jenkins service
- Update JENKINS_HOME in Jenkins.xml to point to network share instead of %BASE%
- Copy the local % JENKINS_HOME% folder to the network share
- Start the service à service starts without error, but Jenkins webpage is not accessible.
Contents of Jenkins.out.log:
Running from: D:\Tools\jenkins\jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
[Winstone 2011/05/05 11:26:55] - Beginning extraction from war file
[Winstone 2011/05/05 11:26:55] - Error initializing web application: prefix []
java.io.FileNotFoundException: z:\projects\our_group_name\CI\win\war\META-INF\MANIFEST.MF (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at winstone.HostConfiguration.getWebRoot(HostConfiguration.java:270)
at winstone.HostConfiguration.<init>(HostConfiguration.java:73)
at winstone.HostGroup.initHost(HostGroup.java:85)
at winstone.HostGroup.<init>(HostGroup.java:45)
at winstone.Launcher.<init>(Launcher.java:196)
at winstone.Launcher.main(Launcher.java:391)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at Main._main(Main.java:214)
at Main.main(Main.java:61)
Using one-time self-signed certificate
[Winstone 2011/05/05 11:26:55] - AJP13 Listener started: port=8009
[Winstone 2011/05/05 11:26:55] - HTTP Listener started: port=8080
[Winstone 2011/05/05 11:26:55] - Winstone Servlet Engine v0.9.10 running: controlPort=disabled
Any ideas what else I could try?
Thanks,
Sandra
Thanks for the feedback. The service was already setup to log on with a user instead of service account.
Trying UNC paths was a good idea, but unfortunately it still doesn't work. We are a step closer though, the service starts, the war is unpacked and Jenkins tries to come up, but then displays an error in the browser.
This is the contents of the Jenkins.out.log
Running from: \\server\long_path\CI\test\jenkins.war
webroot: EnvVars.masterEnvVars.get("JENKINS_HOME")
[Winstone 2011/05/05 13:34:41] - Beginning extraction from war file
hudson home directory: \\server\long_path\CI\test found at: EnvVars.masterEnvVars.get("JENKINS_HOME")
Using one-time self-signed certificate
[Winstone 2011/05/05 13:34:43] - AJP13 Listener started: port=8009
[Winstone 2011/05/05 13:34:43] - HTTP Listener started: port=8080
[Winstone 2011/05/05 13:34:44] - Winstone Servlet Engine v0.9.10 running: controlPort=disabled
[Winstone 2011/05/05 13:35:21] - Untrapped Error in Servlet
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(Unknown Source)
at org.kohsuke.stapler.Stapler.toFile(Stapler.java:450)
at org.kohsuke.stapler.Stapler.openURL(Stapler.java:268)
at org.kohsuke.stapler.Stapler.selectResourceByLocale(Stapler.java:217)
at org.kohsuke.stapler.Stapler.openResourcePathByLocale(Stapler.java:202)
at org.kohsuke.stapler.Stapler.service(Stapler.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.lang.Thread.run(Unknown Source)
[Winstone 2011/05/05 13:35:23] - Untrapped Error in Servlet
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(Unknown Source)
at org.kohsuke.stapler.Stapler.toFile(Stapler.java:450)
at org.kohsuke.stapler.Stapler.openURL(Stapler.java:268)
at org.kohsuke.stapler.Stapler.selectResourceByLocale(Stapler.java:217)
at org.kohsuke.stapler.Stapler.openResourcePathByLocale(Stapler.java:202)
at org.kohsuke.stapler.Stapler.service(Stapler.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.lang.Thread.run(Unknown Source)
[Winstone 2011/05/05 13:35:24] - Untrapped Error in Servlet
java.lang.IllegalArgumentException: URI has an authority component
at java.io.File.<init>(Unknown Source)
at org.kohsuke.stapler.Stapler.toFile(Stapler.java:450)
at org.kohsuke.stapler.Stapler.openURL(Stapler.java:268)
at org.kohsuke.stapler.Stapler.selectResourceByLocale(Stapler.java:217)
at org.kohsuke.stapler.Stapler.openResourcePathByLocale(Stapler.java:202)
at org.kohsuke.stapler.Stapler.service(Stapler.java:144)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:45)
at winstone.ServletConfiguration.execute(ServletConfiguration.java:249)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:335)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:378)
at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:94)
at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:86)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:47)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
at winstone.FilterConfiguration.execute(FilterConfiguration.java:195)
at winstone.RequestDispatcher.doFilter(RequestDispatcher.java:368)
at winstone.RequestDispatcher.forward(RequestDispatcher.java:333)
at winstone.RequestHandlerThread.processRequest(RequestHandlerThread.java:244)
at winstone.RequestHandlerThread.run(RequestHandlerThread.java:150)
at java.lang.Thread.run(Unknown Source)
I also tried specifying the file differently like in the description. E.g. forward slashes instead of backslash, starting with 4 slashes instead of 2 etc. Nothing worked :-(
The triggering code is https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/Stapler.java
private File toFile(URL url).
So if you can supply a URL which is the same as what you are using for the HUDSON_HOME (feel free to obscure servernames but if it has any non alpha-numeric characters keep them in
e.g. "\\myinternalserver\my_share$\some\funky path with spaces\and_apercent_sign%\blah"
it would be okay to say "\\server1\share_name$\path\there is a space\something else%\foo"
Then it should be easy enough to write a unit test.
If you can raise a bug against Jenkins (for the manifestation)
/James
**************************************************************************************
This message is confidential and intended only for the addressee. If you have received this message in error, please immediately notify the postm...@nds.com and delete it from your system as well as any copies. The content of e-mails as well as traffic data may be monitored by NDS for employment and security purposes. To protect the environment please do not print this e-mail unless necessary.
NDS Limited. Registered Office: One London Road, Staines, Middlesex, TW18 4EX, United Kingdom. A company registered in England and Wales. Registered no. 3080780. VAT no. GB 603 8808 40-00
**************************************************************************************
The URL is \\abcd-ef\dfs\home\smadden\test\jenkins.exe
I also filed a bug for it: 'JENKINS-9615: JENKINS_HOME can't be on filer when using windows service'
Thanks for looking into this guys!
-Sandra
It shouldn't be the cause, but then again...