Can't start TeamCity and Build agent - linux

My TeamCity suddenly stopped working. It fails to execute runAll.sh start/stop. Reboot the machine and kill by PID don't help either.
CentOS7, TeamCity 2018.2
Output from the command line:
[root#host bin]# ./runAll.sh stop
Java executable is found: '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java'
Using CATALINA_BASE: /opt/TeamCity
Using CATALINA_HOME: /opt/TeamCity
Using CATALINA_TMPDIR: /opt/TeamCity/temp
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre
Using CLASSPATH: /opt/TeamCity/bin/bootstrap.jar:/opt/TeamCity/bin/tomcat-juli.jar
Using CATALINA_PID: /opt/TeamCity/bin/../logs/teamcity.pid
PID file found but either no matching process was found or the current user does not have permission to stop the process. Stop aborted.
Stopping TeamCity build agent...
Java executable is found: '/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java'
Starting TeamCity Build Agent Launcher...
Agent home directory is /opt/TeamCity/buildAgent
Received stop command from console.
Sending agent shutdown command to: http://localhost:9090
Failed to shutdown agent gracefully: Connection timed out (Connection timed out)
Cannot stop agent gracefully, you can try to kill agent by './agent.sh stop kill' command
Output from Catalina's log:
25-Dec-2018 20:35:48.289 SEVERE [main] org.apache.catalina.core.StandardServer.await StandardServer.await: create[localhost:8105]:
java.net.BindException: Cannot assign requested address (Bind failed)
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:440)
at org.apache.catalina.startup.Catalina.await(Catalina.java:769)
at org.apache.catalina.startup.Catalina.start(Catalina.java:715)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:353)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:493)
<..>
25-Dec-2018 20:35:48.563 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] appears to have started a thread named [Change Observer 1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
What can be a reason or a solution?

From java.net.BindException documentation:
Signals that an error occurred while attempting to bind a socket to a local address and port.
Typically, the port is in use, or the requested local address could not be assigned.
so, or port is in use or you don't have permission to open port...
i guess you have troubles because of firewall on centos

The follow steps have helped me to resolve this issue:
runAll.sh stop force (2 times) - kill all running teamcity's activities (additionally - agent.sh stop kill)
adjust service's settings:
server:
Type=forking
PIDFile=/opt/TeamCity/logs/teamcity.pid
&
agent:
Type=oneshot
RemainAfterExit=yes

Related

jenkins.war stop error “Name or service not known”

I have a jenkins service running in linux(no docker), sometimes service dont response
when I excute "service --status-all" command show .war is stop
in jenkins log show this message
WARNING: Could not intialize the host network interface on nullbecause of an error: myserver: myserver: Name or service not known
java.net.UnknownHostException: myserver: myserver: Name or service not known
at java.net.InetAddress.getLocalHost(InetAddress.java:1505)
at javax.jmdns.impl.HostInfo.newHostInfo(HostInfo.java:75)
at javax.jmdns.impl.JmDNSImpl.<init>(JmDNSImpl.java:407)
at javax.jmdns.JmDNS.create(JmDNS.java:60)
at hudson.DNSMultiCast$1.call(DNSMultiCast.java:33)
at jenkins.util.ContextResettingExecutorService$2.call(ContextResettingExecutorService.java:46)
at jenkins.security.ImpersonatingExecutorService$2.call(ImpersonatingExecutorService.java:71)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.UnknownHostException: myserver: Name or service not known
at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
at java.net.InetAddress.getLocalHost(InetAddress.java:1500)
if I restart service run normally but this problem is very inconvenient
Adding your hostname to /etc/hosts might help.

Connection Error in Ignite web agent

For analysis of node in Apache ignite, I am using monitoring tool at [1] : https://console.gridgain.com/. I tried running ignite-web-agent.sh for making connection with web server at link above, but I am getting following error messege. I also tried replacing localhost with IP address of machine, but still it is not working. While running ignite node do I have to start ignite REST server for connection? If yes then how can I enable this REST server mode through java code?
ignite-web-agent-1.7.2]$ . ignite-web-agent.sh
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
[12:58:13,881][INFO ][main][AgentLauncher] Starting Apache Ignite Web Console Agent...
Agent configuration:
User's security tokens : ****************Fq3q
URI to Ignite node REST server: http://localhost:8080
URI to Ignite Console server : https://console.gridgain.com:3002
Path to agent property file : default.properties
Path to JDBC drivers folder : /home/rishikesh/ignite-web-agent-1.7.2/jdbc-drivers
[12:58:14,318][INFO ][EventThread][AgentLauncher] Connecting to: https://console.gridgain.com:3002
[12:58:34,314][ERROR][EventThread][AgentLauncher] Connection error.
io.socket.client.SocketIOException: timeout
at io.socket.client.Manager$1$4$1.run(Manager.java:312)
at io.socket.thread.EventThread$2.run(EventThread.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[12:58:37,304][INFO ][EventThread][AgentLauncher] Connecting to: https://console.gridgain.com:3002
[12:58:53,744][ERROR][EventThread][AgentLauncher] Connection error.
io.socket.engineio.client.EngineIOException: xhr poll error
at io.socket.engineio.client.Transport.onError(Transport.java:64)
at io.socket.engineio.client.transports.PollingXHR.access$100(PollingXHR.java:18)
at io.socket.engineio.client.transports.PollingXHR$6$1.run(PollingXHR.java:126)
at io.socket.thread.EventThread$2.run(EventThread.java:75)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.UnknownHostException: console.gridgain.com
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1890)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1885)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1884)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1457)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1441)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338)
at io.socket.engineio.client.transports.PollingXHR$Request$1.run(PollingXHR.java:214)
... 1 more
Web agent can't resolve console.gridgain.com
try to change 'URI to Ignite Console server' in /home/rishikesh/ignite-web-agent-1.7.2/default.properties please replace:
server-uri=https://console.gridgain.com:3002
to:
server-uri=https://104.197.2.239:3002
To enable REST module move ignite-rest-http folder from lib/optional/ to lib/ in binary distribution or add following dependence to your maven project:
<dependency>
<groupId>org.apache.ignite</groupId>
<artifactId>ignite-rest-http/artifactId>
<version>${ignite.version}</version>
</dependency>

SparkR and Pyspark throw Java.net.Bindexception on launch, but Spark-Shell does not?

I have already tried setting SPARK_LOCAL_IP to "127.0.0.1" and checking if the port is occupied. Here is the full error text:
Launching java with spark-submit command /usr/hdp/2.4.0.0-
169/spark/bin/spark-submit "sparkr-shell" /tmp/RtmpZo44il/backend_port998540c56917
/usr/hdp/2.4.0.0-169/spark/bin/load-spark-env.sh: line 72: export: `load-spark-env.sh': not a valid identifier
16/06/13 11:28:24 ERROR RBackend: Server shutting down: failed with exception
java.net.BindException: Cannot assign requested address
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:125)
at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:485)
at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1089)
at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:430)
at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:415)
at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:903)
at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:198)
at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:348)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:357)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:357)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137)
at java.lang.Thread.run(Thread.java:745)
Error in SparkR::sparkR.init() : JVM is not ready after 10 seconds
Above error is when launching ./bin/sparkR. Again Spark-shell will execute normally.
Some more information. Spark-shell when launched will automatically search through ports until it has resolved one that doesn't have a bind exception. Even when I set the default SparkR backend port to an unused port it will fail.
I found the issue. Another user had deleted my etc/hosts file. I reconfigured the file with localhost and it seems to run sparkR. I am still curious how spark-shell could run with the file though.

Connection error: Request did not complete within rpc_timeout when doing cqlsh

I have installed Cassandra v2.0.16 on CentOS release 6.6 (Final).
But when I try to do cqlsh on it, It gives the following error,
Connection error: Request did not complete within rpc_timeout
On My local machine, I am running ubuntu 12.04, it works fine, but on my production machine (User Managed VPS running Cent OS) its not working properly.
I went to the /var/log/cassandra/system.log
ERROR [main] 2015-07-02 04:42:12,973 CassandraDaemon.java (line 571) Exception encountered during startup
org.jboss.netty.channel.ChannelException: Failed to bind to: localhost/127.0.0.1:9042
at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
at org.apache.cassandra.transport.Server.run(Server.java:159)
at org.apache.cassandra.transport.Server.start(Server.java:110)
at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:489)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:567)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:643)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:444)
at sun.nio.ch.Net.bind(Net.java:436)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
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)
I am just stuck here.
Please any help would be appreciated.
I am not getting how to solve this problem.
Note: I have reinstalled Cassandra 2 to 3 times. But stuck with same problem

How do you stop tomcat after changing the shutdown word in server.xml?

Running tomcat-7.0.33 on CentOS. I have a security requirement to change the tomcat shutdown word in server.xml to a random string of characters, so I need to go from this:
<Server port="8005" shutdown="SHUTDOWN">
to something like this
<Server port="8005" shutdown="8GVsi4lMZTX6aOzorJYexiq8K7ZGxaZ">
However once that is in place, I cannot restart/stop tomcat via the init script (/etc/init.d/tomcat stop). When I attempt to, I get the following in my catalina.out:
Jul 22, 2014 8:09:28 PM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at java.net.Socket.connect(Socket.java:528)
at java.net.Socket.<init>(Socket.java:425)
at java.net.Socket.<init>(Socket.java:208)
at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:499)
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.stopServer(Bootstrap.java:371)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:453)
Simple question: how do I change the shutdown word in server.xml in such a way that I can use the init script just as I always would?
Or, if that does not have an answer, when I change the shutdown word in server.xml, how do I go about restarting/stopping the tomcat service?
Shut down tomcat, then change it.
You can also do a simple unix kill command (this sends the INT signal, don't send the KILL signal) to the process. That will cleanly shut down tomcat as well.

Resources