Subversion checkout is not working properly

We have build  6.0.2 (build 15857)  of Teamcity.     I have a build project setup to pull from a branch called currentreleasebranch.

The Version Control settings are valid and have basically the following.

+:onlife/branches/currentreleasebranch/LPS.WebControls => LPS.WebControls
+:onlife/branches/currentreleasebranch/Onlife.LinqToSql => Onlife.LinqToSql
+:onlife/branches/currentreleasebranch/Onlife.Web => Onlife.Web
+:onlife/branches/currentreleasebranch/Onlife.Core => Onlife.Core
+:onlife/branches/currentreleasebranch/Onlife.Reports => Onlife.Reports
+:onlife/branches/currentreleasebranch/Onlife.Settings => Onlife.Settings
+:onlife/branches/currentreleasebranch/Onlife.Security => Onlife.Security
+:onlife/branches/currentreleasebranch/Onlife.Search => Onlife.Search
+:onlife/branches/currentreleasebranch/Onlife.SNConnector => Onlife.SNConnector
+:onlife/branches/currentreleasebranch/OnLife.BusinessObjects => OnLife.BusinessObjects
+:onlife/branches/currentreleasebranch/LPS.WebSite => LPS.WebSite
+:onlife/branches/currentreleasebranch/references => references

When this project is done running,  I consistently have my trunk code checked out instead.

onlife/trunk/LPS.WebControls => LPS.WebControls
onlife/trunk/Onlife.LinqToSql => Onlife.LinqToSql
onlife/trunk/Onlife.Web => Onlife.Web
onlife/trunk/Onlife.Core => Onlife.Core
onlife/trunk/Onlife.Reports => Onlife.Reports
onlife/trunk/Onlife.Settings => Onlife.Settings
onlife/trunk/Onlife.Security => Onlife.Security
onlife/btrunk/Onlife.Search => Onlife.Search
onlife/trunk/Onlife.SNConnector => Onlife.SNConnector
onlife/trunk/OnLife.BusinessObjects => OnLife.BusinessObjects
onlife/trunk/LPS.WebSite => LPS.WebSite
onlife/trunk/references => references


how is this possible?   I have saved the version control settings over and over and no change

The build log even shows the following.   How is this possible?   Is something cached?

[15:54:55]: Checkout directory: E:\BuildAgent\work\LPS1
[15:54:55]: Updating sources: agent side checkout... (50s)
[15:54:55]: [Updating sources: agent side checkout...] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\references
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Web
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Settings
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Security
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Search
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.SNConnector
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Reports
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.LinqToSql
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\Onlife.Core
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\OnLife.BusinessObjects
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\LPS.WebSite
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\LPS.WebControls
[15:54:55]: [Updating sources: agent side checkout...] Cleaning E:\BuildAgent\work\LPS1\build
[15:54:55]: [Updating sources: agent side checkout...] VCS Root: OnLife branch Source (49s)
[15:54:55]: [VCS Root: OnLife branch Source] checkout rules: onlife/branches/currentreleasebranch/references=>references; onlife/branches/currentreleasebranch/Onlife.Web=>Onlife.Web; onlife/branches/currentreleasebranch/Onlife.Settings=>Onlife.Settings; onlife/branches/currentreleasebranch/Onlife.Security=>Onlife.Security; onlife/branches/currentreleasebranch/Onlife.Search=>Onlife.Search; onlife/branches/currentreleasebranch/Onlife.SNConnector=>Onlife.SNConnector; onlife/branches/currentreleasebranch/Onlife.Reports=>Onlife.Reports; onlife/branches/currentreleasebranch/Onlife.LinqToSql=>Onlife.LinqToSql; onlife/branches/currentreleasebranch/Onlife.Core=>Onlife.Core; onlife/branches/currentreleasebranch/OnLife.BusinessObjects=>OnLife.BusinessObjects; onlife/branches/currentreleasebranch/LPS.WebSite=>LPS.WebSite; onlife/branches/currentreleasebranch/LPS.WebControls=>LPS.WebControls; revision: 18900_2011/05/09 16:39:36 -0500
[15:55:44]: [Updating sources: agent side checkout...] VCS Root: Build Code
14 comments
Comment actions Permalink

To get past this I had to recreate VCS roots that had the exact same config settings and checkout patterns.

0
Comment actions Permalink

Hello Lance,

  Have you tried "Enforce clean checkout" option in the build configuration?

  Regards,
  KIR

0
Comment actions Permalink

Hi Kiril,  yes I had that set.   the only thing I could think of is that the VCS configuration data stored and retrieved during the build did not reflect what I saw in Teamcity.   Is it possible the VCS configuration element was crossed up with another?  

When I create new build projects, I will frequently copy from another similar build and this would include the vcs root.  I would then go in and change the vcs information to pull down a different set of code.

0
Comment actions Permalink

Hello Lance,

   The problem is rather strange and it doesn't reproduce on our side.
   May be, you have some specifics we don't follow.

   Is there a repeatable scenario which reproduces the problem on your side?
   Also, there already've been some changes in SVN support in TeamCity 6.5, which was recently released.
  If you could try the newer version of TeamCity and see would this help in your case, it would be great.

  Thanks!
  KIR

0
Comment actions Permalink

I am still having this issue.   During our branching when we switch from using our trunk builds to branch builds I noticed that the branch builds will sometimes still contain trunk code.  I am not certain why.  The version control settings between a trunk build and branch build were copies at one point.  Then the branch version control settings changed to reflect the branch source but we still get the trunk.  I am not sure why but it does cause some big problems if you are not building the proper code.

I have attached screen shots of the two example builds (one trunk and one branch) and showing the different vcs settings even though they copy on top of the same folder (with full clean).
Even after the branch build I still have trunk code in the folder like TEamcity used some other setting and not what I specifically provided.


also from the buildlogs notice that it is pulling an older revision.






[11:35:14]: Skip checking for changes - changes are already collected

[11:35:14]: Clean build enabled: removing old files from E:\dbbuild\OnlifeEntity

[11:35:26]: Clearing temporary directory: E:\BuildAgent\temp\buildTmp

[11:35:26]: Checkout directory: E:\dbbuild\OnlifeEntity

[11:35:26]: Updating sources: agent side checkout... (39s)

[11:35:26]: [Updating sources: agent side checkout...] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist

[11:35:26]: [Updating sources: agent side checkout...] Cleaning E:\dbbuild\OnlifeEntity\build

[11:35:26]: [Updating sources: agent side checkout...] Cleaning E:\dbbuild\OnlifeEntity

[11:35:26]: [Updating sources: agent side checkout...] VCS Root: OnlifeEntity Branch DB Source (36s)

[11:35:26]: [VCS Root: OnlifeEntity Branch DB Source] checkout rules: db/branches/currentreleasebranch/OnlifeEntity=>; revision: 20252_2011/06/20 11:52:54 -0500

[11:35:26]: [VCS Root: OnlifeEntity Branch DB Source] Will use fast SVN update

[11:36:02]: [Updating sources: agent side checkout...] VCS Root: Build Code (3s)

[11:36:02]: [VCS Root: Build Code] checkout rules: build=>build; revision: 16073_2011/09/06 11:19:02 -0500

[11:36:02]: [VCS Root: Build Code] Will use fast SVN update

[11:36:05]: Publishing internal artifacts (2s)

[11:36:07]: [Publishing internal artifacts] Sending build.start.properties file

[11:36:05]: Starting: C:\nant-0.85\bin\NAnt.exe -buildfile:E:\dbbuild\OnlifeEntity\build\db.build -extension:C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers.dll -listener:JetBrains.BuildServer.NAntLoggers.NAntListener "-D:sql.database=OnlifeEntity" "-D:build.scriptdir=E:\dbbuild\OnlifeEntity" "-D:build.version=1.14.00.057" "-D:svn.DBrepositoryUrl=svn://tnw2s-subver/onlife/db/branches/onlife-1.08/OnlifeEntity" "-D:sql.user=app_AutomatedBuild" "-D:sql.password=$dsfdsfdsdfc" "-D:application=Onlife" "-D:sql.server=TNW2S-BUILD01" "-D:sqlcmd.path=E:\Microsoft SQL Server\100\Tools\Binn" checkin

[11:36:05]: in directory: E:\dbbuild\OnlifeEntity

[11:36:06]: Buildfile: file:///E:/dbbuild/OnlifeEntity/build/db.build

[11:36:06]: Target framework: Microsoft .NET Framework 2.0

Here is one that works (similar setup in terms of being a db project pulling from the currentreleasebranch




[12:33:25]: Skip checking for changes - changes are already collected

[12:33:26]: Clean build enabled: removing old files from E:\dbbuild\CDR

[12:33:33]: Clearing temporary directory: E:\BuildAgent\temp\buildTmp

[12:33:33]: Checkout directory: E:\dbbuild\CDR

[12:33:33]: Updating sources: agent side checkout... (44s)

[12:33:33]: [Updating sources: agent side checkout...] Will perform clean checkout. Reason: Checkout directory is empty or doesn't exist

[12:33:33]: [Updating sources: agent side checkout...] Cleaning E:\dbbuild\CDR\build

[12:33:33]: [Updating sources: agent side checkout...] Cleaning E:\dbbuild\CDR

[12:33:33]: [Updating sources: agent side checkout...] VCS Root: CDR DB branch (43s)

[12:33:33]: [VCS Root: CDR DB branch] checkout rules: db/branches/currentreleasebranch/CDR=>; revision: 22499_2011/09/07 11:33:13 -0500

[12:33:33]: [VCS Root: CDR DB branch] Will use fast SVN update

[12:34:17]: [Updating sources: agent side checkout...] VCS Root: Build Code (1s)

[12:34:17]: [VCS Root: Build Code] checkout rules: build=>build; revision: 16073_2011/09/06 11:19:02 -0500

[12:34:17]: [VCS Root: Build Code] Will use fast SVN update

[12:34:18]: Publishing internal artifacts (4s)

 

 
So my guess is when the bad vcs configuration tries to pull down the incorrect revision db/branches/currentreleasebranch/OnlifeEntity=>; revision: 20252_2011/06/20
instead of the tip as is configured in the vcs setting, and that url is not valid, it does not throw the error and uses the trunk that was already there?

This cant happen.  We can not have this scenario.

Is there something we need to do?



Attachment(s):
vcssettingsforbranch.docx
0
Comment actions Permalink

Hi,  I think the following is a way to reproduce but not sure.

Assuming the 2 svn paths below

svn://subversion/svn/repo1/trunk

and

svn://subversion/svn/repo1/branches/currentreleasebranch

Also assuming that currentreleasebranch is a branch of trunk at some point


Create copy from a trunk build project which includes trunk vcs /trunk checkout rules and make this the branch build project
Change the name of the branch vcs and checkout rules to use the branch  (svn://subversion/svn/repo1 is the URL and branches/curretreleasebranch points to the branch code)
now make a few changes on your trunk source so you can make sure you get the latest revision
now take the currentreleasebranch and rename it to currentreleasebranch_old and then rebranch trunk to svn://subversion/svn/repo1/branches/currentreleasebranch
perform the trunk and branch build above and look at the actual source and which revision was pulled down.

Somewhere the repository revision is stored and remembers this when pulling down the new currentreleaebranch and not the tip of the new currentreleasebranch.

hope that helps.

Its very difficult when it does not pull down the code you expect.

Lance

0
Comment actions Permalink

Hello Lance,

  From your description, I think you've faced an issue http://youtrack.jetbrains.net/issue/TW-14153
  Please, vote/watch this issue.

  Sorry for the problem,
  KIR

0
Comment actions Permalink

Hello Lance,

   I've just tried your scenario with TeamCity 6.5.3 - and it works as expected.

   I've verified the correctness of the checked out sources with 'svn info' command in the checked out working directory. Also, I've verified that correct SVN revision is shown on the 'Changes' tab of the build.

   My sequence of actions was:

    <in trunk directory>
    svn copy . svn://localhost/project/branches/current
    change-commit
    change-commit
    svn move   svn://localhost/project/branches/current svn://localhost/project/branches/current.old

    svn copy . svn://localhost/project/branches/current


    create builds for trunk and for branches/current

    TeamCity detects changes related to copy operations and uses correct revisions.

    If the problem persists, I'd appreciate if you provide VCS debug logs (debug-vcs) for TeamCity for a sample configurations.

    Thank you,
    KIR
0
Comment actions Permalink

Hi Kirill,  We are going to be branching soon again.  I want to avoid this problem.    Where are the details of each vcs configuration stored.  I am assuming in some table as part of the teamcity database?

Perhaps I can review this and see what it looks like before branching.

0
Comment actions Permalink

I also noticed by looking at table vcs_settings_hash and noticed for the build type that I showed above (that was pulling down a revision and not the tip of a vcs source) has this data in the table for that build

  SELECT * FROM dbo.vcs_settings_hash WHERE build_type_id='bt155'

returns

vcs_root_id    build_type_id    settings_hash    vcs_revision
2356    bt155    -4482272600148879909    15571_2011/02/15 21:32:56 -0600
6793    bt155    -444335356597663613    20252_2011/06/20 11:45:57 -0500

The VCS_revision exactly matches the problem we were having.

Could there be a scenario where Teamcity decided to pull down that revision instead of the tip of the defined vcs source (which was our branch) in this scenario.

0
Comment actions Permalink

Hello Lance,

  Sorry for delay with the answer, I was on vacation the last week.

  How did the branching go? Was there any problems? Did you collect the VCS debug logs after the branching?

  Kind regards,
  KIR

0
Comment actions Permalink

Hi Kiril,  We have not done the branching yet.  How do I get the VCS debug logs?

Has anybody looked at the code to see if there is a situation where the revision identified in the database is pulled down instead of the tip of the branch?  Like if an error condition happens or something.

The documentation above is pretty clear how it made and error.

0
Comment actions Permalink

Hello Lance,

  Have you upgraded to TeamCity 6.5.4? Please do, as I said before, I couldn't reproduce the problem on this version -
  and it is likely to be fixed there already.

  The instructions for enabling debug logs are available here: http://confluence.jetbrains.net/display/TCD65/TeamCity+Server+Logs

  Regards,
  KIR

0
Comment actions Permalink

Hello Lance,

  Are there any news regarding the issue?

  Regards,
  KIR

0

Please sign in to leave a comment.