TeamCity is checking out the wrong VCS revision


We just had our first production release with TeamCity on last Friday after upgrade (TeamCity 6.5 build 17834), and we encounter an issue that TeamCity is not pulling the correct VCS revision for compile.

Basically, it has been setup to pull from:

http://server/subversion/Oasis/branches/release/2011.Aug/projects/RPS (Rev 11587)


However, it actually pulls from the tags folder under the root:

http://server/subversion/Oasis/tags/RPS (Rev 11610)


The following is the TeamCity Task UI, pulling revision (11610):


And the following is TeamCity config for this task, which is pointing to "http://server/subversion/Oasis/branches/release/2011.Aug/projects/RPS"


Comment actions Permalink

Hello Thomas,

   In general, TeamCity should show the revision of the last detected change under the path specified in VCS configuration.

   But if you make a change in VCS root settings, TeamCity uses whole repository revision as a revision of the first build after the change (more preciesly, it uses this revision until first change is detected under the specified path).

   I think, this is probably your case.

   TeamCity builds the correct revision of the sources, but the revision number for the first build after VCS root change will not be equal to the last change number under the specified path.

   We have a corresponding issue for that - please watch/vote:


Comment actions Permalink


I think that may not be the case.

Let me describe the issue more, we have a deploy task which depends on the artifacts from another compile task.
And we found the compile task is not checking out the correct revision when running the compile.

As you can see, the vcs number of that task is trying to checkout 13416. (Even older then the last compile in blue)


However, it is not the correct revision. At the moment we trigger the task, the latest revision is 13504.

We suspect the issue is related to project level properties, as we recently change TeamCity VCS settings to use VCS path like this:


Then we change the project level properties across releases, in this instance, we change from June to July release (i.e. Change %system.Build.Release% from 2011.Jun into 2011.Jul)

We believe as we change the VCS path this way, the compile task did not get an update through commit trigger, and so use the old revision number from last compile as the latest, which is not found in the new VCS path, and so causes the problem.

For now, we try to do a dummy commit to force an update on the revision number to have the VCS checkout the correct revision.

So in this case, I am not sure if your ticket will fix my case, please rise a new ticket if necessary, and I will vote for the ticket too :)

Many thanks,

Comment actions Permalink

As I understand you suspect that TeamCity will use wrong revision if parameter in VCS root changes. Can you reproduce this issue locally?

Comment actions Permalink

Yes, it can be reproduced by following steps:

  1. Setup VCS root with a partial project level properties, in my case:http://it28:8000/subversion/bms/branches/release/%system.Build.Release%
  2. Setup TeamCity compile task with checkout and vcs root as above
  3. Update the project level property of %system.Build.Release% from 2011.Jun to 2011.Jul
  4. Manually kick of a compile

If you need more info please let me know :)

Comment actions Permalink

I see that you are using TeamCity 6.5 (build 17834), I would try to install latest bugfix release 6.5.2 (build 17935) as it contains some related fixes.

Comment actions Permalink


I just updated TeamCity to 6.5.2 and the issue is not resolved.
TeamCity is still checking out the wrong revision until there is a commit check into the vcs root.

Can you please let me know is there a fix coming soon?
We currently deploy our applications in production environment with TeamCity;
As we are in the banking sector, there're very strict audit requirements, if TeamCity is not deploying the proper revision, we may be forced not to use it anymore.
We can not afford to deploy the incorrect version of software.

Kind regards,

Comment actions Permalink

Hello Thomas,

  I tried to reproduce the problem with the latest version of TeamCity - and it works for me as expected.
  I.e. TeamCity always checks out the correct version of sources.

  I created the same configuration as you, a VCS root with a variable, with a value set via project property,
  and I change this property manually after making some changes in the branches. Works as expected -
  latest version is retreived ( I tried checkout on agent mode and I run svn info command to see which
  version is checked out)

  Unfortunately, Pavel is not in the office today and tomorrow, so he cannot answer now.

  Do you have exactly the same behaviour of Teamcity 6.5.2 as with 6.0? Or there are any differences?
  Can you reproduce the problem on a simple configuration and send us exact sequence of steps
  (may be, we do something different)?

  Sorry for the problem,

Comment actions Permalink

We understand that this is a critical issue, and we are trying to reproduce it.
Could you please tell me, do you use this parametrized VCS root in other build configurations? Do you use custom build dialog to trigger "compile" builds?

Comment actions Permalink

Sorry for late reply.
Yes, we have multiple compile tasks under different parametrized VCS root, and all of them experience the same issue.
We usually use VCS checkin trigger, but as I know I have manually updated the parameter, I will manually click the run button (custom build dialog) to triffer compile build, and that would not give me a correct VCS revision number.

Is there any file / log that I can send you can help investigate this issue?



Please sign in to leave a comment.