Hi,
I am experiencing an issue where a deployment fails with the error message: ‘Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed’
I can see this error was reported before but in a slightly different context and the ticket has been closed due to inactivity:
http://help.octopusdeploy.com/discussions/problems/39623
Log from the failing step:
| == Failed: Step 2: ******** ==
14:05:39 Fatal | The step failed: Activity Configure Service User on ******** failed with error 'Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
| Server exception:
| System.ObjectDisposedException: Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it has already been disposed.
| at Autofac.Core.Lifetime.LifetimeScope.CheckNotDisposed()
| at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
| at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable`1 parameters, Object& instance)
| at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable`1 parameters)
| at Autofac.ResolutionExtensions.ResolveNamed[TService](IComponentContext context, String serviceName, IEnumerable`1 parameters)
| at Octopus.Shared.Communications.AutofacServiceFactory.CreateService(String serviceName) in Y:\Work\refs\tags\3.4.9\source\Octopus.Shared\Communications\AutofacServiceFactory.cs:line 18
| at Halibut.ServiceModel.ServiceInvoker.Invoke(RequestMessage requestMessage) in Z:\BuildAgent\work\e1bda71fea4b4831\source\Halibut\ServiceModel\ServiceInvoker.cs:line 21
| at Halibut.Transport.Protocol.MessageExchangeProtocol.InvokeAndWrapAnyExceptions(RequestMessage request, Func`2 incomingRequestProcessor) in Z:\BuildAgent\work\e1bda71fea4b4831\source\Halibut\Transport\Protocol\MessageExchangeProtocol.cs:line 153'.
14:05:39 Verbose | ******** completed
|
| Failed: ********
14:05:39 Fatal | Configure Service User on ********
|
| Success: Configure Service User
14:05:30 Verbose | Octopus Server version: 3.7.1+Branch.master.Sha.0fc1b4c55d31801a654cd781099a16317d8af685
14:05:30 Verbose | Environment Information:
| OperatingSystem: Microsoft Windows NT 6.2.9200.0
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: ********
| MachineName: ********
| ProcessorCount: 4
| CurrentDirectory: C:\Windows\system32
| TempDirectory: C:\Users\********\AppData\Local\Temp\
| HostProcessName: Octopus.Server
14:05:30 Info | Deploying package 'C:\Octopus\Files\********.2.0.510.nupkg-1a20e5d5-6988-4546-a3ec-29157b5d9aef' to machine 'https://********:*****/'
14:05:30 Info | Cannot start this task yet. There is already another task running that cannot be run in conjunction with any other task. Please wait...
14:05:36 Verbose | Octopus Deploy: Calamari version 0.0.0
14:05:36 Verbose | Environment Information:
14:05:36 Verbose | OperatingSystem: Microsoft Windows NT 6.2.9200.0
14:05:36 Verbose | OsBitVersion: x64
14:05:36 Verbose | Is64BitProcess: True
14:05:36 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
14:05:36 Verbose | MachineName: ********
14:05:36 Verbose | ProcessorCount: 4
14:05:36 Verbose | CurrentDirectory: C:\Octopus\Work\********
14:05:36 Verbose | TempDirectory: C:\Windows\TEMP\
14:05:36 Verbose | HostProcessName: Calamari
14:05:36 Info | Deploying package: C:\Octopus\Files\********.2.0.510.nupkg-1a20e5d5-6988-4546-a3ec-29157b5d9aef
14:05:37 Verbose | Extracting package to: C:\Octopus\Applications\********\********\2.0.510
14:05:38 Verbose | Extracted 6 files
14:05:38 Info | Copying package contents to '********'
14:05:38 Info | Copied 6 files
14:05:38 Verbose | Executing '********\Octopus.Action.CustomScripts.PostDeploy.ps1'
Please advise.
Many thanks,
Daniel