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, with the same environment variables and same working directory.
- if TeamCity build agent is installed as a Windows service, try running TeamCity agent via console.
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 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 cleanup settings.
"out of memory" error with internal (HSQLDB) database
If while TeamCity server statup you encounter errors like:
"error in script file line: ... out of memory"
"java.sql.SQLException: out of memory"
Try increasing server memory.
If this does not help, most probably this means that you have encountered internal database corruption.