Issue with FB copy action - xcopy.exe returned 5

Hello,

We’re having an intermittent issue with a finalbuilder copy action which fails to copy files from our build agent to a network drive.

The copy action copies a large directory of png files, and then fails when copying the last image across with the following message:

The program issued a command but the command length is incorrect.
Action Failed
C:\WINDOWS\system32\xcopy.exe returned : 5

This usually happens twice but then succeeds on the 3rd attempt at running the build.

Can you offer any advice as to what might be causing the issue? We thought perhaps this was just an issue with the network connection, but the odd thing is that it always fails on the same file (the last png file in the images directory we are trying to copy), which suggested to us that it was something other than a network issue. The directory contains over 4000 images, so perhaps it’s struggling there.

Any suggestions welcome!

Regards,
Luke

Hi Luke,

xcopy reporting an error of level 5 means that there was a writing error. It seems that it will report this at the end of attempting to copy all files.

https://technet.microsoft.com/en-au/library/bb491035.aspx

I would suggest running a checksum over all the files to make sure they are correctly copied.

Hi Jason,

Thanks for your suggestion. I’m not at all familiar with running checksums, is there an easy way to do this via fb?

Regards,
Luke

There is the Calculate File MD5 action. This action will generate an MD5 checksum for a single file. You will need to use a File Iterator to iterate over the original files, calculate the MD5 then calculate the MD5 for the destination file. If they are different I would log that and report all differences at the end.

Another option is to turn on the “Verify files after copy” in the options tab of the xcopy action. I am not clear as to the method it uses to verify the files however xcopy help does state “Verifies each file as it is written to the destination file to make sure that the destination files are identical to the source files.”