Common Problems

Last modified: 20 April 2023

Build fails in TeamCity but not locally



If the build fails in TeamCity but you believe it should not, please:

  • check that the build runs fine on the same machine as TeamCity agent and under the same user that the agent is running and with the same environment variables

  • if TeamCity build agent is installed as a Windows service, try running TeamCity agent Setting up and Running Additional Build Agents.

If this fixes the issue, you can try to figure out why running under the service is a problem for the build. Most often this is service-specific and does not relate to TeamCity directly. Also, you can setup TeamCity agent to be run from console all the time (e.g. configure automatic user logon and run the agent on user logon).

If the issue with the build still persists, please:

  • stop TeamCity agent (or disable it from TeamCity web UI) right after the build that failed so that no other builds are run;

  • log on to the machine using the same user as TeamCity agent runs under;

  • open command prompt and switch to the checkout directory of the build in question (the directory can be seen in the beginning of the build log);

  • run the build from console as you would do on a developer machine. This is runner-dependent. For some build runners the command is logged in the build log;

If the build succeeds or there is no way to run the build from console without TeamCity you can find the command that TeamCity used to launch the build in logs\teamcity-agent.log agent log file.

If the build fails then the issue is probably not TeamCity specific and should be investigated on the machine.

If the build succeeds from console but still fails in TeamCity, please create a new issue in our tracker detailing the case. Please attach the build log, all agent logs covering the build, the command you used in console to run the build and the full console output of the build.

Agent does not upgrade with "Agent has unregistered (will upgrade)"



This means the agent is downloading the new agent version and should become connected shortly. The time necessary to upgrade mostly depends on the network link between the agent and the server. After downloading the files upgrade can take 1-3 minutes.

If the agent stays in the state for more then 10 minutes and you have fast network connection between the agent and the server, please look into Viewing Build Agent Logs. If you cannot find the cause of the delayed agent upgrade in the logs, contact us and attach the agent logs and the server logs.

Artifacts of a build are not cleaned



If you encounter a case when artifacts of a build are not cleaned, please check:

  • the cleanup rules of the build configuration in question, artifacts cleanup section

  • presence of the icon "This build is used by other builds" in the build history line (prior to Pin action/icon on Build History)

  • build's Dependencies tab, "Delivered Artifacts" section. For every using build configuration, check whether "Prevent dependency artifacts clean-up" is turned ON (this is default value). If it does, then the build's artifacts are not cleaned because of the setting. Read more on Clean-Up.