On our Sitecore 8 production instance, we are getting the below error messages. This client site we have recently inherited from another partner and on preliminary investigation from our end, we see they have implemented replica sets for MongoDB
<add name="analytics" connectionString="mongodb://{IP}:27017,{IP}:27018/sitecore_analytics?replicaset=SiteCoreDMS" />
Which looks correct. These are the errors in Sitecore logs:
7056 04:22:01 ERROR Cannot create tracker.
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 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>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.<>c__DisplayClass29`1.<FindOneAs>b__28()
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Execute(Action action, ExceptionBehavior exceptionBehavior)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.FindOneAs[TDocument](IMongoQuery query, ExceptionBehavior exceptionBehavior)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbContactStorage.LoadContactIdentifier(ID id)
at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDataAdapterProvider.TryLoadContact(ID id, IContactFactory factory, LeaseOwner leaseOwner, TimeSpan leaseDuration)
at Sitecore.Analytics.Data.ContactRepository.TryLoadContact(Guid id, LeaseOwner leaseOwner, TimeSpan leaseDuration)
at Sitecore.Analytics.Tracking.ContactManager.TryLoadContact(Guid contactId, Int32 lockDurationMinutes)
at Sitecore.Analytics.Pipelines.EnsureSessionContext.LoadContact.Process(InitializeTrackerArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.DefaultTracker.EnsureSessionContext()
at Sitecore.Analytics.Pipelines.CreateTracker.GetTracker.Process(CreateTrackerArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.Tracker.Initialize()
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)
7056 04:22:01 ERROR Cannot start analytics.
Exception: System.InvalidOperationException
Message: Tracker.Current is not initialized
Source: Sitecore.Analytics
at Sitecore.Analytics.Pipelines.StartAnalytics.StartTracking.Process(PipelineArgs args)
at (Object , Object[] )
at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
at Sitecore.Analytics.Pipelines.HttpRequest.StartAnalytics.Process(RenderLayoutArgs args)
--------------------------------------------
ERROR Exception when executing agent aggregation/automationRangeManager
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 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>d__0.MoveNext()
at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
at Sitecore.Analytics.Automation.Data.MongoDbAutomationProvider.GetEarliestAutomationTransitionTimestamp()
at Sitecore.Analytics.Automation.Aggregation.Data.Processing.RangeManagerAgent.Execute()
at Sitecore.Analytics.Core.BackgroundService.Run()
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)
Attaching output of rs.status()
SiteCoreDMS:SECONDARY> rs.status()
{
"set" : "SiteCoreDMS",
"date" : ISODate("2016-10-12T06:49:33Z"),
"myState" : 2,
"syncingTo" : "42.159.226.69:27017",
"members" : [
{
"_id" : 0,
"name" : "42.159.225.222:27017",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 2474004,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"lastHeartbeat" : ISODate("2016-10-12T06:49:32Z"),
"lastHeartbeatRecv" : ISODate("2016-10-12T06:49:31Z"),
"pingMs" : 0,
"syncingTo" : "42.159.226.69:27017"
},
{
"_id" : 1,
"name" : "42.159.225.222:27018",
"health" : 1,
"state" : 2,
"stateStr" : "SECONDARY",
"uptime" : 2474006,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"self" : true
},
{
"_id" : 2,
"name" : "42.159.226.69:27017",
"health" : 1,
"state" : 1,
"stateStr" : "PRIMARY",
"uptime" : 2474002,
"optime" : Timestamp(1476254930, 1),
"optimeDate" : ISODate("2016-10-12T06:48:50Z"),
"lastHeartbeat" : ISODate("2016-10-12T06:49:32Z"),
"lastHeartbeatRecv" : ISODate("2016-10-12T06:49:33Z"),
"pingMs" : 2,
"electionTime" : Timestamp(1474819533, 1),
"electionDate" : ISODate("2016-09-25T16:05:33Z")
}
],
"ok" : 1
}
SiteCoreDMS:SECONDARY>
mongo
client) and get replica set configuration using the commandrs.conf()
. Attach the output here.rs.status()
?mongo.exe
on the server where your Sitecore application is running and try connecting from that server directly to the replica set:mongo --host SiteCoreDMS/42.159.226.69:27017,42.159.225.222:27017,42.159.225.222:27018 sitecore_analytics
.