Particular / ServiceControl

Backend for ServiceInsight and ServicePulse
https://docs.particular.net/servicecontrol/
Other
51 stars 47 forks source link

When executing New-ServiceControlAuditInstance using PowerShell remoting the audit instance fails to start #3772

Open awright18 opened 10 months ago

awright18 commented 10 months ago

Describe the suggested improvement

This issue intends to document the behavior of executing New-ServiceControlAuditInstance using PowerShell remoting.

Executing New-ServiceControlAuditInstance in a remote PowerShell session creates all the files for the service in the correct destination, and registers the service, but when it attempts to start the service there is a RavenDB error "Failed to load system storage" with an internal error "Sparrow.LowMemory.EarlyOutOfMemoryException: The amount of available memory to commit on the system is low."

Workaround:

Check if the service is running, if it hasn't then start the service.

$service = Get-Service "$InstanceName.ServiceControl.Audit"                  if($service.status -ne "Running") {   Start-Service "$InstanceName.ServiceControl.Audit" }

Additional Context

StackTrace: Sparrow.LowMemory.EarlyOutOfMemoryException: The amount of available memory to commit on the system is low. Commit charge: 2,047.9999 TBytes / 2,048 TBytes, Memory: 4.534 GBytes / 7.05 GBytes, Available memory for processing: 2,047.9999 TBytes, Dirty memory: 0 Bytes, Managed memory: 29.55 MBytes, Unmanaged allocations: 16 KBytes, Lucene unmanaged allocations: 0 Bytes at Sparrow.LowMemory.MemoryInformation.ThrowInsufficientMemory(MemoryInfoResult memInfo) in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow.Server\LowMemory\MemoryInformation.cs:line 195 at Sparrow.LowMemory.MemoryInformation.AssertNotAboutToRunOutOfMemory() in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow.Server\LowMemory\MemoryInformation.cs:line 135 at Sparrow.Server.LowMemory.LowMemoryMonitor.AssertNotAboutToRunOutOfMemory() in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow.Server\LowMemory\LowMemoryMonitor.cs:line 47 at Sparrow.LowMemory.LowMemoryNotification.AssertNotAboutToRunOutOfMemory() in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow\LowMemory\LowMemoryNotification.cs:line 430 at Sparrow.Utils.NativeMemory.AllocateMemory(Int64 size, ThreadStats& thread) in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow\Utils\NativeMemory.cs:line 154 at Sparrow.Utils.NativeMemory.AllocateMemory(Int64 size) in C:\Builds\RavenDB-Stable-5.4\54038\src\Sparrow\Utils\NativeMemory.cs:line 135 at Voron.Impl.FileHeaders.HeaderAccessor..ctor(StorageEnvironment env) in C:\Builds\RavenDB-Stable-5.4\54038\src\Voron\Impl\FileHeaders\HeaderAccessor.cs:line 42 at Voron.StorageEnvironment..ctor(StorageEnvironmentOptions options) in C:\Builds\RavenDB-Stable-5.4\54038\src\Voron\StorageEnvironment.cs:line 145 at Raven.Server.Storage.Layout.StorageLoader.OpenEnvironmentWithPossibleLayoutUpdate(DirectoryStorageEnvironmentOptions options, StorageEnvironmentType type) in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\Storage\Layout\StorageLoader.cs:line 40 at Raven.Server.Storage.Layout.StorageLoader.OpenEnvironment(StorageEnvironmentOptions options, StorageEnvironmentType type) in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\Storage\Layout\StorageLoader.cs:line 20 at Raven.Server.ServerWide.ServerStore.Initialize() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\ServerWide\ServerStore.cs:line 764 --- End of inner exception stack trace --- at Raven.Server.ServerWide.ServerStore.Initialize() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\ServerWide\ServerStore.cs:line 768 at Raven.Server.RavenServer.Initialize() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\RavenServer.cs:line 313 at Raven.Server.Program.Main(String[] args) in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Server\Program.cs:line 185

at Raven.Embedded.EmbeddedServer.d20.MoveNext() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Embedded\EmbeddedServer.cs:line 243 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Embedded.EmbeddedServer.d15.MoveNext() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Embedded\EmbeddedServer.cs:line 187 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Embedded.EmbeddedServer.<>cDisplayClass13_0.<b0>d.MoveNext() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Embedded\EmbeddedServer.cs:line 143 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Raven.Embedded.EmbeddedServer.d13.MoveNext() in C:\Builds\RavenDB-Stable-5.4\54038\src\Raven.Embedded\EmbeddedServer.cs:line 163 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Persistence.RavenDb.EmbeddedDatabase.d_8.MoveNext() in //src/ServiceControl.Audit.Persistence.RavenDb5/EmbeddedDatabase.cs:line 142 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Persistence.RavenDb.RavenDbEmbeddedPersistenceLifecycle.d2.MoveNext() in /_/src/ServiceControl.Audit.Persistence.RavenDb5/RavenDbEmbeddedPersistenceLifecycle.cs:line 29 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Persistence.RavenDb.RavenDb5Installer.d1.MoveNext() in /_/src/ServiceControl.Audit.Persistence.RavenDb5/RavenDb5Installer.cs:line 16 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Infrastructure.SetupBootstrapper.d_1.MoveNext() in //src/ServiceControl.Audit/Infrastructure/SetupBootstrapper.cs:line 55 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Infrastructure.Hosting.Commands.SetupCommand.d0.MoveNext() in /_/src/ServiceControl.Audit/Infrastructure/Hosting/Commands/SetupCommand.cs:line 12 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at ServiceControl.Audit.Infrastructure.Hosting.Commands.CommandRunner.d_1.MoveNext() in //src/ServiceControl.Audit/Infrastructure/Hosting/Commands/CommandRunner.cs:line 16 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Program.

d_1.MoveNext() in //src/ServiceControl.Audit/Program.cs:line 37 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at ServiceControl.Audit.Program.
(String[] args) 2023-10-24 13:13:24.152 INFO Logging to 'C:\Test\ServiceControl\SDWORX.Test.ServiceControl.Audit\' with level Info

DmytroProkopenkoSecurrency commented 9 months ago

Hey Team! Any updates regarding that issue?

helenktsai commented 9 months ago

Hi there @DmytroProkopenkoSecurrency, we have this on our radar and it is eligible to be picked up for a future release, but we cannot provide a firm timeline.

DmytroProkopenkoSecurrency commented 9 months ago

Hey @helenktsai ! Thanks for the update.

Unfortunately, it's not as great as we wish. We waiting for that fix.

Thanks.