TeamCity fails to start at all on Ubuntu

TeamCity fails to run on user accounts set up for it, but all of the obvious user environment variables (such as JAVA_HOME) have been set.

When I run it on my personal account, it works correctly, despite the entire TeamCity folders being owned correctly. I have also tried passing TEAMCITY_DATA_PATH in case it was something to do with a data storage issue.

The only file that gets logged to every time (when run with its own account) is catalina.log, which is shown below. Every once in a while I am able to get to the web UI, showing it is connecting to the database, then instantly shuts itself down, with no error. Beneath that is the teamcity.log which only occasionally gets filled.

 

catalina.2016-04-03.log

Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server version: Apache Tomcat/7.0.59
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server built: Jan 28 2015 15:51:10 UTC
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Server number: 7.0.59.0
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Name: Linux
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: OS Version: 4.2.0-34-generic
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Architecture: amd64
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Java Home: /usr/lib/jvm/java-8-oracle/jre
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Version: 1.8.0_77-b03
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: JVM Vendor: Oracle Corporation
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_BASE: /opt/TeamCity
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: CATALINA_HOME: /opt/TeamCity
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.config.file=/opt/TeamCity/conf/logging.properties
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Xmx512m
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -XX:MaxPermSize=270m
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dteamcity.configuration.path=../conf/teamcity-startup.properties
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dlog4j.configuration=file:/opt/TeamCity/bin/../conf/teamcity-server-log4j.xml
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dteamcity_logs=../logs/
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.awt.headless=true
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.endorsed.dirs=/opt/TeamCity/endorsed
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.base=/opt/TeamCity
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=/opt/TeamCity
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/opt/TeamCity/temp
Apr 03, 2016 2:49:08 AM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
Apr 03, 2016 2:49:08 AM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-8111"]
Apr 03, 2016 2:49:08 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 531 ms
Apr 03, 2016 2:49:08 AM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Apr 03, 2016 2:49:08 AM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.59
Apr 03, 2016 2:49:08 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory /opt/TeamCity/webapps/ROOT

teamcity-server.log

[2016-04-03 02:51:29,560] INFO - jetbrains.buildServer.STARTUP - ===========================================================
[2016-04-03 02:51:29,560] INFO - jetbrains.buildServer.STARTUP - Starting TeamCity server
[2016-04-03 02:51:29,710] INFO - jetbrains.buildServer.STARTUP - TeamCity version: 9.1.6 (build 37459), data format version 727
[2016-04-03 02:51:29,724] INFO - jetbrains.buildServer.STARTUP - OS: Linux, User: jenkins, JRE: 1.8.0_77, Java HotSpot(TM) 64-Bit Server VM (25.77-b03, mixed mode), Java(TM) SE Runtime Environment (1.8.0_77-b03), Oracle Corporation
[2016-04-03 02:51:29,724] INFO - jetbrains.buildServer.STARTUP - JVM parameters: -Djava.util.logging.config.file=/opt/TeamCity/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xmx512m -XX:MaxPermSize=270m -Dteamcity.configuration.path=../conf/teamcity-startup.properties -Dlog4j.configuration=file:/opt/TeamCity/bin/../conf/teamcity-server-log4j.xml -Dteamcity_logs=../logs/ -Djava.awt.headless=true -Djava.endorsed.dirs=/opt/TeamCity/endorsed -Dcatalina.base=/opt/TeamCity -Dcatalina.home=/opt/TeamCity -Djava.io.tmpdir=/opt/TeamCity/temp
[2016-04-03 02:51:29,724] INFO - jetbrains.buildServer.STARTUP - Garbage collection: PS Scavenge, PS MarkSweep
[2016-04-03 02:51:29,730] INFO - jetbrains.buildServer.STARTUP - Web server version: Apache Tomcat/7.0.59
[2016-04-03 02:51:29,730] INFO - jetbrains.buildServer.STARTUP - Server IP address: 127.0.1.1
[2016-04-03 02:51:29,732] INFO - jetbrains.buildServer.STARTUP - Web server ports: 8111 (protocol: org.apache.coyote.http11.Http11NioProtocol, scheme: http), 8105 (shutdown port)
[2016-04-03 02:51:29,736] INFO - jetbrains.buildServer.STARTUP - Version file lock was successfully obtained: /opt/TeamCity/webapps/ROOT/BUILD_37459
[2016-04-03 02:51:29,748] INFO - jetbrains.buildServer.STARTUP - Servlet real path: /opt/TeamCity/webapps/ROOT/
[2016-04-03 02:51:29,771] INFO - jetbrains.buildServer.STARTUP - Current stage: Looking for the TeamCity Data Directory
[2016-04-03 02:51:29,778] INFO - jetbrains.buildServer.STARTUP - The TeamCity Data Directory path is determined using the startup configuration from '/opt/TeamCity/conf/teamcity-startup.properties' file
[2016-04-03 02:51:29,794] INFO - jetbrains.buildServer.STARTUP - The TeamCity Data Directory "/opt/TeamCity/.BuildServer" exists
[2016-04-03 02:51:29,796] INFO - jetbrains.buildServer.STARTUP - The main configuration file "/opt/TeamCity/.BuildServer/config/main-config.xml" exists
[2016-04-03 02:51:29,796] INFO - jetbrains.buildServer.STARTUP - The database properties file "/opt/TeamCity/.BuildServer/config/database.properties" exists
[2016-04-03 02:51:29,796] INFO - jetbrains.buildServer.STARTUP - The internal database data file "/opt/TeamCity/.BuildServer/system/buildserver.data" doesn't exist
[2016-04-03 02:51:29,853] INFO - jetbrains.buildServer.STARTUP - Data Directory version: 727
[2016-04-03 02:51:29,854] INFO - jetbrains.buildServer.STARTUP - Current stage: Looking for the database configuration
[2016-04-03 02:51:29,854] INFO - jetbrains.buildServer.STARTUP - Database properties file "/opt/TeamCity/.BuildServer/config/database.properties" exists
[2016-04-03 02:51:29,855] INFO - jetbrains.buildServer.STARTUP - Internal HSQL database file (/opt/TeamCity/.BuildServer/system/buildserver.data) doesn't exist
[2016-04-03 02:51:29,855] INFO - jetbrains.buildServer.STARTUP - Database connection URL: jdbc:mysql:///teamcity
[2016-04-03 02:51:29,855] INFO - jetbrains.buildServer.STARTUP - Using database connection URL from the database properties file. The URL is: jdbc:mysql:///teamcity
[2016-04-03 02:51:29,859] INFO - jetbrains.buildServer.STARTUP - Using external (MYSQL) database
[2016-04-03 02:51:29,860] INFO - jetbrains.buildServer.STARTUP - Current stage: Connecting to the database
[2016-04-03 02:51:29,861] INFO - jetbrains.buildServer.STARTUP - JDBC loader: loading JDBC drivers (for the first time)
[2016-04-03 02:51:30,523] INFO - ide.db.TeamCityDatabaseManager - Database character set: utf8_general_ci
[2016-04-03 02:51:30,523] INFO - ide.db.TeamCityDatabaseManager - Database collation: utf8_general_ci
[2016-04-03 02:51:30,555] INFO - jetbrains.buildServer.STARTUP - JDBC driver version: 5.1 (MySQL Connector Java)
[2016-04-03 02:51:30,555] INFO - jetbrains.buildServer.STARTUP - Database system version: 5.5.5.10.0.23 (MySQL)
[2016-04-03 02:51:30,555] INFO - jetbrains.buildServer.STARTUP - Connected to the database successfully
[2016-04-03 02:51:30,555] INFO - jetbrains.buildServer.STARTUP - Current stage: Checking the database
[2016-04-03 02:51:35,338] INFO - jetbrains.buildServer.STARTUP - Server shutdown has been requested
[2016-04-03 02:51:36,096] INFO - jetbrains.buildServer.STARTUP - Database contains 122 tables.
[2016-04-03 02:51:36,102] INFO - jetbrains.buildServer.STARTUP - Database version is 727
[2016-04-03 02:51:36,118] INFO - etbrains.buildServer.HEARTBEAT - Attempting to capture the DB lock. My session starting code: 1812594786
[2016-04-03 02:51:36,249] INFO - etbrains.buildServer.HEARTBEAT - The Heartbeat thread is started.
[2016-04-03 02:51:36,249] INFO - jetbrains.buildServer.STARTUP - Current stage: TeamCity server is shutting down
[2016-04-03 02:51:36,249] INFO - jetbrains.buildServer.STARTUP - Stopping the main application
[2016-04-03 02:51:36,249] INFO - jetbrains.buildServer.STARTUP - The main servlet is not initialized, nothing to shut down.
[2016-04-03 02:51:36,250] INFO - etbrains.buildServer.HEARTBEAT - Stopping Heartbeat thread
[2016-04-03 02:51:36,251] INFO - etbrains.buildServer.HEARTBEAT - The lock is released
[2016-04-03 02:51:36,351] INFO - jetbrains.buildServer.STARTUP - Version file lock was released: /opt/TeamCity/webapps/ROOT/BUILD_37459
[2016-04-03 02:51:36,351] INFO - jetbrains.buildServer.STARTUP - Server shutdown complete

Is there something else I need to set for user teamcity for this to work? As you can read, it starts then suddenly believes it should stop with no error.

1 comment

Hello Peter,

Sorry for delay. If this problem still actual, please attach all zipped /log directory from TeamCity server.

0

Please sign in to leave a comment.