Fails to deploy same package in different steps

Applies to Octopus 0.9.600.163 (beta).

This issue may be resolved by the “Support same package in two feeds” card in trello, but I thought I’d report another use case we ran into.

In order to deploy our website to machines in different phases, we configured our project in Octopus to deploy the same package in 3 steps. When we try to deploy to our test environment, we only have one test server so we configured Octopus to deploy the package in the first step.

However, it seems that Octopus sees the package in 3 steps and concludes it needs to fire off three upload tasks to the same machine. This results in multiple threads on the tentacle trying to download the package to the same destination, and two of the three uploads fail since which ever one wins the race gains exclusive access to the file.

We see this error in the output log:

 Download package foobar.com from NuGet server: \\build01\Projects\NugetPackages
  2012-01-24 22:09:09 INFO   Downloading package: foobar.com.1.0.2462.5679 from NuGet server: \\build01\Projects\NugetPackages
  2012-01-24 22:09:09 INFO   Downloading NuGet package foobar.com 1.0.2462.5679 from feed: '\\build01\Projects\NugetPackages'
  2012-01-24 22:09:20 DEBUG  Found package foobar.com 1.0.2462.5679
  2012-01-24 22:09:20 DEBUG  Downloading package (attempt 1 of 5)
  2012-01-24 22:09:20 ERROR  System.IO.IOException: The process cannot access the file 'C:\Octopus\Octopus\PackageCache\foobar.com.1.0.2462.5679\foobar.com.1.0.2462.5679.nupkg' because it is being used by another process.
  at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

Despite saying attempt 1 of 5, the deployment fails after the “uploading packages” phase.

Subsequent deployments seem to work fine because Octopus concludes that the package has already been uploaded to the destination, so it doesn’t fight itself to re-upload it.

Hi Chris,

You are correct, this bug will be part of the work to support the same package in two feeds. I actually did most of the work for this last week but it wasn’t quite ready for the last release.

I’ll make sure to add an explicit test case for this issue - thanks!

Paul