Handshaking not happening between master and slave in jenkins - windows

How to solve this error? Error occurred since I make master ip to public and assign DNS.
Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Hudson agent is running in headless mode.
Jul 27, 2012 12:44:17 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://10.10.1.162:8080/jenkins/, http://dem
Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to demo.sigmainfo.in:8050
Jul 27, 2012 12:44:38 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Jul 27, 2012 12:44:58 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: The server rejected the connection:
java.lang.Exception: The server rejected the connection:
at hudson.remoting.Engine.onConnectionRejected(Engine.java:258)
at hudson.remoting.Engine.run(Engine.java:233)
I have seen so many thread regarding this, but didn't get any answer properly.
I connected using headless slave agent and put HOST:PORT in advanced setting of configuration of slave. Master is linux and slave is windows 7.

From Comments:
=================================
Since you are having problems with the public IP & DNS, can you make sure that routing for the public IP and DNS is allowed on your network. Just to be sure this is not a firewall issue. Are you on a corporate network? In that case, your corporate firewall may be blocking certain ports on all IP addresses.

Related

Ubuntu slave in Jenkins using ec2 plugin

Could you please mention clear steps to add Ubuntu/Windows slave in Jenkins using ec2 plugin?
I tried adding Ubuntu slave in Jenkins using an ec2-plugin, finding the error below:
Dec 03, 2019 9:22:34 AM hudson.plugins.ec2.EC2Cloud
WARNING: Exception trying to authenticate Exception: java.io.IOException: Publickey authentication failed.
Dec 03, 2019 9:22:34 AM hudson.plugins.ec2.EC2Cloud
WARNING: Authentication failed. Trying again...
Dec 03, 2019 9:23:04 AM hudson.plugins.ec2.EC2Cloud
INFO: Authenticating as ubuntu
Dec 03, 2019 9:23:04 AM hudson.plugins.ec2.EC2Cloud
INFO: Connecting to 172.31.4.2 on port 22, with timeout 10000.
Dec 03, 2019 9:23:04 AM hudson.plugins.ec2.EC2Cloud
INFO: Connected via SSH.
Dec 03, 2019 9:23:04 AM hudson.plugins.ec2.EC2Cloud
WARNING: Exception trying to authenticate Exception: java.io.IOException: Publickey authentication failed.
Dec 03, 2019 9:23:04 AM hudson.plugins.ec2.EC2Cloud
WARNING: Authentication failed. Trying again...```

Unable to access Jenkins from browser on Windows

I installed Jenkins on CentOS 7 running in VMware Workstation. Jenkins Service is running:
jenkins.service - Jenkins Service
Loaded: loaded (/etc/systemd/system/jenkins.service; disabled; vendor preset: disabled)
Active: active (running) since Tue 2016-06-21 08:47:46 PDT; 5s ago
Main PID: 68969 (java)
Memory: 82.3M
CGroup: /system.slice/jenkins.service
└─68969 java -jar /usr/local/bin/jenkins.war
Jun 21 08:47:48 server.centos.lan java[68969]: Jun 21, 2016 8:47:48 AM org.eclipse.jetty.util.log.JavaUtilLog info
Jun 21 08:47:48 server.centos.lan java[68969]: INFO: Started ServerConnector#34ddf859{HTTP/1.1}{0.0.0.0:8080}
Jun 21 08:47:48 server.centos.lan java[68969]: Jun 21, 2016 8:47:48 AM org.eclipse.jetty.util.log.JavaUtilLog info
Jun 21 08:47:48 server.centos.lan java[68969]: INFO: Started #2472ms
Jun 21 08:47:48 server.centos.lan java[68969]: Jun 21, 2016 8:47:48 AM winstone.Logger logInternal
Jun 21 08:47:48 server.centos.lan java[68969]: INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Jun 21 08:47:49 server.centos.lan java[68969]: Jun 21, 2016 8:47:49 AM jenkins.InitReactorRunner$1 onAttained
Jun 21 08:47:49 server.centos.lan java[68969]: INFO: Started initialization
Jun 21 08:47:49 server.centos.lan java[68969]: Jun 21, 2016 8:47:49 AM jenkins.InitReactorRunner$1 onAttained
Jun 21 08:47:49 server.centos.lan java[68969]: INFO: Listed all plugins
IP of VM is 192.168.139.160. Host operating system is Windows 7.
When I try to access Jenkins from browser on Windows using http://192.168.139.160:8080/jenkins I get error:
"This site can’t be reached". What am I doing wrong?
If you have installed Jenkins on CentOS 7.1, you should add a rule in firewall for port 8080, or at least disable firewalld.
To disable firewalld, you can use these commands:
systemctl stop firewalld
systemctl disable firewalld
After this you should be able to reach Jenkins on port 8080.
Stop Firewall + start tomcat
Find where you have the iptables, then put them down like this:
/etc/init.d/iptables stop
(might be some different location on your computer)
Then start up the tomcat you'll have a script like this:
startup.sh (in my computer the path is /usr/share/apache-tomcat-7.0.56/bin/)
Please try it out.
First
JENKINS_HTTPS_LISTEN_ADDRESS="Public IP" >> /etc/sysconfig/jenkins
Then
/etc/init.d/jenkins restart

Jenkins on Windows 2008 R2 SSH

I'm setting up a build server for our team, and ran into an issue.
Starting up Jenkins as a windows service, I immediately see these exceptions in the Error log:
Sep 18, 2015 9:26:32 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
Sep 18, 2015 9:26:32 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: jetty-winstone-2.8
Sep 18, 2015 9:26:35 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: NO JSP Support for , did not find org.apache.jasper.servlet.JspServlet
Sep 18, 2015 9:26:35 AM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started SelectChannelConnector#0.0.0.0:8999
Sep 18, 2015 9:26:35 AM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled
Sep 18, 2015 9:26:36 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started initialization
Sep 18, 2015 9:26:36 AM jenkins.InitReactorRunner$1 onAttained
INFO: Listed all plugins
Sep 18, 2015 9:26:36 AM jenkins.InitReactorRunner$1 onAttained
INFO: Prepared all plugins
Sep 18, 2015 9:26:36 AM jenkins.InitReactorRunner$1 onAttained
INFO: Started all plugins
Sep 18, 2015 9:26:36 AM jenkins.InitReactorRunner$1 onAttained
INFO: Augmented all extensions
Sep 18, 2015 9:26:39 AM jenkins.InitReactorRunner$1 onAttained
INFO: Loaded all jobs
Sep 18, 2015 9:26:40 AM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate Key[type=org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl, annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting constructor, java.io.IOException: javax.crypto.BadPaddingException: Given final block not properly padded
at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:20)
1 error
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:52)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1.get(ExtensionFinder.java:428)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$3$1.call(InjectorImpl.java:1005)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1001)
at hudson.ExtensionFinder$GuiceFinder._find(ExtensionFinder.java:390)
at hudson.ExtensionFinder$GuiceFinder.find(ExtensionFinder.java:381)
at hudson.ClassicPluginStrategy.findComponents(ClassicPluginStrategy.java:388)
at hudson.ExtensionList.load(ExtensionList.java:349)
at hudson.ExtensionList.ensureLoaded(ExtensionList.java:287)
at hudson.ExtensionList.iterator(ExtensionList.java:156)
at jenkins.model.Jenkins.getDescriptor(Jenkins.java:1181)
at hudson.plugins.disk_usage.DiskUsageProperty.transitionAuth(DiskUsageProperty.java:444)
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 hudson.init.TaskMethodFinder.invoke(TaskMethodFinder.java:106)
at hudson.init.TaskMethodFinder$TaskImpl.run(TaskMethodFinder.java:176)
at org.jvnet.hudson.reactor.Reactor.runTask(Reactor.java:282)
at jenkins.model.Jenkins$7.runTask(Jenkins.java:898)
at org.jvnet.hudson.reactor.Reactor$2.run(Reactor.java:210)
at org.jvnet.hudson.reactor.Reactor$Node.run(Reactor.java:117)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: javax.crypto.BadPaddingException: Given final block not properly padded
at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:62)
at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:38)
at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl.<init>(PageDecoratorImpl.java:21)
at org.jenkinsci.main.modules.instance_identity.PageDecoratorImpl$$FastClassByGuice$$68618106.newInstance(<generated>)
at com.google.inject.internal.cglib.reflect.$FastConstructor.newInstance(FastConstructor.java:40)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:61)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1058)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
... 27 more
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:966)
at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:824)
at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:436)
at javax.crypto.Cipher.doFinal(Cipher.java:2165)
at org.jenkinsci.main.modules.instance_identity.InstanceIdentity.<init>(InstanceIdentity.java:60)
... 38 more
Sep 18, 2015 9:26:40 AM hudson.ExtensionFinder$GuiceFinder$FaultTolerantScope$1 error
WARNING: Failed to instantiate Key[type=org.jenkinsci.main.modules.sshd.SSHD, annotation=[none]]; skipping this component
com.google.inject.ProvisionException: Guice provision errors:
This leads to a bunch more similar errors caused by this un instantiated key, which was originally caused by this BadPaddingException. I'm not an expert in this sort of stuff but I presume there is something with the way SSH is configured on my server.
Another piece to this is, I can access Jenkins just fine from the localhost, I have granted a port for Jenkins from when remote users access the Jenkins site (we have a specific domain for this machine for external users). However, this doesn't seem to work as for some reason it fails to connect. Running Fiddler it says [Fiddler] DNS Lookup for "xxxxxxx" failed. System.Net.Sockets.SocketException No such host is known
Like I said earlier, I'm not an expert in this sort of stuff so I'm looking for any pointers or solutions to get started on figuring out this issue.
Ok, for anyone that runs into this, McAfee was blocking any firewall rules for some reason. I threw Jenkins on Apache Tomcat and it allowed firewall rules to accept traffic only if I put it on port 8080.

InvocationTargetException in jenkins machine while running selenium RemoteWebdriver

I made a setup to run selenium scripts during jenkins build. Jenkins is available in linux machine and selenium-server-standalone-2.39.0.jar is running in the jenkins machine.
The selenium grid will run the scripts in windows machine and the code looks like,
DesiredCapabilities desiredCapabilities = DesiredCapabilities.chrome();
desiredCapabilities.setBrowserName("chrome");
desiredCapabilities.setPlatform(Platform.ANY);
WebDriver driver = new RemoteWebDriver(new URL("http://example.com:5555/wd/hub"), desiredCapabilities);
I also have the below setup in jenkins,
maven is used to run the selenium test suite and the junit test report are published.
Sometime the jenkins machine is going down with the below error,
Jun 24, 2015 4:15:57 AM hudson.node_monitors.ResponseTimeMonitor$1 monitor
WARNING: Making NewSlave offline because it’s not responding
Jun 24, 2015 4:44:04 AM hudson.ExpressionFactory2$JexlExpression evaluate
WARNING: Caught exception evaluating: it.transientActions in /job/Selenium_GRID/4/console. Reason: java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
.....
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
at com.chikli.hudson.plugin.naginator.NaginatorActionFactory.createFor(NaginatorActionFactory.java:20)
at hudson.model.Run.getTransientActions(Run.java:362)
... 122 more
Jun 24, 2015 5:15:42 AM hudson.model.Run execute
This is the selenium server log,
Jun 22, 2015 6:46:04 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Connection refused
Jun 22, 2015 6:47:12 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Connection timed out
Jun 22, 2015 6:47:12 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy onEvent
WARNING: Marking the node as down. Cannot reach the node for 2 tries.
Jun 22, 2015 6:48:20 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy isAlive
WARNING: Failed to check status of node: Connection refused
Jun 22, 2015 6:48:20 PM org.openqa.grid.selenium.proxy.DefaultRemoteProxy onEvent
WARNING: Unregistering the node. It's been down for 67828 milliseconds.
Jun 22, 2015 6:48:20 PM org.openqa.grid.internal.Registry removeIfPresent
WARNING: Proxy 'host :http://xxx.xxx.y.z:5555' was previously registered. Cleaning up any stale test sessions.
The problem is that, jenkins is going down when the selenium scripts got failed or sometimes when viewing the failed test results in jenkins test report.Can anyone please suggest why this issue is occuring and how to resolve this issue?
Is this issue occuring due to the selenium server running in jenkins machine or any other reason?

TeamCIty Server on EC2 Linux instance dies before it's done starting up

I'm installing TeamCity in EC2, starting with the Server then moving on the agents. I'm starting with the Amazon Linux AMI, running on a micro instance. Then I did:
sudo yum update
wget http://download.jetbrains.com/teamcity/TeamCity-7.1.1.tar.gz
tar -xvzf TeamCity-7.1.1.tar.gz
cd TeamCity
bin/teamcity-server.sh start
When I start it using bin/teamcity-server.sh start, things happen. I can connect using a web browser which shows the 'TeamCity is starting' page. The teamcity-server.log shows a bunch of activity, unzipping plugins etc.
But then suddently, the server process just disappears. The port's no longer listened to, ps shows no java process running, and the browser can't connect.
There's no error messages in the catalina or teamcity logs. After much trial and error though, I ran bin/teamcity-server.sh run (instead of start) to get console output, and got the following:
Using CATALINA_BASE: /home/ec2-user/TeamCity
Using CATALINA_HOME: /home/ec2-user/TeamCity
Using CATALINA_TMPDIR: /home/ec2-user/TeamCity/temp
Using JRE_HOME: /usr/lib/jvm/jre
Using CLASSPATH: /home/ec2-user/TeamCity/bin/bootstrap.jar:/home/ec2-user/TeamCity/bin/tomcat-juli.jar
Nov 1, 2012 7:22:25 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64/server:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/lib/amd64:/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Nov 1, 2012 7:22:26 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8111"]
Nov 1, 2012 7:22:26 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 2742 ms
Nov 1, 2012 7:22:26 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Nov 1, 2012 7:22:26 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
Nov 1, 2012 7:22:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /home/ec2-user/TeamCity/webapps/ROOT
Log4J configuration file /home/ec2-user/TeamCity/bin/../conf/teamcity-server-log4j.xml will be monitored with interval 10 seconds.
Nov 1, 2012 7:22:30 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8111"]
Nov 1, 2012 7:22:30 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3786 ms
=======================================================================
TeamCity 7.1.1 (build 24074) initialized, OS: Linux, JRE: 1.6.0_24-b24
TeamCity is running in professional mode
bin/teamcity-server.sh: line 18: 4231 Killed ./catalina.sh $1
I promise that I did not kill the process! I can find my way around in Linux well enough, but I'm not at all sure where to go next to find out why or what killed the process. Can anyone help?
After some further scanning of .sh files to see how TeamCity was starting itself up, I noticed that it was grabbing a fair amount of memory for it's java process (either 512m or 750m depending on which line you use).
The EC2 micro instance only has 613m of RAM total. When I realized this, I tried the whole process again with a larger instance, and things worked fine.
I'm still curious if there's a better way I could've known what was causing catalina to die, so if anyone wants to answer with that information...

Resources