We recently ran into an issue where builds are failing to one of our Linux targets. When we execute a runbook process that runs an ‘echo’ we get the following error:
#START
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = VariableLogger (ReflectionActivator), Services = [Calamari.Common.Plumbing.Logging.VariableLogger], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = None, Ownership = OwnedByLifetimeScope —> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IVariables (DelegateActivator), Services = [Calamari.Common.Plumbing.Variables.IVariables], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope —> The system cannot open the device or file specified. : ‘Global\Octopus.Calamari.DeploymentJournal’ (See inner exception for details.) (See inner exception for details.)
Autofac.Core.DependencyResolutionException
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Execute() at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable
1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable
1 parameters)
at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context)
at Calamari.Common.CalamariFlavourProgram.Run(String[] args) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\CalamariFlavourProgram.cs:line 57
–Inner Exception–
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IVariables (DelegateActivator), Services = [Calamari.Common.Plumbing.Variables.IVariables], Lifetime = Autofac.Core.Lifetime.RootScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope —> The system cannot open the device or file specified. : ‘Global\Octopus.Calamari.DeploymentJournal’ (See inner exception for details.)
Autofac.Core.DependencyResolutionException
at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.<Execute>b__5_0() at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func
1 creator)
at Autofac.Core.Resolving.InstanceLookup.Execute()
at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.ResolveComponent(IComponentRegistration registration, IEnumerable
1 parameters)
at Autofac.Core.Activators.Reflection.AutowiringParameter.<>c__DisplayClass0_0.b__0()
at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
–Inner Exception–
The system cannot open the device or file specified. : ‘Global\Octopus.Calamari.DeploymentJournal’
System.IO.IOException
at System.Threading.Mutex.CreateMutexCore(Boolean initiallyOwned, String name, Boolean& createdNew)
at System.Threading.Mutex…ctor(Boolean initiallyOwned, String name)
at Calamari.Common.Features.Processes.Semaphores.SystemSemaphoreManager.AcquireMutex(String name, String waitMessage) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Processes\Semaphores\SystemSemaphoreManager.cs:line 75
at Calamari.Common.Features.Processes.Semaphores.SystemSemaphoreManager.Acquire(String name, String waitMessage) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Processes\Semaphores\SystemSemaphoreManager.cs:line 30
at Calamari.Common.Features.Deployment.Journal.DeploymentJournal.GetAllJournalEntries() in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Deployment\Journal\DeploymentJournal.cs:line 41
at Calamari.Common.Features.Deployment.Journal.DeploymentJournal.GetLatestInstallation(String retentionPolicySubset, String packageId, String packageVersion) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Deployment\Journal\DeploymentJournal.cs:line 68
at Calamari.Common.Features.Deployment.Journal.DeploymentJournal.GetLatestInstallation(String retentionPolicySubset) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Deployment\Journal\DeploymentJournal.cs:line 63
at Calamari.Common.Plumbing.Variables.DeploymentJournalVariableContributor.Previous(IVariables variables, IDeploymentJournal journal, String policySet) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Plumbing\Variables\DeploymentJournalVariableContributor.cs:line 24
at Calamari.Common.Plumbing.Variables.DeploymentJournalVariableContributor.Contribute(ICalamariFileSystem fileSystem, IVariables variables) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Plumbing\Variables\DeploymentJournalVariableContributor.cs:line 19
at Calamari.Common.Plumbing.Variables.VariablesFactory.Create(CommonOptions options) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Plumbing\Variables\VariablesFactory.cs:line 38
at Calamari.Common.CalamariFlavourProgram.<>c__DisplayClass4_0.b__0(IComponentContext c) in C:\BuildAgent\work\e0cefbed4ad11812\source\Calamari.Common\CalamariFlavourProgram.cs:line 87
at Autofac.RegistrationExtensions.<>c__DisplayClass5_01.<Register>b__0(IComponentContext c, IEnumerable
1 p)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_01.<ForDelegate>b__0(IComponentContext c, IEnumerable
1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable
1 parameters)
The remote script failed with exit code 100
The action Run a Script on “” failed
#END
The target role includes 6 other servers where the build deploys as expected. What’s strange is if we run the same command from the script console (just an ‘echo’ statement) we don’t see the error. Both runs (script console & runbook) identify the server based on the role/environment combination so I’d think the behavior would be the same for both ( both succeed or both fail ). Any thoughts would be appreciated. Thanks.