is JENKINS_HOME on a filer possible with windows?

982 views
Skip to first unread message

Sandra Madden

unread,
May 5, 2011, 2:41:57 PM5/5/11
to jenkins...@googlegroups.com

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

teilo

unread,
May 5, 2011, 3:24:07 PM5/5/11
to Jenkins Users
Hi Sandra,

This isn't a Jenkins issue but a windows issue.

Drive mappings are per user session in windows and as such services do
not have access to them (a user bob can have a differnt z: from a user
fred on the same machine at the same time - and if they can login
multiple times bob can have a different z drive in one session from
the other).

Ontop of this if Jenkins is running with the service account it won't
have access to the network.

You will need to enable jenkins to run as a user rather than system or
network_service and grant that user access rights to JENKINS_HOME and
the files under there).
You will need to specify the path as a UNC path (\\server\path) rather
than a drive map.

The alternative is to export data on the filer as iSCSI and use the MS
iSCSI initiator (as that works at the sytem level and not at the user/
session level - so Z: will be z: to everyone just as if it was local)

See http://support.microsoft.com/kb/180362 for a more detailed
discussion (although old is still relevant)

Regards,

/James


On May 5, 7:41 pm, "Sandra Madden" <smad...@broadcom.com> wrote:
> 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.

Sandra Madden

unread,
May 5, 2011, 4:40:30 PM5/5/11
to jenkins...@googlegroups.com
Hi James,

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)


teilo

unread,
May 5, 2011, 5:41:38 PM5/5/11
to Jenkins Users
What jdk are you using? There is the following bug that is marked as
fixed, http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5086147

Sandra Madden

unread,
May 5, 2011, 6:13:09 PM5/5/11
to jenkins...@googlegroups.com
I'm using jdk1.6.0_24. The report and fix are really old, maybe it snuck back in?!?!

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 :-(

Nord, James

unread,
May 6, 2011, 3:49:43 AM5/6/11
to jenkins...@googlegroups.com
Could be related to http://bugs.sun.com/bugdatabase/view_bug.do;jsessionid=c44001a1d2838a59b9fff047cb6d5?bug_id=6360233

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
**************************************************************************************

Sandra Madden

unread,
May 6, 2011, 1:45:15 PM5/6/11
to jenkins...@googlegroups.com
I moved everything into my home folder to simplify the path as much as possible. The result is the same. The only thing left using a dash is the server name. It's obscured in the link below, but I left the '-' in.

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

Nord, James

unread,
May 9, 2011, 4:41:32 AM5/9/11
to jenkins...@googlegroups.com
Is it at all possible to test without DFS in the loop (ie use wherever the \\abcd-ef\dfs\ redirects you to)?

It shouldn't be the cause, but then again...

Reply all
Reply to author
Forward
0 new messages