copy file with Window Machine File Copy failed with 'the network connection was aborted by the local system'

0

I use window machine file copy task at DevOps to copy files from remote PC A to remote PC B. This task will use robocopy as a tool to run the copy process.

However, when it start copying, it will stuck at there quite a long time although the file only 20MB and give this error ERROR 1236 (0x000004D4) and 'the network connection was aborted by the local system'.

Does anyone knows the reason on this error?

azure-devops
remote-server
file-transfer
asked on Stack Overflow Feb 3, 2021 by yancy

1 Answer

0

I test Windows machine file copy task with self-hosted agent, it works well.

enter image description here

You can check whether you can access the target machine in the network. For example: Open a folder on PC A, and enter the ip and folder of the target machine as shown in the figure below. If it can be accessed, it means that PC B does not prohibit the connection of PC A.

enter image description here

In addition, you can try to use WinRm File Copy task, the task also provides the ability to copy files to Windows Machines. The tasks uses WinRM for the data transfer.

This task defers from the original task that ships with VSTS/TFS by the fact that this implementation uses WinRM for the file transfer instead of robocopy on which the original task is based on. In certain situations, due to the network restrictions, mounting the drive and using the necessary protocols is not possible. Thus, for such scenarios, where WinRM is enabled, this task will solve the issue.

The only requirement is PowerShell V5 installed both on the build server and on the machine on which you are trying to copy the files to.

answered on Stack Overflow Feb 4, 2021 by Hugh Lin - MSFT

User contributions licensed under CC BY-SA 3.0