Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Unable to clean workspace directory after publishing artifact #37

orgas002 ·


My issue is that my build is unable to clean the workspace directory after the build is done running and after it published the artifacts. It comes out to the error of:

Failed to delete file 'C:\qba\workspace\blah\blah2\blah3\packages\Wix\3.11\candle.exe'.

Keep in mind, the checkout, build, publishing of two artifacts worked, just not the post-execute of clean workspace of current node.

Any help would be great.

  • solved #2
  • replies 1
  • views 1074
  • stars 0
robinshen ADMIN ·

Looks like that the file is still being used by some other processes for some reason. You may print the process using the file with below below step:

  1. Download handle.exe and put to the node running the step:
  2. Modify the post-execute action of the step to execute below script:
try {
} catch (Exception e) {
  if (e.getMessage().startsWith("Failed to delete file '")) {
    def filePath = e.getMessage().substring("Failed to delete file '".length());
    filePath = filePath.substring(0, filePath.length() - 2);"Detecting processes using: " + filePath);
    def sout = new StringBuilder(), serr = new StringBuilder()
    def proc = 'ls /badDir'.execute()
    proc.consumeProcessOutput(sout, serr)
    proc.waitForOrKill(10000)"out: $sout,  err: $serr");