Unable to deploy to a specific environment in a lifecycle

When attempting to implement a canary deployment pattern, we are running into issues.

Context: we have a Development Channel (and associated lifecycle) and a Release Channel (and associated lifecycle).

Development Channel deploys to Dev, and QA.
Release Channel deploys to Stage, and Prod.

We wanted to implement a Canary, so we added a new Lifecycle and associated Channel.
Canary Channel deploys to Stage, Canary, and Prod.

When building a release for Canary, we can successfully deploy to Stage, but when we attempt to deploy to Canary we get the following error:

*Failed*

The deployment failed because one or more steps failed. Please see the deployment log for details.

 Acquire packages

 Step 2: Deploy Portal

The step failed: Activity Deploy Portal on the Octopus Server failed with error 'The release has not been deployed to the required environments before it can be promoted to this environment. Check the lifecycle associated with this project's deployment process. Once you have corrected these problems you can try again. If the problem is related to a variable you will need to update the variables for this release or recreate the release for the changes to take effect. If the problem is related to the deployment process you will need to create a new release for the changes to take effect.'.

We have made the Stage environment optional, but that didn’t work either.

Task ID:        ServerTasks-100740

Related IDs: Deployments-23321, Channels-257, Releases-29122, Projects-37, Spaces-6, Environments-142
Task status: Failed
Task queued: Thursday, 26 March 2020 10:59:40 AM -04:00
Task started: Thursday, 26 March 2020 10:59:41 AM -04:00
Task completed: Thursday, 26 March 2020 10:59:42 AM -04:00
Task duration: 2 seconds
Server version: 2019.3.5+Branch.tags-2019.3.5.Sha.b108f09544f99865341558a89b26949ff2c463f2
Server node: OHCINWOCTDEP01P

                | == Failed: Deploy Deploy All release 1.138.85-rc.10-canary to Canary ==

10:59:41 Verbose | Step 1: Stop IIS does not apply to the current environment, and will not be executed
10:59:41 Verbose | Step 6: Deploy Database does not apply to the current environment, and will not be executed
10:59:41 Verbose | Step 10: Start IIS does not apply to the current environment, and will not be executed
10:59:41 Verbose | Guided failure is not enabled for this task
10:59:42 Fatal | The deployment failed because one or more steps failed. Please see the deployment log for details.
|
| == Success: Acquire packages ==
10:59:41 Info | Acquiring packages
10:59:41 Info | Making a list of packages to acquire
10:59:41 Verbose | No packages are required on the Octopus Server
10:59:41 Verbose | No packages are required on any deployment targets
10:59:41 Verbose | No Acquisition of Projects-39.1.138.85-rc.10
| No Acquisition of Projects-38.1.138.85-rc.10
| No Acquisition of Projects-40.1.138.85-rc.10
| No Acquisition of Projects-53.1.138.85-rc.10
| No Acquisition of Projects-75.1.138.85-rc.10
10:59:41 Info | All packages have been acquired
10:59:41 Verbose | Acquire Packages completed
|
| Success: Octopus Server
10:59:41 Verbose | Packge Projects-39 v1.138.85-rc.10 does not need to be acquired
10:59:41 Verbose | Packge Projects-38 v1.138.85-rc.10 does not need to be acquired
10:59:41 Verbose | Packge Projects-40 v1.138.85-rc.10 does not need to be acquired
10:59:41 Verbose | Packge Projects-53 v1.138.85-rc.10 does not need to be acquired
10:59:41 Verbose | Packge Projects-75 v1.138.85-rc.10 does not need to be acquired
|
| == Failed: Step 2: Deploy Portal ==
10:59:42 Fatal | The step failed: Activity Deploy Portal on the Octopus Server failed with error ‘The release has not been deployed to the required environments before it can be promoted to this environment. Check the lifecycle associated with this project’s deployment process.
| Once you have corrected these problems you can try again.
| If the problem is related to a variable you will need to update the variables for this release or recreate the release for the changes to take effect.
| If the problem is related to the deployment process you will need to create a new release for the changes to take effect.’.
10:59:42 Verbose | Deploy Portal completed
|
| Failed: Octopus Server
10:59:41 Verbose | Octopus Server version: 2019.3.5+Branch.tags-2019.3.5.Sha.b108f09544f99865341558a89b26949ff2c463f2
10:59:41 Verbose | Environment Information:
| OperatingSystem: Microsoft Windows NT 10.0.14393.0
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: WEB\svc-octdep
| MachineName: OHCINWOCTDEP01P
| ProcessorCount: 2
| CurrentDirectory: C:\Windows\system32
| TempDirectory: C:\Users\svc-octdep\AppData\Local\Temp
| HostProcessName: Octopus.Server
| PID: 2448
10:59:41 Verbose | Creating deployment for release 1.138.85-rc.10 of project ‘Deploy Portal’
10:59:41 Verbose | The release has not been deployed to the required environments before it can be promoted to this environment. Check the lifecycle associated with this project’s deployment process.
| Once you have corrected these problems you can try again.
| If the problem is related to a variable you will need to update the variables for this release or recreate the release for the changes to take effect.
| If the problem is related to the deployment process you will need to create a new release for the changes to take effect.
| Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentCreationFailedException
| at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentFactory.ValidateCanDeployToEnvironment(ILifecycleProgressionEvaluator lifecycleProgressionEvaluator, Release release, IUnrestrictedDeploymentSummaries deploymentSummaries, List1 environments, Lifecycle lifecycle, Tenant tenant, DeploymentEnvironment environment) | at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentFactory.CreateDeployment(IOctopusQueryExecutor transaction, Deployment deployment, User user, DateTimeOffset queueTime, Nullable1 queueTimeExpiry, ILifecycleProgressionEvaluator lifecycleProgressionEvaluator, ILifecycleService lifecycleService, IDeploymentSummaryService deploymentSummaryService, IDictionary2 additionalVariables, Func3 promptedVariableProvider)
| at Octopus.Server.Web.Api.Actions.DeploymentCreateAction.CreateDeployment(DeploymentResource resource, Release release, Project project, DateTimeOffset queueTime, Boolean isScheduledDeployment, User user, Func3 promptedVariableProvider, IDictionary2 additionalVariables)
| at Octopus.Server.Orchestration.ServerTasks.Deploy.Steps.DeployRelease.DeployReleaseActionHandler.Execute(ActionCommand command)
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.OldActionDispatcher.<>c__DisplayClass4_0.b__0()
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.OldActionDispatcher.DispatchServerAction(ActionCommand command)
| at Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.NewActionDispatcher.Dispatch(ActionCommand command, DeploymentTarget deploymentTarget, Maybe`1 guidanceExcludeCallback)
| at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentTaskController.<>c__DisplayClass38_1.b__1()
| at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentTaskController.<>c__DisplayClass38_0.b__0()
| at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, DeploymentTarget deploymentTarget)
| at Octopus.Server.Orchestration.ServerTasks.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, DeploymentTarget targetContext, PlannedAction action)
10:59:41 Fatal | The action Deploy Portal on the Octopus Server failed
|
| == Skipped: Step 3: Deploy API ==
10:59:42 Info | Step “Deploy API” runs only when all previous steps succeeded; skipping
|
| == Skipped: Step 4: Deploy Websites ==
10:59:42 Info | Step “Deploy Websites” runs only when all previous steps succeeded; skipping
|
| == Skipped: Step 5: Deploy Sandbox ==
10:59:42 Info | Step “Deploy Sandbox” runs only when all previous steps succeeded; skipping
|
| == Skipped: Step 7: Deploy Mod Rewrite ==
10:59:42 Info | Step “Deploy Mod Rewrite” runs only when all previous steps succeeded; skipping
|
| == Skipped: Step 8: Email Success ==
10:59:42 Info | Step “Email Success” runs only when all previous steps succeeded; skipping
|
| == Success: Step 9: Email Fail ==
10:59:42 Info | A failure has been detected so “Email Fail” will be run.
10:59:42 Verbose | Email Fail completed
|
| Success: Octopus Server
10:59:42 Verbose | Octopus Server version: 2019.3.5+Branch.tags-2019.3.5.Sha.b108f09544f99865341558a89b26949ff2c463f2
10:59:42 Verbose | Environment Information:
| OperatingSystem: Microsoft Windows NT 10.0.14393.0
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: WEB\svc-octdep
| MachineName: OHCINWOCTDEP01P
| ProcessorCount: 2
| CurrentDirectory: C:\Windows\system32
| TempDirectory: C:\Users\svc-octdep\AppData\Local\Temp
| HostProcessName: Octopus.Server
| PID: 2448
10:59:42 Verbose | Email parameters:
10:59:42 Verbose | Subject: Failure: Deploy All deploys 1.138.85-rc.10-canary To Canary
10:59:42 Verbose | To: YYYYYY
10:59:42 Verbose | Cc:
10:59:42 Verbose | Bcc:
10:59:42 Verbose | Sending email message…
10:59:42 Info | Email sent!
10:59:42 Verbose | Successfully finished Email Fail on the Octopus Server

Hi Tyler -

Thank you for reaching out. It looks like you have emailed our support channel with this question as well. We will continue this correspondence via email going forward.

-James