An error occurred during the activation of a particular registration. See the inner exception for details

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, IEnumerable1 parameters)
at Autofac.Core.Resolving.ResolveOperation.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters) at Autofac.Core.Container.ResolveComponent(IComponentRegistration registration, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.TryResolveService(IComponentContext context, Service service, IEnumerable1 parameters, Object& instance) at Autofac.ResolutionExtensions.ResolveService(IComponentContext context, Service service, IEnumerable1 parameters)
at Autofac.ResolutionExtensions.Resolve(IComponentContext context, Type serviceType, IEnumerable1 parameters) at Autofac.ResolutionExtensions.Resolve[TService](IComponentContext context, IEnumerable1 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, Func1 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, IEnumerable1 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(IEnumerable1 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, IEnumerable1 p)
at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass0_01.<ForDelegate>b__0(IComponentContext c, IEnumerable1 p)
at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable1 parameters) at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable1 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.

Hi Shannon,

Thanks for posting your issue, and sorry to hear one of your servers is showing that error during a deployment.

We’ve seen similar behavior with other users in the past when the permissions on their Linux targets were different for the /tmp directory and specifically /tmp/.dotnet. I was wondering what you see if you compare permissions from a working server with the non-working server using the following command:

ls -al /tmp/.dotnet

If that shows different permissions, particularly the non-working server missing a write permission, then you may need to correct this and see if that changes anything.

There are a few more details I can provide around this if it ends up being the issue, but let me know if that helps get you unblocked and we can go from there.

Best,
Patrick

Thanks Patrick. Looks like that may be the issue. I’ll fix it and respond if there are additional issues

1 Like

Hi Shannon,

Great, hopefully that gets you unblocked!

In case you’re curious to read a bit more about how we’re using this directory, the following Stackoverflow article goes through the use case: linux - When should I use /dev/shm/ and when should I use /tmp/? - Super User

Hopefully, that helps explain it better than I can, but let me know if you have further questions and I’ll be happy to help.

Best regards,
Patrick

Yep that fixed the issue. Appreciate the help. Thanks!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.