Thursday, 19 May 2016

Disable xDB in Sitecore 7.5 with Sitecore Analytics Enabled for Basic Personalization

In our project, we use Sitecore 7.5 and we enabled Sitecore Analytics so that we can do basic personalization in the renderings. In Sitecore 7.5, we do not have CMS-Only mode like Sitecore 8.1. If we do not have xDB database setup, we have seen many repeated Mongo DB errors in the log files. Moreover these repeated logs slows down the authoring and production environment.

We contacted Sitecore to provide a patch to disable the xDB errors and it seems it is not possible in Sitecore 7.5 but to upgrade our Sitecore instance to 8.1.

As a workaround to disable these errors, we went ahead and disabled background services and other related configurations in Sitecore analytics. This has disabled the unncessary errors related to Mongo DB and analytics but Sitecore basic personalization was still working for our renderings. 

Warning: These configuration changes may affect other functionalities related to Sitecore Analytics.

Few Errors:

5588 03:00:31 ERROR MongoDbDictionary.Store() has failed.
Exception: Sitecore.Analytics.DataAccess.DatabaseNotAvailableException
Message: Database not available
Source: Sitecore.Analytics.MongoDB
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Execute(Action action, ExceptionBehavior exceptionBehavior)
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbCollection.Save(Object value)
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDictionary.Store(Object value)


ManagedPoolThread #9 07:59:51 ERROR Unable to connect to server localhost:27017: No connection could be made because the target machine actively refused it 127.0.0.1:27017.



7060 03:00:20 ERROR Exception when executing agent aggregation/recovery
Exception: System.Reflection.TargetInvocationException
Message: Exception has been thrown by the target of an invocation.
Source: mscorlib
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Sitecore.Reflection.ReflectionUtil.CreateObject(Type type, Object[] parameters)
   at Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateFromReference(XmlNode configNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.GetInnerObject(XmlNode paramNode, String[] parameters, Boolean assert)
   at Sitecore.Configuration.Factory.AssignProperties(XmlNode configNode, String[] parameters, Object obj, Boolean assert, Boolean deferred, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(XmlNode configNode, String[] parameters, Boolean assert, IFactoryHelper helper)
   at Sitecore.Configuration.Factory.CreateObject(String configPath, String[] parameters, Boolean assert)
   at Sitecore.Analytics.Core.BackgroundService.CreateAgent()
   at Sitecore.Analytics.Core.BackgroundService.ExecuteAgent()
   at Sitecore.Analytics.Core.BackgroundService.Run()

Nested Exception

Exception: System.InvalidOperationException
Message: Connection string settings not available (tracking.live)
Source: Sitecore.Analytics.MongoDB
   at Sitecore.Analytics.Data.DataAccess.MongoDb.MongoDbDriver.FromConnectionString(String connectionStringName)
   at Sitecore.Analytics.Data.MongoDb.ProcessingPool.MongoDbProcessingPool..ctor(String connectionStringName)



1.     In \Website\App_Config\Include\Sitecore.Analytics.config, modify the config values.
<setting name="Analytics.LogLevel" value="None" />
<setting name="Analytics.PerformLookup" value="false" />

2.     In \Website\App_Config\Include\Sitecore.Analytics.config, comment out these lines.

<!--<hooks>
      <hook type="Sitecore.Analytics.ConfigLoader, Sitecore.Analytics" />
      <hook type="Sitecore.Analytics.BackgroundServiceLoader, Sitecore.Analytics" />
 </hooks> -->

            <!--<sessionEnd>
<processor type="Sitecore.Analytics.Pipelines.SessionEnd.RaiseVisitEnd, Sitecore.Analytics"/>
            </sessionEnd>-->

            <!--<scheduling>
      <agent type="Sitecore.Analytics.Tasks.EmailReportsTask, Sitecore.Analytics" method="Run" interval="0:00:00">
        <DatabaseName>master</DatabaseName>
      </agent>
    </scheduling>-->

3.     Disable these configuration files completely.

\Website\App_Config\Include\
Sitecore.Analytics.Automation.TimeoutProcessing.config
Sitecore.Analytics.Reporting.RemoteClient.config
Sitecore.Analytics.Reporting.RemoteServer.config
Sitecore.Analytics.Tracking.RobotDetection.config

4.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Aggregation.ProcessingPools.config, comment out these lines.

<!--<pipelines>
      <initialize>
        <processor type="Sitecore.Analytics.Automation.Pipelines.Initialize.RegisterDataModelExtensions, Sitecore.Analytics.Automation.MongoDB" />
      </initialize>
    </pipelines>-->

In the same configuration, change enabled tag value of <processingPools> to false.

5.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Aggregation.Services.config, comment out these tags completely.
·         <automationAggregationSubsystem>
·         <hooks>

6.     In \Website\App_Config\Include\Sitecore.Analytics.Processing.Services.config, comment out these tags completely.

·         <hooks>

7.     In \Website\App_Config\Include\Sitecore.Analytics.Tracking.config, comment out these lines.

<!--<events>
      <event name="media:request">
        <handler type="Sitecore.Analytics.Media.MediaRequestEventHandler, Sitecore.Analytics" method="OnMediaRequest"/>
      </event>
    </events>-->


      <!--<httpRequestEnd>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics, Sitecore.Analytics" patch:before="processor[@type='Sitecore.Pipelines.PreprocessRequest.CheckIgnoreFlag, Sitecore.Kernel']"/>
      </httpRequestEnd>-->

      <!--<httpRequestProcessed>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics, Sitecore.Analytics"/>
      </httpRequestProcessed>-->
     
      <!--<initialize>
        <processor type="Sitecore.Analytics.Pipelines.Loader.InitializeAnalytics, Sitecore.Analytics" />
      </initialize>-->

      <!--<renderLayout>
        <processor type="Sitecore.Analytics.Pipelines.HttpRequest.StartAnalytics, Sitecore.Analytics" patch:before="processor[@type='Sitecore.Pipelines.RenderLayout.InsertRenderings, Sitecore.Kernel']" />
      </renderLayout>-->

      <!--<sessionEnd>
        <processor type="Sitecore.Analytics.Pipelines.SessionEnd.InitializeTracker, Sitecore.Analytics" patch:before="*" />
      </sessionEnd>-->

8.     In \Website\App_Config\Include\Sitecore.Analytics.Tracking.Database.config, comment out these lines.

      <!--<postSessionEnd>
        <processor type="Sitecore.Analytics.Pipelines.PostSessionEnd.CommitSession, Sitecore.Analytics" />
      </postSessionEnd>-->


    <submitQueue>
      <!--<backgroundService type="Sitecore.Analytics.SubmitQueueService, Sitecore.Analytics">-->
        <!-- Service wakeup interval in seconds. -->
        <!--<Interval>0</Interval>
      </backgroundService>-->

9.     Apart from these configuration changes, you can check each Sitecore analytics related configuration and set the timer to 00:00:00 for schedulers, background jobs etc.. 

No comments:

Post a Comment

Articles

Automatically create new version for Lock & Edit without workflow

Sitecore will create a new version on Lock and Edit if the item is tied to a workflow. For our case, version has to be created even withou...