Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run jenkins slave on windows 2012 r2 x64?

We want to use jenkins to build some specific software on Windows 2012 R2 x64. But when I trying to run it, master node fails whis this error:

Connecting to 192.168.1.27
Checking if Java exists
C:\Program Files\Java\jdk1.6.0_30\bin\java.exe -version returned 1.6.0.
Installing the Jenkins slave service
ERROR: Message not found for errorCode: 0xC00000AC
org.jinterop.dcom.common.JIException: Message not found for errorCode: 0xC00000AC
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:102)
    at hudson.util.jna.DotNet.isInstalled(DotNet.java:77)
    at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:292)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:222)
    at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:701)
Caused by: jcifs.smb.SmbException: All pipe instances are busy.
    at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563)
    at jcifs.smb.SmbTransport.send(SmbTransport.java:664)
    at jcifs.smb.SmbSession.send(SmbSession.java:238)
    at jcifs.smb.SmbTree.send(SmbTree.java:119)
    at jcifs.smb.SmbFile.send(SmbFile.java:775)
    at jcifs.smb.SmbFile.open0(SmbFile.java:989)
    at jcifs.smb.SmbFile.open(SmbFile.java:1006)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
    at jcifs.smb.TransactNamedPipeOutputStream.<init>(TransactNamedPipeOutputStream.java:32)
    at jcifs.smb.SmbNamedPipe.getNamedPipeOutputStream(SmbNamedPipe.java:187)
    at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:91)
    at rpc.Stub.attach(Stub.java:104)
    at rpc.Stub.call(Stub.java:109)
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:100)

and I don't know what is wrong.

Yes, I've read this carefully.

upd. ok. I removed server from domain. Now jenkins says:

Connecting to 192.168.1.27
    Checking if Java exists
    C:\Program Files\Java\jdk1.6.0_30\bin\java.exe -version returned 1.6.0.
    Installing the Jenkins slave service
    Copying jenkins-slave.exe
    Copying slave.jar
    Copying jenkins-slave.xml
    Registering the service
    Starting the service
    Waiting for the service to become ready
    ERROR: The service did not respond. Perhaps it failed to launch? 

In EventViewer I see:

Service cannot be started. System.ComponentModel.Win32Exception: The system cannot find the file specified
       at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
       at winsw.WrapperService.StartProcess(Process process, String arguments, String executable)
       at winsw.WrapperService.OnStart(String[] _)
       at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)
like image 500
Psychozoic Avatar asked May 20 '14 08:05

Psychozoic


People also ask

How do I start Jenkins slave automatically?

Try Jenkins Plugin called as Slave SetupPlugin. This plugin prepares slaves for build execution by letting you copy files and execute scripts before the slave gets used. It also allows you to start and stop slaves on demand from the master node.

How do you check if Jenkins slave is running?

Visit a url like http:``//myslave:3141 to see whether a slave is running and how much memory it is using. Configure the port used by clicking Manage Jenkins on the dashboard.

Do we need to install Jenkins on slave?

Since each slave runs a separate program called a "slave agent" there is no need to install the full Jenkins (package or compiled binaries) on a slave.


2 Answers

I had the same issue on on Windows 2012 R2 x64:

    Installing the Jenkins slave service
ERROR: Message not found for errorCode: 0xC00000AC
org.jinterop.dcom.common.JIException: Message not found for errorCode: 0xC00000AC
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:102)
    at hudson.util.jna.DotNet.isInstalled(DotNet.java:77)
    at hudson.os.windows.ManagedWindowsServiceLauncher.launch(ManagedWindowsServiceLauncher.java:292)
    at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:228)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
Caused by: jcifs.smb.SmbException: All pipe instances are busy.
    at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:563)
    at jcifs.smb.SmbTransport.send(SmbTransport.java:664)
    at jcifs.smb.SmbSession.send(SmbSession.java:238)
    at jcifs.smb.SmbTree.send(SmbTree.java:119)
    at jcifs.smb.SmbFile.send(SmbFile.java:775)
    at jcifs.smb.SmbFile.open0(SmbFile.java:989)
    at jcifs.smb.SmbFile.open(SmbFile.java:1006)
    at jcifs.smb.SmbFileOutputStream.<init>(SmbFileOutputStream.java:142)
    at jcifs.smb.TransactNamedPipeOutputStream.<init>(TransactNamedPipeOutputStream.java:32)
    at jcifs.smb.SmbNamedPipe.getNamedPipeOutputStream(SmbNamedPipe.java:187)
    at rpc.ncacn_np.RpcTransport.attach(RpcTransport.java:91)
    at rpc.Stub.attach(Stub.java:104)
    at rpc.Stub.call(Stub.java:109)
    at org.jinterop.winreg.smb.JIWinRegStub.winreg_OpenHKLM(JIWinRegStub.java:100)
    ... 7 more

and have found out, that jenkins slave to be run as a service requires to have .net 3.x installed (which is not by default on win2012 servers).

After having the 3.5 .net framework installed jenkins slave service got installed without issues (and the server remained in domain).

To not loose time in case you'd hit problems while installing 3.5 framework as I did, refer to this SO answer: Offline installer for .Net 3.5 SP1 not working (disabling the WSUS helped me to get the installation through)

like image 194
peepa Avatar answered Sep 28 '22 01:09

peepa


I had this issue:

Service cannot be started. System.ComponentModel.Win32Exception: The system cannot find the file specified at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at winsw.WrapperService.StartProcess(Process process, String arguments, String executable) at winsw.WrapperService.OnStart(String[] _) at System.ServiceProcess.ServiceBase.ServiceQueuedMainCallback(Object state)

And the problem went away when i changed Path to java executable from :

C:\ProgramData\Oracle\Java\javapath\javaw

to

C:\ProgramData\Oracle\Java\javapath\java

I think 'w' is appended by JENKINS anyway.

like image 26
Jacek Tomaka Avatar answered Sep 27 '22 23:09

Jacek Tomaka