For some reason, when multiple deployments are initiated, for the same server, they lock each other (i guess) and i get this message in all of them:
Cannot start this task yet. There is already another task running that cannot be run in conjunction with any other task. Please wait…
No task is advancing. The are all stuck. If i cancel all tasks, and then try to run a single deployment again, i still get the same error! Only way to fix this, is to restart the tentacle service on the server. This wasn’t happening in 2.5 (it started happening only when upgraded to 3.3.26).
Thanks for reaching out!
Can you expand on what you’re trying to do in these deployments?
Its odd that they are all blocking each other. There is a mutex that we use to ensure that only one task runs at once by default, so they should proceed one at a time.
This behaviour can be overridden if you know that your steps will not conflict with each other.
Are you able to share the Tentacle logs so we can investigate further?
Actually this “locking” happens when a specific task hangs as described here:
I thought it was happening in other cases too, but it isn’t. Even if i cancel the task, octopus won’t let anything to run on the tentacle until i restart the tentacle service.
Okay, it appears that the other issue is the root cause of this locking. As this task is taking the mutex, the other tasks cannot run until that task releases the mutex (which is happening when the tentacle is restarted).
I suggest we close this issue, and I think when we solve the other ticket this will one will be resolved
I am reopening this discussion because right now this situation happened again, without running the task of the related issue. A different task was running and failed with the following exception:
== Failed: Step 1: Website Deployment ==
14:07:32 Fatal | The step failed: Activity Website Deployment on devserver 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.3.26\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:07:32 Verbose | Website Deployment completed
After that no other task was able to run, and i had to restart the service. Seems that this mutex is not released properly in many occasions.
That doesn’t look great. Sorry to hear you are facing these problems.
Can you share:
- a screenshot of what step 1 of your deployment process is doing
- the full deployment logs of the deployment which failed
- the logs from the tentacle around the time the deployment occurred
- the version of Octopus Server
- the version of Octopus Tentacle
- the version of Calamari
Once you’ve sent these through, I’ll be able to investigate further.