How to run jenkins slave on windows 2012 r2 x64?

元气小坏坏 提交于 2021-02-07 06:44:51

问题


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)

回答1:


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)




回答2:


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.




回答3:


I have a Windows 8 slave, which does work. Fair chance the Java path is incorrect, mine is set to C:\Program Files (x86)\Java\jre7\bin\java (yes, no .exe or anything, adjust just the Program (x86) Files part if you want to use x64 version) in Jenkins. I also have remote root set (to C:\jenkins) and I have an environment variable HOME set to C:\jenkins\ (yes, one is with \ and the other without), but that's only to make it easy to find the files after installation.

My slave works, appears online and then after a while (of idling mostly) will have connection issues. Disconnecting and reconnecting will then sometimes give the 'All pipe instances are busy' error, in that case I just have to do Launch slave agent a couple of times. Found your question when trying to solve that particular issue...




回答4:


First thing, you can Go to the slave machine, Go to Jenkins -> Manage -> Manage Nodes and select the Slave and launch via java web start.

by doing this you will download a .jnlp file and launch it using java configured by you.

Make sure you have configured path to javaws.exe in system variable "PATH"(with version 1.6 or higher).

It will launch a window and and display as "Connected". Now you can click on "File" and install as service.

This fails giving you an exception if the machine does not have .NET 3.x so make sure you have installed it and then try it again.

This works pretty cleanly without any issues. Hope this helps.




回答5:


For me this issue was resolved by uninstalling old java.




回答6:


I encountered a similar issue, when trying to run the slave(agent) from master(jenkins), after making one configuration change as below it worked fine,

the below settings needs to added in the agent node->configure.

JVM option -Djsse.enableSNIExtension=false

At Jenkins->Agent node, for a windows server 2012 slave configuration



来源:https://stackoverflow.com/questions/23754417/how-to-run-jenkins-slave-on-windows-2012-r2-x64

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!