Server - Azure Pipelines
account name: vehnet
team project: Vos5MobileAndroid
release pipeline: Deploy VOS5 Mobile API
Agent - Default VS 2017 hosted queue
As the subject in the issue, Windows File Copy is consistently failing by seemingly trying to copy to a UNC path \\some-network-path instead of trying to access either a public ip address or FQDN
I have been able to reproduce this issue with v1 and v2 of the task.
I have also found 2 recent cases reported in the developer community.
With the exact same error and screenshots that match the logs that I'm providing below.
The reporters for both posts are still claiming that the issues are to be fixed and expecting a response.
However, it seems that they have both been closing due to some misunderstandings?
thanks for your help,
Jaume
Note that I have hidden my ip address in the following logs
2018-10-09T21:32:28.2113080Z ##[debug]machine share= \[IP_ADDRESS_HIDDEN]
2018-10-09T21:32:28.2131203Z ##[debug]destination network path= \[IP_ADDRESS_HIDDEN]\c$\DeploymentArtifacts
2018-10-09T21:32:28.2188611Z ##[debug]Creating path to directory: \[IP_ADDRESS_HIDDEN]\c$\DeploymentArtifacts
2018-10-09T21:32:54.5276034Z ##[debug]Caught exception: The network path was not found.Exception.Message
2018-10-09T21:32:54.5304556Z ##[debug]Check if parent path exists: \[IP_ADDRESS_HIDDEN]\c$
2018-10-09T21:32:54.5352076Z ##[debug]Caught exception: The network path was not found.Exception.Message
2018-10-09T21:32:54.5400363Z ##[debug]Check if root path exists: \[IP_ADDRESS_HIDDEN]
2018-10-09T21:32:54.5433025Z ##[debug]Caught exception: The network path was not found.Exception.Message
2018-10-09T21:32:54.5457355Z ##[debug]Check if parent path exists:
2018-10-09T21:32:54.5803550Z ##[error]Failed to Create PSDrive with Destination: '\[IP_ADDRESS_HIDDEN]\c$\DeploymentArtifacts', ErrorMessage: 'The network path was not found'
2018-10-09T21:32:54.5812848Z ##[debug]Processed: ##vso[task.logissue code=WFC_FailedToCreatePSDrive;type=error]Failed to Create PSDrive with Destination: '\[IP_ADDRESS_HIDDEN]\c$\DeploymentArtifacts', ErrorMessage: 'The network path was not found'
2018-10-09T21:32:54.9867245Z ##[debug]System.ComponentModel.Win32Exception (0x80004005): The network path was not found
2018-10-09T21:32:55.0216612Z ##[debug]Leaving D:a_tasks\WindowsMachineFileCopy_731004d4-1d66-4f70-8c05-638018b22210\2.1.4\WindowsMachineFileCopy.ps1.
2018-10-09T21:32:55.0696408Z ##[debug]Caught exception from task script.
@jsancho
Apologize for the delay in response.
I have tried to copy to a UNC path using IP and machine name both have worked fine.

Please make sure UNC path is accessible from machine and user that you have specified in the task input.
@jsancho
Closing assuming you are unblocked on this. Please feel free to reopen in case you are still facing this issue.
Hi @Ajay-MS, apologies for the delay.
I did unblock myself by hosting the target VM in Azure (as opposed to our network) and using the Azure file copy instead.
I'd guess that the bug is still there even if it's not affecting me directly any longer.
The issue is with copying from agent to an external machine by ip address or FQDN, as reported by me here and the 2 other users in the dev community.
The example that you are providing uses a UNC path instead.
So I wouldn't necessarily conclude that this issue cannot be reproduced.
@jsancho
It would be great if you can show me this issue, I would be interested in knowing the root cause of this issue as I am not able to repro this.
If you still have the repro of this issue please share your email id we can have a call to look into this.
Hi @Ajay-MS
Sorry but the VM that we were using for this got destroyed as we moved it all to Azure ARM and switched to Azure File Copy instead. (I'd rather not fiddle the current configuration as I could break our deployment pipelines and that would cause disruption)
Nevertheless, it should be reasonably easy for you to reproduce and produce a log for the issue if you setup the file copy to use an ip address as target.
If you setup the "System.Debug" environment variable to true in the Azure devops job, you should be able to see how the \\ are prepended to the ip address during execution of the internal ps1 script.
Hope that helps,
Jaume
The problem is still there in the latest Az Pipeline and here's my yaml snippet:
- task: WindowsMachineFileCopy@2
inputs:
SourcePath: '$(Pipeline.Workspace)/WebPortal'
MachineNames: '$(StagingHost)'
AdminUserName: '$(StagingHost.Username)'
AdminPassword: '$(StagingHost.AdminPassword)'
TargetPath: 'WebPortal'
CleanTargetBeforeCopy: true
displayName: 'Deploy to $(StagingHost)'
Here the StagingHost is an IP address. You can easily reproduce the issue. Can you reopen the issue, @Ajay-MS ?
Most helpful comment
The problem is still there in the latest Az Pipeline and here's my yaml snippet:
Here the
StagingHostis an IP address. You can easily reproduce the issue. Can you reopen the issue, @Ajay-MS ?