8

I have the following exception appearing in my log files at a rate of 2-3 per second.

ERROR Cannot finish Analytics page tracking
Exception: Sitecore.Analytics.Exceptions.ContactLockException
Message: Failed to extend contact lease for contact c276821d-a524-419c-8bb5-7a952d1bb319
Source: Sitecore.Analytics
   at Sitecore.Analytics.Tracking.ContactManager.SaveAndReleaseContact(Contact contact)
   at Sitecore.Analytics.Pipelines.EndAnalytics.ReleaseContact.Process(PipelineArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Analytics.Pipelines.EndAnalytics.EndAnalyticsPipeline.Run()
   at Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics.Process(HttpRequestArgs args)

The contact Guid is the same every time.

I've found a blog post that describes a similar error, but we're not calling Tracker (or any Sitecore.Analytics code) explicitly in our solution.

5
  • 1
    do you have a scaled environment with CM and CD? Nov 24, 2016 at 12:06
  • 1
    yes - this is only happening on the CM server
    – NeilD
    Nov 24, 2016 at 12:06
  • 1
    can you check if Sitecore.Analytics.Tracking.Database.config is enabled on CM? Nov 24, 2016 at 12:09
  • @NeilD What Sitecore Climber's comment suggests is most definitely the reason. Normally, pure CM servers should not read and write xDB databases. On the other hand, if your CM is combined with another server role, then you should configure it properly. One thing to keep in mind is that, if the CM doesn't share session databases with your CDs, then it should have a different Analytics.ClusterName value configured. Nov 25, 2016 at 12:14
  • Thanks both. If one of you writes this up as an answer, I'll happily accept it.
    – NeilD
    Nov 25, 2016 at 15:13

2 Answers 2

8

Configuring a dedicated Content Management server

Normally, pure CM servers should not read and write interactions and contacts in the collection database. See this official documentation page for more information:

Configure a content management server

The easiest fix for you would be to disable the Sitecore.Analytics.Tracking.Database.config. In any case, make sure to follow the configuration documentation to the letter.

Combined server roles

Your CM can also be combined with another server role. In that case, keep in mind that if the CM doesn't share session databases with your CDs, then it must be considered a part of a separate cluster. This means that it should have the setting Analytics.ClusterName set to a different value.

Further reading:

1
  • @NielD What step exactly helped to fix this error
    – Sukhjeevan
    Dec 24, 2017 at 2:01
2

Sitecore has a proper fix for this issue

https://kb.sitecore.net/articles/640114

From the article:

A "failed to extend contact lease" error may occur if large amount of pages were requested within a single interaction.

The following exception can be found in the Sitecore XP log:

316 2017:12:10 16:05:50 ERROR Cannot finish Analytics page tracking
Exception: Sitecore.Analytics.Exceptions.ContactLockException
Message: Failed to extend contact lease for contact ce9c9d9e-2d42-4b82-a871-1a2dd96f050e
Source: Sitecore.Analytics
   at Sitecore.Analytics.Tracking.ContactManager.SaveAndReleaseContact(Contact contact)
   at Sitecore.Analytics.Pipelines.EndAnalytics.ReleaseContact.Process(PipelineArgs args)
   at (Object , Object[] )
   at Sitecore.Pipelines.CorePipeline.Run(PipelineArgs args)
   at Sitecore.Pipelines.DefaultCorePipelineManager.Run(String pipelineName, PipelineArgs args, Boolean failIfNotExists)
   at Sitecore.Analytics.Pipelines.EndAnalytics.EndAnalyticsPipeline.Run()
   at Sitecore.Analytics.Pipelines.HttpRequest.EndAnalytics.Process(HttpRequestArgs args)
Exception is thrown for each next page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.