Exception details

Topics: User Forum
Jan 4, 2007 at 8:25 PM
Hello, I'm a newbie to both CruiseControl.NET and TFS. At this point I'm just trying to get CC to recognize modifications and kickoff a build. I set everything up and got it working correctly using my personal account on the domain. Then I gave rights to a service account on the domain and tried to use it. I get an exception, but I don't know what the problem could be and I don't know how to find out any of the details of the exception. I don't even know if it's a problem with CC.NET or with TFS. For example, here's a snippet from the log using my personal account, which seems to work correctly:

2007-01-04 11:12:18,995 Project 1:DEBUG Checking Team Foundation Server for Modifications
2007-01-04 11:12:18,995 Project 1:DEBUG From: 1/4/2007 11:01:41 AM - To: 1/4/2007 11:12:18 AM
2007-01-04 11:12:19,464 Project 1:DEBUG Found 1 modifications
2007-01-04 11:12:19,464 Project 1:INFO 1 modification detected.
2007-01-04 11:12:19,464 Project 1:INFO Building: IntervalTrigger triggered a build (IfModificationExists)
2007-01-04 11:12:20,652 Project 1:DEBUG Existing workspace detected - reusing
2007-01-04 11:12:20,761 Project 1:DEBUG Getting $/IT - Sandbox/Demo to c:\projects\Demo
2007-01-04 11:12:20,777 Project 1:DEBUG Performing a Get Latest
2007-01-04 11:12:21,105 Project 1:DEBUG Applying label "2007.1.4.1"
2007-01-04 11:12:21,917 Project 1:INFO Integration complete: Unknown - 1/4/2007 11:12:21 AM

Here's a snippet of the same actions but using the service account:

2007-01-04 11:14:22,262 Project 1:DEBUG Checking Team Foundation Server for Modifications
2007-01-04 11:14:22,262 Project 1:DEBUG From: 1/4/2007 11:12:18 AM - To: 1/4/2007 11:14:22 AM
2007-01-04 11:14:22,559 Project 1:DEBUG Found 1 modifications
2007-01-04 11:14:22,559 Project 1:INFO 1 modification detected.
2007-01-04 11:14:22,574 Project 1:INFO Building: IntervalTrigger triggered a build (IfModificationExists)
2007-01-04 11:14:23,762 Project 1:DEBUG Existing workspace detected - reusing
2007-01-04 11:14:23,887 Project 1:INFO Integration complete: Exception - 1/4/2007 11:14:23 AM

Does anyone have any ideas what the problem could be? Thanks!
Jan 5, 2007 at 2:19 PM
Hmm, looks like I might be swallowing an exception that is being raised. Would it be possible to run CruiseControl using the command line (ccnet.exe) from a console rather than the service (ccservice.exe) and see if any more helpful error messages arrive in the console?

However, I'm guessing that it is some form of user permissions problem.

When you say you are using the service account, do you mean the service account on the machine? You need to connect to TFS as a user with enough rights to be able to read (and label) the source control tree - therefore the user that you use to connect to CuiseControl should be in the developers group for the project in TFS. User administration in TFS is a notorious pain so give me a shout if you need help there.

It should be possible to run CruiseControl.net as the service user, but pass a different username in the CruiseControl configuration file (ccnet.config). Take a look at the documentation for an example:- http://confluence.public.thoughtworks.org/display/CCNET/VisualStudioTeamFoundationServer+Plugin

This does however require that the password for the TFS user is stored in the ccnet.config file. Some organisations have a problem with this. In that case you should run the CruiseControl.Net service as a domain user and have that domain user added to the appropriate groups in TFS. If no credentials are specified in the ccnet.config file then it should pick up the crendials of the current thread and talk to TFS with those.

Let me know how you get on.

Jan 5, 2007 at 6:26 PM
Hi Martin,
Thanks so much for the response. I should have clarified that I am running CruiseControl using the command line. The information I printed out is the same information that is returned to the console and stored in the log file.

When I say service account, I mean an account on the domain that is created specifically for the purpose of running a service as opposed to an individual's domain account. This is for the reason you mentioned in your post: I have a problem with storing my unencrypted password in plain text in the ccnet.config file. Therefore, I created this secondary user account and gave it project admin rights in TFS. As far as I can tell this secondary account has the exact same rights as me in TFS and on the machine that is running CruiseControl. It would probably be easy to fix the rights issue if I knew what exactly was causing the exception.

Jan 11, 2007 at 9:43 PM
I modified the source code for CC.NET so I could get the details of the error:

Microsoft.TeamFoundation.VersionControl.Client.LabelOwnerChangeException: TF14077: The owner of a label cannot be changed. ---> System.Web.Services.Protocols.SoapException: TF14077: The owner of a label cannot be changed.

I'm guessing this is a permissions error in TFS? Does anyone know what permissions I need to set for the user that CC.NET is running under?

Jan 12, 2007 at 2:40 PM
D'oh! I just set "applyLabel" to "false" and now it seems to be working.
Jun 9, 2008 at 4:48 PM
Edited Jun 9, 2008 at 7:02 PM
I am trying to use ccnet with vsts, but its disconcerting to see this issue. Why would anyone have to recompile code to see the exception. Would it be a really good idea to show what the exception is or log it in debug mode? I am downloading the source file now...
UPDATE: I figured out what the problem was - my configuration was pointing to a workspace that didnt exist and somehow it didnt know how to recreate it - or something along those lines. I removed the "workspace" tag and it started working. I guess its different for each user but best thing to do is get the source and step through it I guess. Also it would have been nice to report a real error message back from the plugin to cc.net. The problem is not with cc.net, its with bad code in the plugin. But all said and done, if you dont screw up it works. Problem is figuring out how you screwed up!