locked
"Access to the path is denied" when using Publish Artifact build step when Contents has additional items in new TFS 2015 vNext build

    Question

  • I keep getting a "Access to the path is denied." error whenever I specify additional items in the Contents setting on the Publish Artifact build step. The error occurs during the UploadArtifact step of the Publish Artifact task.

    Here is my setup:

    • Using Visual Studio build template from TFS 2015 vNext build templates
    • pick appropriate repository path
    • change Contents field of Publish Build Artifacts to add **\*.aspx
    • build account has Administrator rights on the server

    Here is the output:

    ******************************************************************************
    Starting task: Publish Artifact: drop
    ******************************************************************************
    Executing the powershell script: E:\TfsBuildAgent\tasks\PublishBuildArtifacts\1.0.4\PublishBuildArtifacts.ps1
    Preparing artifact content in staging folder E:\TfsBuildAgent\_work\01f07279\artifacts...
    Copying all files from E:\TfsBuildAgent\_work\01f07279\MyStuff\bin to E:\TfsBuildAgent\_work\01f07279\artifacts\drop\bin
    Copying all files from E:\TfsBuildAgent\_work\01f07279\MyStuff\Default.aspx to E:\TfsBuildAgent\_work\01f07279\artifacts\drop\Default.aspx
    
    <cut>
    
    Max Concurrent Uploads 8, Max Creators 2
    Found 37 files to upload.
     
    Start: UploadArtifact
    Access to the path 'E:\TfsBuildAgent\_work\01f07279\artifacts\drop\Default.aspx' is denied.
    End: UploadArtifact
    

    Any ideas?

    Tuesday, September 22, 2015 4:42 PM

All replies

  • Hi Bebo, 

    Thanks for your post.

    What’s the “additional items” mean? The “additional items” belong to another team project?

    On your VSO agent machine, try access this 'E:\TfsBuildAgent\_work\01f07279\artifacts\drop\Default.aspx' file using your VSO agent service account, ensure this file can be found and accessed successfully.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Wednesday, September 23, 2015 5:49 AM
    Moderator
  • The "additional items" means "**\*.aspx" in Contents on the Publish Artifact build step.

    Yes, the file can be found and the service account can access successfully.

    Wednesday, September 23, 2015 2:31 PM
  • It appears that it is failing because the files are read-only. If I turn-off the read-only attribute on the build agent's "artifacts" folder and all children, the Publish Artifact step works.

    Also, when the build is started, it attempts to delete the artifacts folder from the previous build. This fails also when the artifacts folder (or any children) are Read-Only.

    So, the Publish Artifact build step only works on Content that is writable?

    I must be missing something.

    Wednesday, September 23, 2015 2:47 PM
  • Hi Bebo,  

    Thanks for your reply.

    I tested using below settings in my TFS 2015 vNext build, it worked fine and didn’t receive the access denied error. Please check what’s the different in my settings.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Thursday, September 24, 2015 9:04 AM
    Moderator
  • Was that VSO or on-premise TFS? I have to use an on-premise TFS server AND on-premise build server to get the error.
    Thursday, September 24, 2015 1:59 PM
  • Hi Bebo,

    Thanks for your reply.

    Yes, I’m using the On-premise TFS 2015 RTM Server, it’s not VSO.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Friday, September 25, 2015 1:41 AM
    Moderator
  • Hmmm...can you confirm whether the files picked up by the Publish Build Artifacts are read-only or writable before the step runs? It works for me if they are writable.
    Friday, September 25, 2015 2:47 PM
  • Hi Bebo,  

    Thanks for your reply.

    I checked that, the files are both writeable in the “E:\TfsBuildAgent\_work\01f07279\MyStuff” and “E:\TfsBuildAgent\_work\01f07279\artifacts\drop” paths on my VSO build agent machine. I’m using TFS 2015 RTM Server.    


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Monday, September 28, 2015 2:18 AM
    Moderator
  • Thank you for checking! So your files are writable. Mine are read-only. Rest assured I didn't explicitly make them read-only, they were retrieved by the build that way. :-) That is the difference that is causing my issue. Now I need to figure out why yours is writable and mine are read-only.

    May I see your build log file?

    I assumed my files were read-only because that is how they are retrieved from TFVC. I suppose it could be something else.

    By any chance are you using a GIT repository instead of TFVC?

    Also, you said VSO build agent. My build agent is on a local server. Could that be the difference?

    Monday, September 28, 2015 3:22 PM
  • Hi Bebo,

    Thanks for your reply.

    I’m using TFVC, the VSO build agent is installed on my TFS 2015 RTM Server machine by default, when install/configure TFS 2015 RTM Server.

    Please check the below log:

    ******************************************************************************

    Starting: Build

    ******************************************************************************

    Executing the following commandline:

    C:\Starain\1.0_Soft\agent2\agent\worker\vsoWorker.exe  /name:Worker-1a506745-8ad8-4b03-b263-7946ffc6cbf1 /id:1a506745-8ad8-4b03-b263-7946ffc6cbf1 /rootFolder:"C:\Starain\1.0_Soft\agent2" /logger:Forwarding,1.0.0;Verbosity=Verbose,Name=Agent2-120d605397780350badd23e85cfff5a7;JobId=1a506745-8ad8-4b03-b263-7946ffc6cbf1

    ******************************************************************************

    Starting: Get sources

    ******************************************************************************

    Syncing repository: Test-Scrum2015J (TFVC)

    Workspace Name: ws_4aa5ef35_2;Build\97d6656f-a678-4b36-807c-b21e470c56d0

    Done syncing repository Test-Scrum2015J to version C22 (workspace version C15)

    ******************************************************************************

    Running tasks

    ******************************************************************************

    ******************************************************************************

    Starting task: Build solution $/Test-Scrum2015J/FirstWebApplication/FirstWebApplication.sln

    ******************************************************************************

    Executing the powershell script: C:\Starain\1.0_Soft\agent2\tasks\MSBuild\1.0.11\MSBuild.ps1

    C:\Starain\1.0_Soft\agent2\agent\worker\tools\NuGet.exe restore "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln" -NonInteractive

    All packages listed in packages.config are already installed.

    C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln" /nologo /m /nr:false /fl /flp:"logfile=C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln.log" /dl:CentralLogger,"C:\Starain\1.0_Soft\agent2\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"*ForwardingLogger,"C:\Starain\1.0_Soft\agent2\agent\worker\Microsoft.TeamFoundation.DistributedTask.MSBuild.Logger.dll"

    Build started 9/28/2015 10:12:29 AM.

         1>Project "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln" on node 1 (default targets).

         1>ValidateSolutionConfiguration:

             Building solution configuration "Debug|Any CPU".

           The target "BeforeGenerateProjectPriFile" listed in a BeforeTargets attribute at "C:\Program Files (x86)\MSBuild\Microsoft\NuGet\Microsoft.NuGet.targets (156,61)" does not exist in the project, and will be ignored.

         1>Project "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln" (1) is building "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\WebApplication1\WebApplication1.csproj" (2) on node 1 (default targets).

         2>GenerateTargetFrameworkMonikerAttribute:

           Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.

           CoreCompile:

           Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.

           _CopyOutOfDateSourceItemsToOutputDirectory:

           Skipping target "_CopyOutOfDateSourceItemsToOutputDirectory" because all output files are up-to-date with respect to the input files.

           _CopyAppConfigFile:

           Skipping target "_CopyAppConfigFile" because all output files are up-to-date with respect to the input files.

           CopyFilesToOutputDirectory:

             WebApplication1 -> C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\WebApplication1\bin\WebApplication1.dll

         2>Done Building Project "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\WebApplication1\WebApplication1.csproj" (default targets).

         1>Done Building Project "C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\FirstWebApplication.sln" (default targets).

    Build succeeded.

        0 Warning(s)

        0 Error(s)

    Time Elapsed 00:00:00.49

    ******************************************************************************

    Finishing task: MSBuild

    ******************************************************************************

    ******************************************************************************

    Starting task: Publish Artifact: drop

    ******************************************************************************

    Executing the powershell script: C:\Starain\1.0_Soft\agent2\tasks\PublishBuildArtifacts\1.0.4\PublishBuildArtifacts.ps1

    Preparing artifact content in staging folder C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\artifacts...

    Copying all files from C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\packages\EntityFramework.6.1.3\tools\about_EntityFramework.help.txt to C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\artifacts\drop\packages\EntityFramework.6.1.3\tools\about_EntityFramework.help.txt

    Copying all files from C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\Test-Scrum2015J\WebApplication1\obj\Debug\WebApplication1.csproj.FileListAbsolute.txt to C:\Starain\1.0_Soft\agent2\_work\4aa5ef35\artifacts\drop\WebApplication1\obj\Debug\WebApplication1.csproj.FileListAbsolute.txt

    Creating target path \\servername \drop\FirstNB\21...

    \\servername\drop\FirstNB\21

    Copying artifact content to \\servername\drop\FirstNB\21...

     

    Start: AssociateArtifact

    Associated artifact 8 with build 21

    End: AssociateArtifact

     

    ******************************************************************************

    Finishing task: PublishBuildArtifacts

    ******************************************************************************

    Worker Worker-1a506745-8ad8-4b03-b263-7946ffc6cbf1 finished running job 1a506745-8ad8-4b03-b263-7946ffc6cbf1

    ******************************************************************************

    Finishing Build

    ******************************************************************************


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.


    Tuesday, September 29, 2015 2:10 AM
    Moderator
  • I've created a Connect issue for this. At least one other person has commented stating they have the same issue.
    • Proposed as answer by John QiaoModerator Friday, October 2, 2015 4:08 AM
    • Unproposed as answer by Bebo Wednesday, October 7, 2015 6:44 PM
    Thursday, October 1, 2015 1:59 PM
  • Hi Bebo, 

    Thanks for your reply.

    Has this issue been resolved from connect site? It seems I cannot open that connect link now.   


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Friday, October 9, 2015 9:27 AM
    Moderator
  • I had the same problem. Fixed it by changing the build agents workspace location from server to local and deleted the read-only files.
    Thursday, December 10, 2015 1:38 PM
  • There is a comment on the Connect issue stating that it is fixed. I don't know where it is fixed. But somewhere, according to Bryan [MSFT], it is. :-) I assume that On Premises TFS will have to wait until 2015 Update 2 for the fix.

    Monday, December 21, 2015 4:18 PM