Can't start TeamCity and Build agent.

CentOS7, TeamCity 2018.2

My TeamCity suddenly stopped working. It fails to execute runAll.sh start/stop. Reboot the machine and kill by PID don't  help either.

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?

1 comment

Hi,

 

The catalina log should have the answer you are looking for. TeamCity is configured to run in a given address:port. This (most probably the port) is not available for some reason, or the system is refusing to provide it. The most common situation here is that another application is using that same port, preventing teamcity from using it and thus starting, although it could also be that the user lacks permissions to request binding that port.

 

Make sure that no application has the port locked and try again.

0

Please sign in to leave a comment.