Can not connect slave to master - windows

I set up Jenkins on a Windows 7 64 bit PC, and installed a Jenkins slave service on another Win7 64 PC.
The master PC gives this error:
Connection was broken
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
at java.io.ObjectInputStream$PeekInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peek(Unknown Source)
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at hudson.remoting.Channel$ReaderThread.run(Channel.java:1127)
What can I do to diagnose the problem?
[Update]
The error is shown when I go to the Nodes page. The added slave is displayed as being disconnected. And when I click on the node Name, the above error is displayed.
[Update 2]
When a job was forced to run on the slave, it just worked. And afterwards, the slave was displayed as being connected in the node page.
Now I come to think of it, I did not try to queue multiple jobs. Perhaps that would have triggered the execution to the slave as well?
Anyway, I've got my CI farm up & running now :-)

I suggest you to start the slave via browser, log as administrator to the slave machine and go to the node page on jenkins, if you are logged as jenkins admin you'll see a slave start icon, this will download and execute the slave process.
start slave screenshot
Once you get this working you can update it as a windows service via the slave java application menu “File->Install as Windows Service”.

If you're running jenkins through a HTTPS connection using a self signed certificate open jenkins-slave.xml and add -noCertificateCheck to the arguments list.

Look in your $JENKINS_HOME folder for the slave logs, they might contain more information.

Related

Failed to obtain Jenkins slave

In my scenario Jenkins master is available in Linux machine and i can access this in my Local windows machine also.
I created one windows slave using launch method as "Launch agent by connecting to the master".As per guidelines , i created one folder in my windows and i pasted that slave and agent jars in that folder.
While I am trying to run the slave-agent i am getting error like below. (Screenshot attached)
I tried with 2nd option as well i.e i took the provided command in Jenkins slave and i pasted that into command. again it is giving failed to connect error message. Please find below error message.
I am new to this configuration.
Do i need provide my slave machine ip into the master machine or do i need to install any other things related to this. can someone please help me out.
Failed to obtain http://ip:7394839:computer/winslave1/slave-agent.jnlp?encrypt=true
java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown....etc
Slave-agent error
Issue resolved. In my case whenever we are creating new slave it is generating new IP which is not having server. Here just we are creating another node for the existing server.
Whenever we are launching the slave using agent.jar with the slave IP we are getting timed out error. Instead of going with slave IP if we go with master IP , agent is launching successfully.
Please find below example.
If i try with slave IP(Below IP)
java -jar D:\Jenkins\agent.jar -jnlpUrl we are getting error
http://120.231.140:8080/computer/My_slave_node_name_Windows10/slave-agent.jnlp -secret anHexadecimal_Long_Number5d094b1f577bc772b65b7277ac57 -workDir "D:\Jenkins"
Below IP is master IP. Agent launched successfully.
java -jar D:\Jenkins\agent.jar -jnlpUrl http://120.241.141:8080/computer/My_slave_node_name_Windows10/slave-agent.jnlp -secret anHexadecimal_Long_Number5d094b1f577bc772b65b7277ac57 -workDir "D:\Jenkins"
There is change in IP for slave and master. If i launch the slave ip from the cmd we are getting a timed out error.
The other three possibilities are
Whitelist slave IP in master Instance security groups level(all traffic or required ports).
By default windows server will block with IE security settings so diable by following below.
"Enter Server Manager in Windows search to start Server manager application. Select Local Server. Navigate to the IE Enhanced Security Configuration property, select the current setting to open the property page, select the Off option button for the desired users, and then select OK"
Configure a port number for TCP JNLP connection and whitelist it on instance security groups.
Manage Jenkins > Configure Global Security > Enable security > TCP port for JNLP agents: Fixed.

SonarQube - Temp directory is not writable [duplicate]

This question already has answers here:
SonarQube - Unable to load the Wrapper's native library 'wrapper.dll'
(5 answers)
Closed 3 months ago.
I'm installing SonarQube v5.0.1.
I'm running Windows Server 2012 64-bit, Java 1.8 64-bit, and the SonarQube windows-x86-64 wrapper.
SonarQube keeps throwing the following error:
WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\
java.lang.IllegalStateException: Temp directory is not writable: C:\Windows\system32\config\systemprofile\AppData\Local\Temp\
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:60)
at org.sonar.process.MinimumViableSystem.checkWritableTempDir(MinimumViableSystem.java:52)
at org.sonar.process.MinimumViableSystem.check(MinimumViableSystem.java:45)
at org.sonar.application.App.main(App.java:113)
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 org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:57)
... 9 more
<-- Wrapper Stopped
Why does SonarQube keep trying to write to C:\Windows\System32\config\systemprofile\AppData\Local instead of C:\Windows\SysWOW64\config\systemprofile\AppData\Local?
To get rid of this error in previous installations, I've had to create a Temp folder in C:\Windows\System32\config\systemprofile\AppData\Local and fiddle with the read/write settings and or permissions to get SonarQube to stop complaining.
UPDATE: This is a huge problem, because I can't start SonarQube as a Windows Service. What's weird is that I already had SonarQube installed and running as a Windows Service. Today, I stopped the service, and now I can't start the service anymore. I've set the Temp folder's permissions to be not Read-Only and so that Everyone has Full Control (not ideal, I know...)
Still, the Temp error prevents SonarQube from starting.
This can also be fixed by setting the java.io.tmpdir java property to a writable directory.
e.g., in conf/wrapper.conf change
wrapper.java.additional.1=-Djava.awt.headless=true
to
wrapper.java.additional.1=-Djava.awt.headless=true -Djava.io.tmpdir=E:/sonarqube-5.1/temp
I had the same error in my sonar log when trying to start the service after I had installed it.
I had JAVA_HOME and x64 all correctly set up.
I managed to resolve the issue in the log above by changing the 'Log On As' for the installed service to 'NETWORK SERVICE' (without a password), then started the service. By default it had set the Log On As to Local System.
Probably another thing worth mentioning is if you're setting up SonarQube for the first time it may be best to get the website working before installing the service, otherwise debugging is a bit of a pain.
I had the same issue today with sonarqube 5.6 and Windows Server 2008 R2. Nothing of the above worked for me but what fixed the issue was defining a system variable TMPDIR pointing to another temp-directory e.g. C:\TMP
I had the same error when running some sonar analysis.
It turned out that in wrapper.conf I had to add
set.TMPDIR=c:/tmp
with path to the existing tmp directory and of course service needed to be reinstalled (UninstallNTService.bat / InstallNTService.bat)
In case of Windows (specifically Windows 10), delete the file under temp folder [under sonar folders] and run startSonar.bat. It should work.

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)
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)
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.
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...
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.
For me this issue was resolved by uninstalling old java.
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

Failure to run commands from apache karaf client

I have downloaded apache karaf2.3.3 (on felix) on several CentOS6.4 machines. I see this issue only in a few machines. When I try to install a feature using the following commands
$KARAF_HOME/bin/start
$KARAF_HOME/bin/client "features:install myfeature"
I get the following stack trace:
WARN org.apache.sshd.client.session.ClientSessionImpl - Exception caught
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:273)
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:44)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:690)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:664)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:653)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1124)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
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:744)
Looks like client fails to connect to karaf. Firewall is shutdown on all of the machines. Anyone knows why this could be failing? The feature gets happily installed if run karaf in console mode with /bin/karaf and type in the same command
My guess is that the port you defined for the remote Karaf console was already in use by another application before the Karaf installation. As such the wrong application accepts the link, cannot make anything of the data and resets the connection. I would suggest to stop Karaf, check with netstat or via telnet localhost <port> whether the port Karaf is configured to listen on is already in use, and find the related application. As an alternative, you can configure Karaf to use a different (not used) port. See for example this page

How do I fix my SVN checkout on my Jenkins Slave?

I have spent a few days trying to get Jenkins working with svn.
On the master, when I configure the svn url, it validates the URL.
I can do a checkout manually, and am running the slave as the same user as I did the test manual checkout.
I have tried selecting all the different versions of svn on the jenkins config page.
I have checked that entering the incorrect creds on the subversion enterCredential page results in an error, and entering the correct creds allows it to pass.
We are using basic svn auth over http (on port 8080).
The URL validation in the job config passes okay, but the job running on the slave still throws the below exception.
From my various readings of information gleened from the net I am pretty sure this is an authentication issue.
The slave is a Mac OS X, the master is a Windows Server 2008.
Jenkins in running 1.504 (Tried with 1.502). We are using svn 1.6.
Here is the exception:
Building remotely on Mac OS Test Node in workspace /Users/buildmachine/jenkins/xcode
hudson.util.IOException2: remote file operation failed: /Users/buildmachine/jenkins/xcode at hudson.remoting.Channel#1695eeb:Mac OS Test Node
at hudson.FilePath.act(FilePath.java:861)
at hudson.FilePath.act(FilePath.java:838)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:843)
at hudson.scm.SubversionSCM.checkout(SubversionSCM.java:781)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1342)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:683)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:88)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:588)
at hudson.model.Run.execute(Run.java:1568)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:237)
Caused by: java.io.IOException: Remote call on Mac OS Test Node failed
at hudson.remoting.Channel.call(Channel.java:681)
at hudson.FilePath.act(FilePath.java:854)
... 11 more
Caused by: java.lang.NoSuchMethodError: org.tmatesoft.svn.core.wc.SVNBasicClient.getOperationsFactory()Lorg/tmatesoft/svn/core/wc2/SvnOperationFactory;
at hudson.scm.SvnClientManager.wrapUp(SvnClientManager.java:46)
at hudson.scm.SvnClientManager.getUpdateClient(SvnClientManager.java:67)
at hudson.scm.subversion.CheckoutUpdater$1.perform(CheckoutUpdater.java:71)
at hudson.scm.subversion.WorkspaceUpdater$UpdateTask.delegateTo(WorkspaceUpdater.java:153)
at hudson.scm.SubversionSCM$CheckOutTask.perform(SubversionSCM.java:903)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:884)
at hudson.scm.SubversionSCM$CheckOutTask.invoke(SubversionSCM.java:867)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2348)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Finished: FAILURE
I had to remove the newer jar as well:
cd /var/lib/jenkins/plugins/subversion/WEB-INF/lib
mv svnkit-1.7.10-jenkins-1.jar /tmp
/etc/init.d/jenkins restart and it worked! Great Find!
Found the problem..
There was an old svnkit-1.3.6.1-jenkins-2.jar in C:\Program Files (x86)\Jenkins\plugins\subversion\WEB-INF\lib
Shutting down jenkins and deleting this file solved the issue.

Resources