03/09/2012

CRM key Error: Current key (KeyType : CrmWRPCTokenKey) is expired. This can indicate that a key is not being regenerated correctly.

Accessing to any of the available orgs on CRM 2011, was throwing an error message.

CRM architecture:


The error message trying to browse CRM 2011 from client:


The error message on browsing locally (from inside one of the CRM servers)

Log file warning:
Exception information:
    Exception type: CrmException
    Exception message: The key specified to compute a hash value is expired, only active keys are valid.  Expired Key : CrmKey(Id: -- guid here --, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:07/30/2012 00:48:28, ExpiresOn:09/01/2012 00:48:28, CreatedOn:07/30/2012 00:48:28,
CreatedBy:--crm user here --   at Microsoft.Crm.CrmKeyService.ComputeHash(CrmKey key, Guid scaleGroupId, HashParameterBase[] parameters)
   at Microsoft.Crm.Application.Security.WrpcContext..ctor()
   at Microsoft.Crm.Application.Controls.AppPage.ValidateWrpcContext()
   at Microsoft.Crm.Application.Controls.AppPage.OnInit(EventArgs e)
   at System.Web.UI.Control.InitRecursive(Control namingContainer)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Or log error

Current key (KeyType : CrmWRPCTokenKey) is expired.  This can indicate that a key is not being regenerated correctly.  Current Key : CrmKey(Id: -- guid here --, ScaleGroupId:00000000-0000-0000-0000-000000000000, KeyType:CrmWRPCTokenKey, Expired:True, ValidOn:07/30/2012 00:48:28, ExpiresOn:09/01/2012 00:48:28, CreatedOn:07/30/2012 00:48:28, CreatedBy:--crm user here --.

How to solve:

1-Make sure "Microsoft CRM Asynchronous Processing Service" is running.(start>run type services.msc)
2-Execute Microsoft.Crm.Tools.WRPCKeyRenewal.exe with parameter /R ( Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R ) from
:\ \Microsoft Dynamics CRM\Tools ( for example - C:\Program Files\Microsoft Dynamics CRM\Tools )

Why this happend? No Idea!


Update: On December 2011 a ticket has been lodged with Microsoft regarding this problem. Microsoft advised the token key is being generated by Async (Maintenance) service. The service has been stopped on both CRM servers. Starting Async (Maintenance) service fixed the issue permanently.

10 comments:

  1. Thank you, thank you, thank you ...

    ReplyDelete
  2. This worked to fix the same problem in CRM Dynamics 2013. The only additional thing was I had to do an iisreset afterwards.

    ReplyDelete
  3. Thanks Adam, I later on asked a Microsoft consultant regarding this and he recommended to make sure Async (Maintenance service) is always running as internally, it will renew the key in addition to other jobs it has.

    ReplyDelete
  4. Same issue here but a different root cause I think. The issue was related to our Async server restarting as a result of updates being installed. On reboot, the Async services failed to start. Just needed to go in and restart the services and everything came back without any error. Big kudos for this post as it led us to the resolution related to the Async services.

    ReplyDelete
  5. That saved my day, thanks a lot

    ReplyDelete