"Failed to extend contact lease" exception may occur if large amount of pages are requested within a single interaction

  • Description

    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
  • Important notes

    The same error can be a result of an incorrect Session State configuration.

    Before applying the patch, ensure that both Shared Session State and Private Session State are configured properly according to the following documentation: Session state configuration scenarios.

    The Web API requests should be tracked properly.

    It is unusual for human visitors to view hundreds of pages during a single visit, but a page could initiate many Web API requests. You should ensure that the API requests are tracked properly. You could either disable tracking of such requests at all, or track them as page events for a previous page. For more information, see the following articles:

    https://doc.sitecore.com/developers/82/sitecore-experience-platform/en/use-mvc-routing.html

    https://doc.sitecore.com/developers/82/sitecore-experience-platform/en/register-a-page-event-programmatically.html

  • To fix the issue, apply a suitable patch from the list below (see the readme file inside the archive for installation instructions).

    For Sitecore XP 8.1 rev.151207 (Update-1) and 160302 (Update-2):

    https://sitecore.box.com/s/yopb7imktgxr56mbh3vwsne8t9dhq1ud

    For Sitecore XP 8.1 rev. 160519 (Update-3):

    https://sitecore.box.com/s/smxbq29k4kjev9ijasx4n03cdltx9v89

    For Sitecore XP 8.2 rev. 160729 (Initial Release) — 8.2 rev. 171121 (Update-6):

    https://sitecore.box.com/s/ygvt78g9c8co2rf0kmo6kqf8s94e9qp4

Applies to:

CMS 8.0 Initial Release - 8.2 Update-6

CMS 8.2 Update-7

September 21, 2018
September 21, 2018

Reference number:

198208