Ubuntu slave in Jenkins using ec2 plugin - windows

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...```

Related

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.

spring batch sftp session auth failure: Caused by: java.lang.IllegalStateException: failed to connect

I am trying to connect to SFTP using Spring Batch. i am using the jsch way of sending the files using SFTP. I am getting the following error: The console log is as follows:
I have added the jsch-0.1.44.jar file
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Connecting to <serverName> port 22
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Connection established
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Remote version string: SSH-2.0-6.1.8.136 SSH Tectia Server
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Local version string: SSH-2.0-JSCH-0.1.44
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: aes256-ctr is not available.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: aes192-ctr is not available.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: aes256-cbc is not available.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: aes192-cbc is not available.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: arcfour256 is not available.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_KEXINIT sent
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_KEXINIT received
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: kex: server->client aes128-ctr hmac-md5 none
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: kex: client->server aes128-ctr hmac-md5 none
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_KEXDH_INIT sent
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: expecting SSH_MSG_KEXDH_REPLY
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: ssh_dss_verify: signature true
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
WARNING: Permanently added '<serverName>' (DSA) to the list of known hosts.
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_NEWKEYS sent
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_NEWKEYS received
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_SERVICE_REQUEST sent
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: SSH_MSG_SERVICE_ACCEPT received
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Authentications that can continue: gssapi-with-mic,publickey,keyboard-interactive,password
Apr 14, 2015 3:56:46 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Next authentication method: gssapi-with-mic
Apr 14, 2015 3:56:47 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Authentications that can continue: publickey,keyboard-interactive,password
Apr 14, 2015 3:56:47 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Next authentication method: publickey
Apr 14, 2015 3:56:47 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Authentications that can continue: keyboard-interactive,password
Apr 14, 2015 3:56:47 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Next authentication method: keyboard-interactive
Apr 14, 2015 3:56:49 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Authentications that can continue: password
Apr 14, 2015 3:56:49 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Next authentication method: password
Apr 14, 2015 3:56:49 PM org.springframework.integration.sftp.session.JschLogger log
INFO: Disconnecting from <serverName> port 22
Could not send file per SFTP: org.springframework.integration.MessagingException: Failed to execute on session
org.springframework.integration.MessagingException: Failed to execute on session
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:306)
at org.springframework.integration.file.remote.RemoteFileTemplate.send(RemoteFileTemplate.java:190)
at org.springframework.integration.file.remote.RemoteFileTemplate.send(RemoteFileTemplate.java:182)
at org.springframework.integration.file.remote.handler.FileTransferringMessageHandler.handleMessageInternal(FileTransferringMessageHandler.java:112)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:178)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:149)
at com.sftpsample.util.SftpExample.execute(SftpExample.java:32)
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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at com.sun.proxy.$Proxy9.execute(Unknown Source)
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:406)
at org.springframework.batch.core.step.tasklet.TaskletStep$ChunkTransactionCallback.doInTransaction(TaskletStep.java:330)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:131)
at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:271)
at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:77)
at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:368)
at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:144)
at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:257)
at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:198)
at org.springframework.batch.core.job.SimpleStepHandler.handleStep(SimpleStepHandler.java:148)
at org.springframework.batch.core.job.flow.JobFlowExecutor.executeStep(JobFlowExecutor.java:64)
at org.springframework.batch.core.job.flow.support.state.StepState.handle(StepState.java:67)
at org.springframework.batch.core.job.flow.support.SimpleFlow.resume(SimpleFlow.java:165)
at org.springframework.batch.core.job.flow.support.SimpleFlow.start(SimpleFlow.java:144)
at org.springframework.batch.core.job.flow.FlowJob.doExecute(FlowJob.java:134)
at org.springframework.batch.core.job.AbstractJob.execute(AbstractJob.java:304)
at org.springframework.batch.core.launch.support.SimpleJobLauncher$1.run(SimpleJobLauncher.java:135)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.batch.core.launch.support.SimpleJobLauncher.run(SimpleJobLauncher.java:128)
at com.sftpsample.main.MainApp.main(MainApp.java:143)
Caused by: java.lang.IllegalStateException: failed to create SFTP Session
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:321)
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:295)
... 43 more
Caused by: java.lang.IllegalStateException: failed to connect
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:250)
at org.springframework.integration.sftp.session.DefaultSftpSessionFactory.getSession(DefaultSftpSessionFactory.java:316)
... 44 more
Caused by: com.jcraft.jsch.JSchException: Auth fail
at com.jcraft.jsch.Session.connect(Session.java:461)
at com.jcraft.jsch.Session.connect(Session.java:154)
at org.springframework.integration.sftp.session.SftpSession.connect(SftpSession.java:241)
... 45 more
Can someone please let me know what might be wrong?
The issue was resolved. The batch ID which I used, the password for the same was locked and so I got the authentication failed. After the password was unlocked th program was working fine.

tomcat on port 80 with APR connector ubuntu 12.04

I am trying to configure tomcat 7 (standalone) on ubuntu machine (production env), but getting following exception at startup:
Jan 15, 2014 6:24:45 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.
Jan 15, 2014 6:24:45 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
Jan 15, 2014 6:24:46 AM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1 14 Mar 2012)
Jan 15, 2014 6:24:46 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-apr-80"]
Jan 15, 2014 6:24:46 AM org.apache.coyote.AbstractProtocol init
SEVERE: Failed to initialize end point associated with ProtocolHandler ["http-apr-80"]
java.lang.Exception: Socket bind failed: [13] Permission denied
at org.apache.tomcat.util.net.AprEndpoint.bind(AprEndpoint.java:430)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:640)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:434)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:981)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:559)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:814)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:102)
at org.apache.catalina.startup.Catalina.load(Catalina.java:639)
at org.apache.catalina.startup.Catalina.load(Catalina.java:664)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
I am using Ubuntu 12.04 LTS, initially I installed oracle JDK 1.7.0_45 using "apt-get", then I downloaded tomcat 7.0.50 (.gz format) extracted and configured it to run (as non-root user) on port 80 using authbind (till here is was working perfectly). Then I installed/configured APR (1.5.0) connector (I think now tomcat is able to load it properly):
INFO: Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.
Jan 15, 2014 6:24:45 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
But after this change tomcat is not able listen on port 80. Any advise on that?
UPDATE 1
Would like to add this: When I am trying to run tomcat as root its working just fine, is there something to do with the user i created to run tomcat (tomcat)?? Facing this problem after configuring APR connector it was working fine with tomcat user (on port 80).
right now "tomcat" user is having following privileges:
chown -R /opt/tomcat7 (this is catalina_home)
before configuring APR, I executed following commands for "tomcat" user:
touch /etc/authbind/byport/80
chmod 500 /etc/authbind/byport/80
chown tomcat /etc/authbind/byport/80
UPDATE 2
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
If I am removing above mentioned APR connector from server.xml, tomcat works fine on 80 port with non-root user, and in this case initializing "http-bio-80" connector properly during startup. While with APR tomcat not able to initialize "http-apr-80" connector during startup.

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...

Handshaking not happening between master and slave in jenkins

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.

Resources