VSTS File Copy Failing

4.3k Views Asked by At

I have a task group that contains a Copy File task. That Copy File task is used in 3 different deployments. Two of which works fine but the third does not and I cannot figure out why.

The Copy File task gives this error

##[debug]testing directory '\\bs05vm3\Bifrost\'
##[debug]task result: Failed
##[error]Unhandled: Unable to create directory '\\bs05vm3\Bifrost\'. Unable to verify 
                    the directory exists: '\\bs05vm3\Bifrost\'. If directory is a file share, 
                    please verify the share name is correct, the share is online, and the 
                    current process has permission to access the share.

##[debug]Processed: ##vso[task.issue type=error;]Unhandled: Unable to create directory 
                    '\\bs05vm3\Bifrost\'. Unable to verify the directory exists: '\\bs05vm3\Bifrost\'. 
                    If directory is a file share, please verify the share name is correct, 
                    the share is online, and the current process has permission to access the share.

##[debug]Processed: ##vso[task.complete result=Failed;]Unhandled: Unable to create directory '\\bs05vm3\Bifrost\'. 
                    Unable to verify the directory 
                    exists: '\\bs05vm3\Bifrost\'. If directory is a file share, please verify 
                    the share name is correct, the share is online, and the current 
                    process has permission to access the share.
##[section]Finishing: Copy Files to: \\bs05vm3\Bifrost\

So the computer name is correct, and I can access the share both from my development PC and the computer that the VSTS agent is running on.

The file share itself \\bs05vm3\Bifrost\, currently, is set so Everyone has access to read and write. Note that this access is only set to the Bifrost folder on bs05vm3.

enter image description here


As requested here are details on the File Copy Task

Task Type: Copy Files
Source Folder: $(System.DefaultWorkingDirectory)/Bifrost-Visual Studio-CI/drop/bin/Release
Contents:
    **
    !**\App.Queues.Config
    !**.pdb
    !**\App.Connections.Config
TargetFolder: \\$(RemoteComputer)\Bifrost\

After this didnt work I tried the suggestion below and used this:

Task Type: Windows File Machine Copy
Source: $(System.DefaultWorkingDirectory)/Bifrost-Visual Studio-CI/drop/bin/Release
Machines:$(RemoteComputer)
Admin Login: $(Username)
Password: $(Password)
Destination Folder: Bifrost
1

There are 1 best solutions below

3
On

I had the same issues in the past and ended up in using the "Windows Machine File Copy" Task for operations like that.

You can provide login credentials in this task. For me it solved my problem, but of course i don't know if this would be solution for you, because you have to write down the login creadentials in this task and everyone who is allowed to edit build definitions is able to see them.

I don't have the "online" verion of build server, we have the, i think it is called, "on-promise" version. Not sure if it would be a difference, but just wanted to clarify.

One hint, i had also issues in creating folders on a network share with the copy process. I ended up in creating the whole folder structure i wanted to have on the share, in the artefacts directory in first place and than copyed the whole structure with all the sub-folders to the network share.