Analytics database timeout can occur when a contact session is submitted to the database

  • Description

    Connections to the Analytics database (MongoDB) can time out when the session of a contact with a large number of interactions is saved to the database. The following exception appears in the Sitecore XP log:

    WARN Session Submit has failed.
    Exception: System.IO.IOException
    Message: Unable to read data from the transport connection: 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.
    Source: System
       at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
       at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
       at System.Net.Security._SslStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security._SslStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security._SslStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
       at System.Net.Security.SslStream.Read(Byte[] buffer, Int32 offset, Int32 count)
       at MongoDB.Bson.IO.ByteBufferFactory.LoadFrom(Stream stream)
       at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializer serializer, IBsonSerializationOptions serializationOptions)
       at MongoDB.Driver.Operations.QueryOperation`1.GetFirstBatch(IConnectionProvider connectionProvider)
       at MongoDB.Driver.Operations.QueryOperation`1.Execute(IConnectionProvider connectionProvider)
       at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
       at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
       at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbInteractionStorage.RenumberInteractions(Guid contactId)
       at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider.RenumberInteractions(ID contactId)
       at Sitecore.Analytics.Data.ContactRepository.ReconcileContact(Contact contact, LeaseOwner owner, TimeSpan duration)
       at Sitecore.Analytics.Pipelines.SubmitSessionContext.RenumberInteractions.Process(SubmitSessionContextArgs args)
       at (Object , Object[] )
       at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
       at Sitecore.Analytics.Data.HttpSessionContextManager.Submit(Session session)
       at Sitecore.Analytics.Pipelines.CommitSession.SubmitSession.Process(CommitSessionPipelineArgs args)

    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
    Source: System
       at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)

    Additionally, it can lead to a long execution of the Tracker.Current.Session.Identify() method and the following error:

    Message: QueryFailure flag was Executor error: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit. (response was { "$err" : "Executor error: OperationFailed: Sort operation used more than the maximum 33554432 bytes of RAM. Add an index, or specify a smaller limit.", "code" : 17144 })
  • To fix the issue, apply a corresponding hotfix from the list below. See a readme file inside the archive for installation instructions.

    If you are using a version of Sitecore XP that is not listed above, contact Sitecore Support.

Applies to:

CMS 8.1 Initial Release+

CMS 8.2 Update-7+

January 16, 2017
September 19, 2018

Reference number:

136108, 142272

Keywords: 

  • DMS,
  • DMS,
  • DMS,
  • DMS,
  • DMS,
  • Performance,
  • Performance,
  • Performance,
  • Performance,
  • Performance,
  • xDB,
  • xDB,
  • xDB,
  • xDB,
  • xDB