Octopus 3.17.8 - Robocopy is not working - Powershell scripts fails

satdors's Avatar


08 Nov, 2017 09:37 AM

Hi There,

Recently I have upgraded Octopus to latest 3.17.8 and for some reason, powershell specific process steps are not executing correctly returns with non-0, i had a simple backup step which copies using robocopy files from one location to other. this step does copy most of the files, but failes at the end with exit code1 , there is no clear message anywhere why it is returning exiting with 1. Please help, earlier version it was working perfectly fine

I am using Windows 10- and also i enabled powershell script by opening powershell editor on my machine and set to unrestricted- i did execute many powershell scripts directly without any issue, only through octopus deploy, they are failing , please advise as just taking long to get bottom of this.


  1. Support Staff 1 Posted by Alex Rolley on 09 Nov, 2017 04:17 AM

    Alex Rolley's Avatar


    Thanks for getting in touch! Sorry to hear that you are having issues with your deployments.

    As you are using Windows 10, which is not one our our supported operating systems, I am limited in the amount of support that I am able to give. If possible can you please execute your script against a Server OS that we support and advise if it has the same issue?

    Having said that, are you able to export the raw task log of the task that fails so that I can investigate what might be going wrong? My initial suspicion is that the account that your Octopus Tentacle is running under doesn't have the required permissions to operate correctly, are you able to test this by changing the user that your Tentacle is running as to the account that you have tested your script with externally?

    It's also possible that the error code is not returning correctly when Powershell is executed via Octopus. If you have a read of this post it shows you how to correctly return powershell exit codes in different contexts.

    I hope this helps, please let me know if there is anything else that I can do to assist.


  2. 2 Posted by jack on 11 Dec, 2017 10:18 AM

    jack's Avatar

    nice article

  3. 3 Posted by danny on 06 Feb, 2018 07:11 PM

    danny's Avatar

    Robocopy has many bugs such as it doesn't copy open/locked files..maybe that's why you're facing this issue? Use some other software like GS Rich Copy and see it that makes a difference :)

  4. 4 Posted by steeevveeeelath... on 18 Apr, 2018 10:47 AM

    steeevveeeelathom's Avatar

    The /COPY:T criteria is specifying to only copy file timestamps, so it is not copying the actual data of the file. However, since there are no files on the destination to copy the timestamps to, nothing happens.

    You need to specify at least /COPY:DT so that the file data will be copied, but you can probably just remove the /COPY switch completely as you likely want the file attributes as well, which will get copied by default along with the file data and timestamps.
    I agre with danny gs richcopy 360 is a good tool for backup/file copy/file migration etc.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac