0

Sitecore 8.2 Update 3 We have a single CM that also hosts MongoDB for analytics. We also have 2 CDs.

This morning MongoDB crashed when it apparently ran out of memory. I thought Sitecore was supposed to stay up even when MongoDB is unavailable but our website (only one site on our servers) went down.

Is there a config change I can make to Sitecore to prevent it from going down when/if MongoDB is unavailable?

Update: Here's exerpts from the sitecore log:

Exception: MongoDB.Driver.MongoConnectionException
Message: Unable to connect to server ###.###.###.###:27017: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ###.###.###.###:27017.
Source: MongoDB.Driver
at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)
at MongoDB.Driver.Internal.DirectMongoServerProxy.ChooseServerInstance(ReadPreference readPreference)
at MongoDB.Driver.MongoServer.AcquireConnection(ReadPreference readPreference)
at MongoDB.Driver.MongoCollection.RunCommandAs[TCommandResult](IMongoCommand command, ReadPreference readPreference, IBsonSerializer resultSerializer, IBsonSerializationOptions resultSerializationOptions)
at MongoDB.Driver.MongoCollection.RunCommandAs[TCommandResult](IMongoCommand command, ReadPreference readPreference)
at MongoDB.Driver.MongoCollection.FindAndModify(FindAndModifyArgs args)
at Sitecore.SessionProvider.MongoDB.MongoSessionStateStore.GetItemExclusive(String application, String id, SessionStateLockCookie lockCookie, Int32& flags)
at Sitecore.SessionProvider.MongoDB.MongoSessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId, SessionStateActions& actions)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData)
at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Nested Exception

Exception: System.Net.Sockets.SocketException
Message: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond ###.###.###.###:27017
Source: System
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPEndPoint remoteEP)
at MongoDB.Driver.Internal.MongoConnection.Open()
at MongoDB.Driver.Internal.MongoConnection.SendMessage(BsonBuffer buffer, Int32 requestId)
at MongoDB.Driver.Internal.MongoConnection.SendMessage(MongoRequestMessage message)
at MongoDB.Driver.Operations.CommandOperation`1.Execute(MongoConnection connection)
at MongoDB.Driver.MongoServerInstance.Ping(MongoConnection connection)
at MongoDB.Driver.MongoServerInstance.Connect()
at MongoDB.Driver.Internal.DirectMongoServerProxy.Connect(TimeSpan timeout, ReadPreference readPreference)

Here is an excerpt from the Mongo log:

2020-03-10T08:05:15.894-0400 I - [conn24997] end connection 127.0.0.1:58181 (9 connections now open)
2020-03-10T08:05:15.895-0400 I NETWORK [thread1] connection accepted from 127.0.0.1:58272 #25007 (9 connections now open)
2020-03-10T08:05:44.738-0400 I COMMAND [conn25004] query Sitecore_analytics.Contacts query: { _id: BinData(3, B72E91A6722A0A4992582943D5D43BDB) } planSummary: IDHACK ntoskip:0 keysExamined:0 docsExamined:0 cursorExhausted:1 numYields:0 nreturned:0 reslen:20 locks:{ Global: { acquireCount: { r: 2 } }, Database: { acquireCount: { r: 1 } },
Collection: { acquireCount: { r: 1 } } } 1014ms
2020-03-10T08:06:00.898-0400 I NETWORK [thread1] connection accepted from 127.0.0.1:58277 #25008 (10 connections now open)
2020-03-10T08:06:00.899-0400 I - [conn24999] end connection 127.0.0.1:58184 (10 connections now open)
2020-03-10T08:14:43.520-0400 I - [conn25005] end connection ###.###.###.70:52362 (9 connections now open)
2020-03-10T08:17:11.280-0400 I - [conn25001] end connection ###.###.50.62:60013 (8 connections now open)
2020-03-10T08:20:43.727-0400 I - [conn25003] end connection ###.###.###.70:52354 (7 connections now open)
2020-03-10T08:21:22.597-0400 I - [conn25000] end connection ###.###.###.70:52322 (6 connections now open)
2020-03-10T08:21:22.598-0400 I NETWORK [thread1] connection accepted from ###.###.###.70:52405 #25009 (6 connections now open)
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\util\stacktrace_windows.cpp(239) mongo::printStackTrace+0x43
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\util\signal_handlers_synchronous.cpp(332) mongo::reportOutOfMemoryErrorAndExit+0x90
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\util\allocator.cpp(51) mongo::mongoRealloc+0x19
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\base\data_builder.h(179) mongo::DataBuilder::resize+0x94
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\db\ftdc\compressor.cpp(127) mongo::FTDCCompressor::getCompressedSamples+0x14c
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\db\ftdc\file_writer.cpp(168) mongo::FTDCFileWriter::writeSample+0x135
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\db\ftdc\file_manager.cpp(296) mongo::FTDCFileManager::writeSampleAndRotateIfNeeded+0x48
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe ...\src\mongo\db\ftdc\controller.cpp(217) mongo::FTDCController::doLoop+0x3f6
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe c:\program files (x86)\microsoft visual studio 14.0\vc\include\thr\xthread(247) std::_LaunchPad >,std::default_delete > > > >::_Run+0x75
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] mongod.exe c:\program files (x86)\microsoft visual studio 14.0\vc\include\thr\xthread(210) std::_Pad::_Call_func+0x9
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] ucrtbase.dll o__realloc_base+0x60
2020-03-10T08:26:42.901-0400 I CONTROL [ftdc] KERNEL32.DLL BaseThreadInitThunk+0x14
2020-03-10T08:26:42.901-0400 F - [ftdc] out of memory.

5
  • here is the sitecore article for Sitecore XP behavior when MongoDB server is unavailable. kb.sitecore.net/articles/930657.
    – Shrad
    Mar 10, 2020 at 15:02
  • That article doesn't address the reason why my site was completely unavailable. According to the site, the page will take longer to load, but mine never loaded. Based on the article, I would have expected the pages to load after 30 seconds (the timeout for xDB connection), but it never happened.
    – Michael
    Mar 11, 2020 at 15:13
  • can you post your logs.
    – Shrad
    Mar 12, 2020 at 13:24
  • @Shrad I have added log data to my post.
    – Michael
    Mar 13, 2020 at 15:36
  • sorry, i lost the track of this. please comment out the below in connectionstring.config file will keep your sitecore running. once you have resolved your memory issue revert it back. let me know is this something you are expecting. <add name="analytics" connectionString="mongodb://localhost/analytics" /> <add name="tracking.live" connectionString="mongodb://localhost/tracking_live" /> <add name="tracking.history" connectionString="mongodb://localhost/tracking_history" />
    – Shrad
    Mar 19, 2020 at 16:49

0

Browse other questions tagged or ask your own question.