NullReferenceException when deploying to same site

Getting an exception when trying to use Octopus on my local machine. I’ve got two enviroments (local, test), both trying to deploy to the same site. The local env works fine, but when i try to upgrade that package to the test env I get this error:

Stage 2: Uploading packages to Tentacles
2012-04-17 11:35:17 INFO Preparing to upload packages
2012-04-17 11:35:17 INFO Uploading packages…
2012-04-17 11:35:17 ERROR System.NullReferenceException: Object reference not set to an instance of an object.
at Octopus.Shared.Activities.ActivityRuntime.Execute(IEnumerable`1 activities) in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Shared\Activities\ActivityRuntime.cs:line 49
at Octopus.Server.Tasks.Deploy.UploadPackagesActivity.Execute() in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Server\Tasks\Deploy\UploadPackagesActivity.cs:line 54
at Octopus.Shared.Activities.ActivityRuntime.RunTaskOnBackgroundThread(Object arguments) in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Shared\Activities\ActivityRuntime.cs:line 115

Hi John,

Thanks for reporting, I’ll look into this tonight. In the mean time is it possible that the environments or steps changed after the release was created? What happens if you create a new release and deploy it to that environment?

Judging by the stack trace/source code it seems like your test environment might not have any machines, or it doesn’t have any machines where the packages in the project have been configured to deploy to (i.e., there are no package/machine mappings for the test environment).

Paul

I tried to create another environment (prod), and deploy the same version that did not work in test to prod. Same error.

Created a new version, and no problems deploying to test.

Hi John,

Had you made any other changes between deploying the first version to Local and then to Dev? I think that changing machines or package steps between deployments causes this error. It will be fixed in the next Octopus release.

Paul

The only change I can think of was duplicating the OctopusWebSiteName variable for the environments. I don’t remember exactly the order of doing so, if it was before or after creating environments / releases.

Had this same thing happen when adding another environment to a step.

This is now fixed in 1.0 releases of Octopus.

Paul