Error using CC.Net with TFS - InvalidVersionSpecException error

Topics: Developer Forum, User Forum
Oct 16, 2007 at 1:05 AM
I am getting the following error for some of the projects that I have in my solution. It is being build using CC.Net hooked to TFS. The error is reported for some but not all of the projects. If I build the solution manually all is well.
Any ideas?

Thanks
Omid

The error
----------
Microsoft.TeamFoundation.VersionControl.Client.InvalidVersionSpecException: 0 is not a valid changeset number. Please specify a number greater than 0.
at Microsoft.TeamFoundation.VersionControl.Client.ChangesetVersionSpec.ValidateNumber(Int32 changeset)
at Microsoft.TeamFoundation.VersionControl.Client.ChangesetVersionSpec..ctor(Int32 changeset)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Vsts.GetModifications(IIntegrationResult from, IIntegrationResult to) in C:\projects\opensource\ccnet\trunk\source\ccnet\ccnet.vsts.plugin\Vsts.cs:line 160
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
at ThoughtWorks.CruiseControl.Core.Project.Integrate(IntegrationRequest request)
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Integrate()
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Run()
----------

The ccnet.config entry:
<cruisecontrol>
<project name="TFS Libraries">
<!-- Get the encryption provider source-->
<sourcecontrol type="vsts" autoGetSource="true" applyLabel="false">
<project>$/IDC/Source/Libraries</project>
<workingDirectory>d:\Workspaces\BuildWorkspace\Source\libraries</workingDirectory>
<cleanCopy>false</cleanCopy>
<server>http://TFSServer:8080</server>
<username>tfsUser</username>
<password>abcd</password>
<domain>TFSDomain</domain>
<workspace>BuildWorkspace</workspace>
<deleteWorkspace>false</deleteWorkspace>
</sourcecontrol>
<labeller type="defaultlabeller">
<prefix>Automated-Build-</prefix>
<incrementOnFailure>true</incrementOnFailure>
</labeller>
<tasks>
<devenv>
<solutionfile>d:\Workspaces\BuildWorkspace\Source\Components.sln</solutionfile>
<configuration>Debug</configuration>
<buildtype>Build</buildtype>
<project>Libraries</project>
<executable>C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com</executable>
<buildTimeoutSeconds>600</buildTimeoutSeconds>
</devenv>
<buildpublisher>
<sourceDir>d:\Workspaces\BuildWorkspace\Source\libraries\bin\</sourceDir>
<publishDir>d:\TempPublishDir</publishDir>
<useLabelSubDirectory>false</useLabelSubDirectory>
</buildpublisher>
</tasks>
</project>
</cruisecontrol>
Jan 5, 2008 at 4:13 PM
Im experiencing the exact same problem, did you figure out what the problem was ?

2008-01-05 17:12:22,571 ChessBoard:INFO Project: 'ChessBoard' is added to queue: 'ChessBoard' in position 0.
2008-01-05 17:12:22,681 ChessBoard:INFO Project: 'ChessBoard' is first in queue: 'ChessBoard' and shall start integration.
2008-01-05 17:12:22,681 ChessBoard:DEBUG Checking Team Foundation Server for Modifications
2008-01-05 17:12:22,681 ChessBoard:DEBUG From: 05-01-2008 15:50:46 - To: 05-01-2008 17:12:22
2008-01-05 17:12:23,186 ChessBoard:ERROR INTERNAL ERROR: 0 is not a valid changeset number. Please specify a number between 1 and 2147483647.
----------
Microsoft.TeamFoundation.VersionControl.Client.InvalidVersionSpecException: 0 is not a valid changeset number. Please specify a number between 1 and 2147483647.
at Microsoft.TeamFoundation.VersionControl.Client.ChangesetVersionSpec.ValidateNumber(Int32 changeset)
at Microsoft.TeamFoundation.VersionControl.Client.ChangesetVersionSpec..ctor(Int32 changeset)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Vsts.GetModifications(IIntegrationResult from, IIntegrationResult to)
at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)
at ThoughtWorks.CruiseControl.Core.Project.Integrate(IntegrationRequest request)
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Integrate()
at ThoughtWorks.CruiseControl.Core.ProjectIntegrator.Run()

best regards Michael
Jan 5, 2008 at 7:49 PM
Michael,

I had to leave it as I could not find an answer.

good luck
Omid
Feb 28, 2008 at 6:25 PM
I am getting exactly the same error (down to the line number in the stack trace). As with Omid, this occurs on some projects and not on others.

My suspicion is that this may be related to TFS migration. A project that has the issue was migrated from a previous TFS server, and one that does not have the issue was created on this server. The following article applies to 2008 (we're still on TFS 2005), but may be related: http://www.codeplex.com/tfstotfsmigration/WorkItem/View.aspx?WorkItemId=3279

This is a showstopper; any help would be appreciated. TIA!
Feb 29, 2008 at 12:43 AM
I may have found the problem. We're using v1.3.2 of the plugin, and I compiled the source and ran some tests.

The GetModifications method works fine if I don't specify Username/Password/Domain (use my own credentials via Windows authentication). It also works fine with the service login against another TFS project. It fails with the service login against one TFS project. I think it's a rights issue; the only problem is that a confusing error message is generated. I'm checking with our TFS administrator to see if this is the case.
Feb 29, 2008 at 3:53 PM
This was indeed the case. The account we had the CruiseControl service running under did not have rights to that one project (it could log into TFS, and had rights to other projects). Adding the rights fixed the problem.

There is a bug here, though - the error message is very confusing.
Mar 3, 2008 at 10:24 AM
Thanks for the detailed report - will look to force a better error message here.

Cheers,

Martin.
Mar 3, 2008 at 10:27 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.