datalust / seq-forwarder

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

Exception when starting #43

Closed dampee closed 5 years ago

dampee commented 5 years ago

After a reboot, the windows service was not able to boot due to an exception. I emptied the buffer folder, started again, but the service shut down with the same exception. I restarted again, then it worked flawlessly. The service is running for some time now.

{"@t":"2019-02-11T16:32:07.3441565Z","@m":"Seq Forwarder listening on \"http://localhost:15341\"","@i":"bc80c4c1","ListenUri":"http://localhost:15341"}
{"@t":"2019-02-11T16:32:07.5938112Z","@m":"Loading an API-key specific buffer in \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\21f9a5ef16804f0390645937cac2e33c\"","@i":"6a905877","Path":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\21f9a5ef16804f0390645937cac2e33c","SourceContext":"Seq.Forwarder.Multiplexing.ActiveLogBufferMap"}
{"@t":"2019-02-11T16:32:07.6406819Z","@m":"Log buffer open on \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\21f9a5ef16804f0390645937cac2e33c\"; 3 entries, next key will be 4354","@i":"505684b8","BufferPath":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\21f9a5ef16804f0390645937cac2e33c","Entries":3,"NextId":4354}
{"@t":"2019-02-11T16:32:07.7971295Z","@m":"Loading an API-key specific buffer in \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\3350a5fa9b3e44ea87677ef248b209d8\"","@i":"6a905877","Path":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\3350a5fa9b3e44ea87677ef248b209d8","SourceContext":"Seq.Forwarder.Multiplexing.ActiveLogBufferMap"}
{"@t":"2019-02-11T16:32:07.8133974Z","@m":"Log buffer open on \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\3350a5fa9b3e44ea87677ef248b209d8\"; 1 entries, next key will be 625","@i":"505684b8","BufferPath":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\3350a5fa9b3e44ea87677ef248b209d8","Entries":1,"NextId":625}
{"@t":"2019-02-11T16:32:07.8133974Z","@m":"Loading an API-key specific buffer in \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\5bdfb5f586a54f84b3eaae885d999400\"","@i":"6a905877","Path":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\5bdfb5f586a54f84b3eaae885d999400","SourceContext":"Seq.Forwarder.Multiplexing.ActiveLogBufferMap"}
{"@t":"2019-02-11T16:32:07.8284415Z","@m":"Log buffer open on \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\5bdfb5f586a54f84b3eaae885d999400\"; 16 entries, next key will be 17","@i":"505684b8","BufferPath":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\5bdfb5f586a54f84b3eaae885d999400","Entries":16,"NextId":17}
{"@t":"2019-02-11T16:32:07.8284415Z","@m":"Creating a new API key-specific log buffer in \"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\f3487049afeb437bb3737e46f74a822a\"","@i":"c3201009","Path":"C:\\ProgramData\\Seq\\Forwarder\\Buffer\\f3487049afeb437bb3737e46f74a822a","SourceContext":"Seq.Forwarder.Multiplexing.ActiveLogBufferMap"}
{"@t":"2019-02-11T16:32:07.8284415Z","@m":"Error running the server application","@i":"5ea10d46","@l":"Fatal","@x":"System.ArgumentException: An item with the same key has already been added.\r\n   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)\r\n   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)\r\n   at Seq.Forwarder.Multiplexing.ActiveLogBufferMap.Load()\r\n   at Seq.Forwarder.ServiceProcess.ServerService.Start()"}
dampee commented 5 years ago

I don't have a solution yet, but it seems that ingestion is already possible when the forwarder is bootstrapping.

nblumhardt commented 5 years ago

Hi - yes, looks like you're onto it, there's an ordering issue whereby ingestion can occur before the log buffer map is loaded. I'll have a dig around and see if there's a quick fix 👍 Thanks!