TeamCity 5.0 Help

Reporting Issues

If you experience problems running TeamCity and believe it's related to the software, please contact us with detailed description of the issue.

To fix a problem, we may need a wide range of information about your system as well as various logs. The section below explains how to collect such information.

Hangs and Thread Dumps

If you experience problems with the TeamCity server or agent (e.g. no responding or working too slow) we would appreciate a thread dump of the process taken in the moment of the slowness.

Determine what process is slow If there is an issue with the server or build sources checkout issue, you will need a thread dump of the web server process (e.g. Tomcat), if the issue is related only to a single build, you will need an agent thread dump.

Server thread dump

Since TeamCity 5.1 you can take a thread dump of the TeamCity server right from the web UI (if the hanging is local and you can still open administration pages): go to the Administration | Server Configuration | Diagnostics tab and click the View server thread dump link to open the thread dump in a new browser window or Save Thread Dump button to save it to <TeamCity home>/logs directory (where you can later download the files from "Server Logs"). Please note that if you can take a thread dump by other means, that can be preferable since the thread dump taken from UI can lack some diagnostics information.

Agent thread dump

If you need agent thread dump, please note that TeamCity agent consists of two java processes: launcher and agent itself. Agent is run by the launcher process. You will usually be interested in the agent (more nested one) and not the launcher process.

Thread dump taking approaches

To take a thread dump: Under Windows You have several options:

  • if you need server thread dump and the server is run from console, press Ctrl+Break in the console window (this will not work for agent, since it's console belongs to launcher process).

  • if JDK 1.6 is used, use jstack <pid_of_java_process> command (jstack is located in the "bin" directory of JDK installation).

  • you can also use TeamCity-bundled thread dump tool (can be found in agent's plugins). Run the command:

    <TeamCity agent>\plugins\stacktracesPlugin\bin\x86\JetBrains.TeamCity.Injector.exe <pid_of_java_process>

If the hanging process is run as a service, taking the thread dump is more complicated. You can try to run theagent or server process from a console and use one of the aforementioned approaches, or run a thread dumping tool using Microsoft PsExec. Use the following command line to get the dump:

psexec -u <user> -p <password> <full path to the util> <process pid> stacktrace <output file>

where: <user> and <password> – correspond to the same account that was used to run the hanging process as a service. If service uses "System", use "-s" switch instead of -u and -p. <full path to the util> – full path to the thread dumping util <process pid> – the process id of the hanging process <output file> – a full path to a file to save output to (should be accessible for the specified user).

Under Linux

  • run jstack <pid_of_java_process> or kill -3 <pid_of_java_process>. In the latter case output will appear in <TeamCity server home>/logs/catalina.out or <TeamCity agent home>/logs/error.log.

You can also use third-party GUI tool: AdaptJ StackTrace Utility. It supports Windows, Linux or Mac OS X. Choose "Launch" on the page (if you have Java installed). When the application is started, select the process id via "Process > Select", then dump its thread dump with "Process > Thread Dump".

See also Server Performance section below.

OutOfMemory Problems

If you experience problems with TeamCity "eating" too much memory (OutOfMemory errors), please do the following:

  • Determine what process encounters the error (the actual building process, the TeamCity server, or the TeamCity agent)

  • If you use x64 JVM, please consider using 32 bit JVM

  • Try to increase the memory for the process via '-Xmx' JVM option, like -Xmx512m. If the error message is "java.lang.OutOfMemoryError: PermGen space", the following option should be used instead: -XX:MaxPermSize=150m. The option needs to be passed to the process with problems:

  • If increasing memory size does not help, please get the memory dump and send it to us for further analysis. Please reduce the Xmx setting to normal before getting the dump (smaller snapshots are easier to analyze and easier to upload):

    • to get a memory dump (hprof file) when an OoutOfMemory error occurs, add the following JVM option (works for JDK 1.5.0_07+): -XX:+HeapDumpOnOutOfMemoryError

    • when OOM error occurs next time, java_xxx.hprof file will be created in the process startup directory (<TeamCity home>/bin or <TeamCity Agent home>/bin);

    • archive the file and send it to us.

Logging Events

TeamCity (both server and build agents) logs events and warnings using log4j.

The logging rules and log4j configuration files for TeamCity are described in Logs of Internal Events.

Before reproducing the problem it makes sense to enable 'DEBUG' log level for TeamCity classes. To do it, edit the conf/teamcity-server-log4j.xml or conf/teamcity-agent-log4j.xml file by removing all the lines containing

comment. After that, DEBUG messages will go to teamcity-*.log files.

Make sure the logs are rotated by default. When debug is enabled it makes sense to increase maxBackupIndex value in the relevant appender tag to 10 or even 20 files (ensure there is sufficient free disk space available).

You can change the log4J configuration files while the server/agent is running. If it is possible (some log4j restrictions apply), the loggers will be reconfigured without process restart.

Version Control Debug Logging

In general, to debug VCS problems we need information for jetbrains.buildServer.VCS Log4j category. So please enable it in the <TeamCity home>\conf\teamcity-server-log4j.xml and <BuildAgent home>\conf\teamcity-agent-log4j.xml files:

<category name="jetbrains.buildServer.VCS" additivity="false"> <appender-ref ref="ROLL.VCS"/> <appender-ref ref="CONSOLE-ERROR"/> <priority value="DEBUG"/> </category>

The log can then be retrieved at logs/teamcity-vcs.log.

If there are separate logging options for specific version controls, they are described below.

Subversion Integration Debug Logging

First, please enable generic VCS debug logging, as described above.

Uncomment SVN-related parts (SVN.LOG appender and javasvn.output category) of Log4j configuration file on server and on agent (if agent-side checkout is used). The log will be saved to the logs/teamcity-svn.log file. Generic VCS log should be also taken from logs/teamcity-vcs.log

ClearCase

Uncomment Clearcase-related lines in the <TeamCity home>\conf\teamcity-server-log4j.xml file. The log will be saved to logs\teamcity-clearcase.log directory.

Patch Application Problems

In case server-side checkout is used, the "patch" that is passed from server to the agent can be retrieved by:

  • add property agent.save.patch=true to the build configuration properties: Administration->Edit configuration->Properties and requirement variables->Add new property...

  • trigger the build.

Agent log will contain the line "Patch is saved to file ${file.name}" Get the file and provide it with the problem description.

Remote Run Problems

The changes that are sent form the IDE to the server on a remote run can be retrieved from server's .BuildServer\system\changes directory. Locate the <change_number>.changes file that corresponds to your change (you can pick the latest number available or deduce the from the URL of the change form the web UI). The file contains the patch in the binary form. Please provide it with the problem description.

Server Performance

If you experience degraded server performance and TeamCity server process is producing large CPU load, please take the CPU profiling snapshot and send it to us accompanied with the detailed description of what you were doing and what is your system setup. You can take the CPU profiling and memory snapshots by installing the server profiling plugin and following the instructions provided on the plugin page.

Here are some hints to get the best results from CPU profiling:

  • after server startup wait for some time to allow it to "warm up". This can take from 5 to 20 minutes depending on the data volume that TeamCity stores.

  • when CPU usage increase is found on the server, please try to indicate what actions cause the load

  • start CPU profiling and repeat the action several times (5 - 10)

  • capture the snapshot

  • archive the snapshot and send it to us including description of the actions that cause CPU load

Logging in TeamCity Visual Studio plugin

To capture logs from TeamCity Visual Studio plugin please do the following:

  1. Close all instances of Microsoft Visual Studio.

  2. Open <username-profile-folder>\Local Settings\Temp\JetLogs folder.

  3. Delete all of the files in this folder.

  4. Restart Microsoft Visual Studio.

  5. Open a solution.

  6. Try to log in to TeamCity.

  7. Close Microsoft Visual Studio.

  8. Navigate back to the <username-profile-folder>\Local Settings\Temp\JetLogs folder. All of the files that were created are logs.

Logging in TeamCity Eclipse plugin

Available only since TeamCity 4.5

To enable tracing for the plugin, run Eclipse IDE with the -debug <filename> program argument. The <filename> portion of the program argument is a properties file containing key-value pairs. Name of each property corresponds to the plugin module and value is either 'true' (to enable debug) or 'false'. Here is an example of enabling most common tracing options:

jetbrains.teamcity.core/debug = true jetbrains.teamcity.core/debug/communications = false jetbrains.teamcity.core/debug/ui = true jetbrains.teamcity.core/debug/vcs = true jetbrains.teamcity.core/debug/vcs/detail = true jetbrains.teamcity.core/debug/parser = true jetbrains.teamcity.core/debug/platform = true jetbrains.teamcity.core/debug/teamcity = true jetbrains.teamcity.core/perfomance/vcs = true jetbrains.teamcity.core/perfomance/teamcity = true

Read more about Eclipse Debug mode Gathering Information About Your Plug-in and built-in Eclipse help.

Sending Information to the Developers

Files under 5Mb in size can be attached right into the tracker issue (if you do not want the attachments to be publicly accessible, limit viewing the attachment to "teamcity-developers" user group only).

If the file is over 5 Mb, you can upload the archived files via https://uploads.jetbrains.com.

You can also send small files via email: teamcity-feedback@jetbrains.com Please do not forget to mention your TeamCity version and environment

Last modified: 20 April 2023