Bill Wang’s Blog

November 23, 2008

TF50309 error message for TFS service account TfsService

Filed under: Uncategorized — Tags: — Bill @ 7:45 am

Today I moved my TFS server from a workgroup to domain environment. When I run ActivateAT to start TFS, everything works fine. When I connect to the TFS from Team Explorer, I get several error logs in Windows event log in the machine for AT saying:

TF50309: The following account does not have sufficient permissions to complete the operation: Domain\tfsservice. Check the permissions for the account and grant the appropriate permissions to perform this operation. (type SecurityException)

Then I run TfsAdminUtil SID and found the TFS service account is not listed. This problem is solved by adding the service account TfsService to Service Accounts group by running TfsSecurity command:
      TfsSecurity g+ “Service Accounts” Domain\TfsService

November 5, 2008

BuildStep task statuses

Filed under: Uncategorized — Tags: — Bill @ 11:33 am

The BuildStep task enables us to add custom build steps to a team build report. This task exposes 3 possible statuses that we can set to:

  • Succeeded
  • Failed
  • Stopped

Plus one more status which is not exposed:

  • InPrograss

The default status of a build steps is InPrograss. If we don’t set the status, the build step status in the result build report will be:

  • Failed if the team build is aborted. When we stop a team build, all build steps with InProgress status will be marked to Failed.
  • InPrograss if the build completes normally.

As we already know, we can open the build report before the build is finished. When the build engine meets a BuildStep task declaration, it will add an item to the “Build steps” section in the team build report. We usually declare a BuildStep task with the default status InPrograss to show the build engine is performing a set of tasks, then we set the status of the BuildStep when our tasks are finished.

The following example demonstrate how to organize build step declaration and evaluation. The example overrides AfterDropBuild target to run some tasks there. If no error occurs, the status for the build step will be set to Succeeded. If there’s an error encountered in AfterDropBuild target, HandleMyBuildStepFailed target will be executed.

<Target Name=“AfterDropBuild”>
<BuildStep TeamFoundationServerUrl=“$(TeamFoundationServerUrl)”
BuildUri=“$(BuildUri)” Name=“MyBuildStep”
Message=“My build step is executing.”>
<Output TaskParameter=“Id” PropertyName=“MyBuildStepId” />
<!–Add tasks here–>
<BuildStep TeamFoundationServerUrl=“$(TeamFoundationServerUrl)”
BuildUri=“$(BuildUri)” Id=“$(MyBuildStepId)” Status=“Succeeded” />
<OnError ExecuteTargets=“HandleMyBuildStepFailed”/>
<Target Name=“HandleMyBuildStepFailed”>
<BuildStep TeamFoundationServerUrl=“$(TeamFoundationServerUrl)”
BuildUri=“$(BuildUri)” Id=“$(MyBuildStepId)” Status=“Failed” />

What I have missed? Oh, the Stopped status. If the status of BuildStep task is set to Stopped, the whole team build will be stopped. Thus we rarely use this status.

November 1, 2008

Troubleshooting TFS alerts

Filed under: Uncategorized — Tags: — Bill @ 12:24 pm

The Event Service in TFS supports many kinds of events. Users can subscribe them to be get alerts when a particular event is trigged. TFS supports alert by sending a email or calling a web service. When you can’t receive email alerts, please check the following things:

SMTP server is working
TFS relies on an SMTP server to send out email. So, the first thing is to make sure the SMTP server is working.

If you can login the SMTP server, please read How to test outbound mail flow with a file in the Pickup folder. If the SMTP server is OK, please check the server that hosts TFS is authorized to access SMTP service. And this is described in How to Assign an IP Address section in KB 308161.

If you can’t login the SMTP server, you can write a simple code to send a mail. See Pete Sheill’s blog for more information.

TFS is configured to use a SMTP server
See MSDN document How to: Configure SMTP Server and E-mail Notification Settings in the Services Web.Config File

The alert is not blocked by recipient’s mailbox
If you configured mail policy to block mails from unknown user, you will need to add the “From Address” of alert into the trusted list.

After you checked all of above items, please subscribe to an event without any filter. You should be able to receive alerts when the event is triggered.

Blog at