Failed to obtain Jenkins slave - windows

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.

Related

What is the right host url in sonar for bamboo(plugin) configuration?

I have to set host url in sonar for bamboo(bambo plugin) configuration.
While my local docker program is running sonarqube container, it is confused to use localhost:9000 at host url in app configuration.
The error message is saying An error occurred while connecting the given SonarQube server: localhost:9000 failed to respond.
What should I do? Am I doing wrong or Is there anything to set more thing?
enter image description here
As your SonarQube instance is running in a different server, you need to point your "Sonar for Bamboo" plugin to that server, port 9000 (default of SonarQube). So, for example, if your server containing the SonarQube instance has the IP address 192.168.15.1 in your network, you need to configure the plugin to http://192.168.15.1:9000.
I did it in my environment and it works perfectly.

Jmeter remote connection throwing "Connection refused to host"

I setup a distributed load testing environment using JMeter in unbundu machines.
->Master: the system running JMeter GUI, control each slave.
->Slave: the system running jmeter-server, receive command from the master and send a request to server under test.
->Target: the web server under test, get request from slaves.
Basic requirements are done:
-The firewalls on the systems are turned off
-All the planned master and Slaves are in the same subnet
-The JMeter server can access the target.
-Same version of JMeter on all the systems (version 2.3.4 ).
I did the following:
1) Tried pinging form master to slave and vice versa through ubundu terminal. its happening ..
2) Added the following to client (master) jmeter.properties:
# Remote hosts and RMI configuration
remote_hosts=192.168.0.139:1099
# RMI port to be used by the server (must start rmiregistry with same port)
server_port=1099
3) Added the following to server (Slave) jmeter.properties:
# On the server(s)
set server_port=1234
start rmiregistry with port 1234
4) Now started the Jmeter engine on Master.
a) Started Jmeter on master machine (GUI)
b) Created test plan--> (added tread group , samplers and required listners)
c) Now start the Slave(s) from the GUI
-click Run at the top
-select Remote start
-select the IP address
But error popup came as :-
"Connection refused to host : 192.168.0.139; nested exception is : java.net.ConnectionException : Connection Refused"
what may be the reason for not connecting with the remote salve (say here : 192.168.0.139)
DO i need to do any more configuration in jmeter.properties file or in any other files (in both slave and master)?
I think you forgot to start the slave in "slave mode".
In command line mode, go to jmeter/bin directory and execute jmeter-server.bat
That will start the slave process and will keeps it listening for commands.
Then you can go forward, loading amd launching the script.
have a look at:
http://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.pdf
Also be aware that:
- the two systems MUST run the same Jmeter version
- the two systems MUST be on the same subnetwork
- the two systems SHOULD be as similar as possible: same OS, same directory tree, etc
- "remote_hosts" only require the address. The port is specified by "server_port" parameter.

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

"java.net.UnknownHostException: abcd.efgh.co.uk" while testing the web application on remote server

I am getting the following exception while using Jmeter to test application running on another remote server.
java.net.UnknownHostException: abcd.efgh.co.uk
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:559)
at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:141)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:272)
at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:329)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:172)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:916)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:158)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:133)
at org.apache.jmeter.protocol.http.sampler.HTTPJavaImpl.sample(HTTPJavaImpl.java:479)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1054)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1043)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:271)
at java.lang.Thread.run(Thread.java:662)
The same script is running successfully for the web application running on the localhost.
Am I missing any configuration that need to be done for testing the applications running on remote servers.
Any help would be appreciated.
Please refer the following screenshot to set the proxy settings in the Jmeter.

Can not connect slave to master

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.

Resources