datalust / seq-forwarder

Local collection and reliable forwarding of log data to Seq
Apache License 2.0
57 stars 16 forks source link

Seq Forwarder Service will not start when large buffer configured #7

Closed rdavisunr closed 8 years ago

rdavisunr commented 8 years ago

The following commands result in the service failing to start:

The exception thrown is as follows:

Service cannot be started. Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> Arithmetic operation resulted in an overflow. (See inner exception for details.) ---> System.OverflowException: Arithmetic operation resulted in an overflow.
   at LightningDB.Native.Lmdb.mdb_env_set_mapsize(IntPtr env, Int64 size)
   at LightningDB.LightningEnvironment.set_MapSize(Int64 value)
   at Seq.Forwarder.Storage.LogBuffer..ctor(String bufferPath, UInt64 bufferSizeBytes)
   at Seq.Forwarder.SeqForwarderModule.<Load>b__3_0(IComponentContext c)
   at Autofac.RegistrationExtensions.<>c__DisplayClass10`1.<Register>b__f(IComponentContext c, IEnumerable`1 p)
   at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
   at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
   at Autofac.Core.Resolving.InstanceLookup.Activate(...

The issue starts occurring somewhere north of 200MB...

My environment is Windows Server 2012 R2

nblumhardt commented 8 years ago

Thank you for the report, will check this out!

nblumhardt commented 8 years ago

Unfortunately the switch to 32-bit binaries that we made when moving from the original project/installer neglected the limitations of the underlying storage format under 32 bits. I've created a PR that reverts this mistake and produces 64 bit binaries, a new installer should be published when it is merged through shortly.

There may be some issues upgrading from the 32 bit release; deleting C:\ProgramData\Seq\Forwarder\Buffer and restarting the service is the "quick" way through it if so.

If there are upgrade troubles and you need to preserve the buffered data, redirecting incoming apps directly to Seq so that the buffer can flush first (before deleting the buffer file and upgrading) is the easiest option. Finally, you could move the buffer file to a second machine (running the 32-bit binaries) and upload any remaining events from there. Sorry about the hassle, and let us know via support@getseq.net if you need a hand.

Supporting 32-bit machines is a goal we'll need to continue pursuing but through an alternative tactic, in the meantime requiring 64 bit is the option least likely to cause further issues.

Thanks for reporting this, very much appreciated.

rdavisunr commented 8 years ago

@nblumhardt - excellent! thanks for the prompt response and resolution.