9

Team,

Its frustrating so far today with TFS 2012, I have been queuing a build and the build server is unable to copy/drop to the specified folder. I have installed TFS 2012 on Win Server 2008 R2. Basically the error says that the access to the destination folder is denied and so it is not able to copy. The TFS admin console shows the build service is running as LocalService. And I granted full control to the local Service account to the drop folder. I tried to even fiddle with Share tab in the properties of the folder. There is no network as such any way, only single machine with all the TFS services running on it. I even tried to put the drop folder on C drive itself without any success. Can some one please throw some light? What am I missing? Seems to be some thing trivial.

The following is the exception details.

Exception Message: TF270016: An error occurred publishing log files from 'C:\Builds\1\Tfs_TeamProjectTrail\Tfs_Trial1_CI\Sources\Main\Tfs_Trial1\Tfs_Trial1.log' to '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs'. Details: Access to the path '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs' is denied. (type PublishLogFileException) Exception Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Inner Exception Details:

Exception Message: Access to the path '\localhost\d$\VD\Tfs_Trial1_CI\Tfs_Trial1_CI_20130309.21\logs' is denied. (type UnauthorizedAccessException) Exception Stack Trace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost) at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost) at Microsoft.TeamFoundation.Common.FileSpec.CopyFile(String oldPath, String newPath, Boolean overwriteExisting) at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory) at Microsoft.TeamFoundation.Build.Workflow.Activities.WindowsDropProvider.CopyDirectory(String sourceDirectory, String targetDirectory, String[] renameIfExists) at Microsoft.TeamFoundation.Build.Workflow.Activities.PublishLogFile.Execute(CodeActivityContext context)

VivekDev
  • 20,868
  • 27
  • 132
  • 202

4 Answers4

11

This is just a permissions issue.

  • Start by running the build service as a local user / domain user (if applicable) and get that to work.
  • Create a proper share rather than using the default admin shares (d$)
  • Make sure that both sharing and security tab on the folder properties allow write permissions to that user.
  • The error log says "\localhost" the correct way to access this would be "\\localhost" (this could me a stackoverflow editor issue though and not relevant)

I don't currently have time to write a complete answer, but I can expand later.

ProcMon is also a great program to use when troubleshooting this kind of thing.

I think this is a good starting point.

gregpakes
  • 4,465
  • 29
  • 43
  • 1
    Thanks it worked. Its actually very simple. Briefly, right click any folder, then go to Share tab, Advanced and then share check box. What I was missing is the path. It should be \\YourServerName\YourShareFoldreName. But what I was doing was instead was \\YourServerName\d$\YourShareFoldreName. The d$ was the mistake I was doing in an attempt to provide the full path. – VivekDev Apr 06 '13 at 07:06
3

Simply make sure Drop directory and Build service have full privilegies for "Local service" group.

2

Default account with which tfs build service is run is nt authority\network service. After compiling solution\project, it is this user which tries to copy bits to the build share.

So add permissions to this account on your build share.

Fabio Antunes
  • 22,251
  • 15
  • 81
  • 96
0

[TFS2013] I had this error when I turned off the drop folder option, and removed the path. By specifying a drop folder again (UNC) for the output files in the build configuration solved the problem.

It seems TFS is twitchy if you don't have a drop folder at all, even though it gives you the option to not have one.

GilesDMiddleton
  • 2,279
  • 22
  • 31