Fail to install Jenkins slave agent as a service

678 views
Skip to first unread message

Victoria Wei Lei

unread,
Sep 21, 2017, 12:22:07 PM9/21/17
to Jenkins Users
I launched Jenkins Slave via web start,  but when I tried to Install as a service,  error pop up, please see attached screen shot, 

Can anyone help for this issue? 

Thanks
Victoria 
windowserviceerror.png

Ewelina Wilkosz

unread,
Sep 22, 2017, 12:20:47 PM9/22/17
to Jenkins Users
Not sure if it will solve your issue, but what I usually do is I download the file instead of running it from the browser - the one you have under web start button - then run 'cmd' as administrator, there I cd to directory with downloaded file and run it from there. If you're familiar with command line it should be easy :) if not I can try to provide more details. But in general running it as admin solved a similar (I think, I don't remember) problem I had

Victoria Wei Lei

unread,
Sep 22, 2017, 2:00:09 PM9/22/17
to Jenkins Users
Ewelina, 

thanks so much for the reply.  I tried command line before as admin,  yes, the slave can launch successfully,  but am I supposed to get Slave agent  pop up and the option to Install as a service?  I did not have pop up window as I start by web start.  Therefore, I can't install slave as a window service.  If cmd window got killed for some reason,  my slave agent died as well.  

Victoria 

Slide

unread,
Sep 22, 2017, 3:58:10 PM9/22/17
to Jenkins Users
How are you running from the command line? 

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/6790b416-5113-4a86-9ff1-6b4bb1fbe534%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Victoria Wei Lei

unread,
Sep 22, 2017, 4:14:13 PM9/22/17
to Jenkins Users
run command from your slave path:

$ java -jar slave.jar -jnlpUrl http://yourserver:port/computer/slave-name/slave-agent.jnlp (the full command should be listed on your launch screen)

make sure slave.jar was copied there. A copy of slave.jar can be downloaded from http://yourserver:port/jnlpJars/slave.jar 

Slide

unread,
Sep 22, 2017, 4:22:01 PM9/22/17
to Jenkins Users
The instructions on my Jenkins install also have a -secret parameter, does yours? Are you passing in the secret?

Victoria Wei Lei

unread,
Sep 22, 2017, 5:15:31 PM9/22/17
to Jenkins Users
yes, you need to attach that secret key in the command

Ewelina Wilkosz

unread,
Sep 29, 2017, 8:47:07 AM9/29/17
to Jenkins Users
Did you manage to make it work? 
because I do it differently, usually:

- download slave-agent.jnlp from agent page - I think it's under this 'launch via web' button, or something, I don't remember what it says :) 
- open a command window with "Run as Administrator".
- change directory to the place where you saved the slave-agent.jnlp file.
- run "slave-agent.jnlp"
- now with the running slave click the menu item to "Install as Service".
- run services.msc and you can find and configure your service

So it is a little bit simpler command in cmd, maybe not making any difference... but you have to try everything :)

Oleg Nenashev

unread,
Oct 1, 2017, 11:32:40 AM10/1/17
to Jenkins Users
Hi all,

Just FYI, Jenkins Windows Service command line is documented here: https://github.com/kohsuke/winsw .

WinSW is a standalone project, Jenkins just generates an XML configuration file for it. You can take the template from here and then configure the instance manually if the service installation fails.

P.S: The error in the first message is greek to me. Would be great to get info about the Java version you use in Windows

BR, Oleg


пятница, 29 сентября 2017 г., 15:47:07 UTC+3 пользователь Ewelina Wilkosz написал:

Victoria Wei Lei

unread,
Oct 4, 2017, 5:01:43 PM10/4/17
to Jenkins Users
Oleg, 

The java error message was gone after I change java version from 64 bit to 32 bit.  But installing service give me different error pop up. see attached. 
I am going to look at and try you suggested WinSW.  

Thanks
ws_error.png

Victoria Wei Lei

unread,
Oct 4, 2017, 5:04:19 PM10/4/17
to Jenkins Users
Ewelina,  

I did run slave-agent.jnlp from command line,  agent started running,  however I did not have running slave pop up which give me the option from file -> Install as a service (:

Thanks

itchymuzzle

unread,
Nov 3, 2017, 11:06:56 AM11/3/17
to Jenkins Users

- download slave-agent.jnlp from agent page - I think it's under this 'launch via web' button, or something, I don't remember what it says :) 
- open a command window with "Run as Administrator".
- change directory to the place where you saved the slave-agent.jnlp file.
- run "slave-agent.jnlp"
- now with the running slave click the menu item to "Install as Service".
- run services.msc and you can find and configure your service

This is just confusing.  You need to give us more detail if you want to be helpful.  Please be helpful.

> now with the running slave click the menu item to "Install as Service".
 
Where are you, when you are doing this?  Are you on the Jenkins web page?  If so, from which instance/host/node are you running the web page?  

Thanks.

itchymuzzle

unread,
Nov 3, 2017, 11:16:50 AM11/3/17
to Jenkins Users

now with the running slave click the menu item to "Install as Service".

Just discovered this page which helps me understand this step, I think.

It seems that you run a web browser on the Windows instance, where you have the slave/agent, and use the URL for the Jenkins master web page.    
Reply all
Reply to author
Forward
0 new messages