Skip to main content



No record found.

Microsoft Dynamics CRM forum
Suggested answer

CrmWRPCTokenKey expired - root cause?

Posted on by 3,079

This morning, I started getting the error "Current key (KeyType : CrmWRPCTokenKey) is expired".  After searching here, I found the steps to restart the async service, regenerate the key using "Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R", and then do an IISReset, and this worked.  However, I'd like to try to figure out why the key did not renew properly on its own.

The only things I could see about that were 1. expired trial license, which is not the case, 2. Async or async maintenance services not running, which they both were running just fine, or 3. an overly large async database (  However, running the count script at that link, I see it would only delete < 1000 records, which certainly doesn't seem to be anywhere near large enough to create issues.

Any ideas on where else I could look to track the root cause down?

ETA:  I checked the Application log in Event Viewer, and I can definitely see a bunch of the errors from the KeyGen source, saying it's expired.  Unfortunately, there are so many, I can't see back far enough in the log to the time they started.  (Which was apparently over a week ago - it says the key expired 10 days ago.  Not sure why we only started getting access problems this morning.)

  • SydWaters Profile Picture
    SydWaters 5 on at
    RE: CrmWRPCTokenKey expired - root cause?

    Disabling this test worked for us as well to remove the error log messages.

  • Suggested answer
    James Rees Profile Picture
    James Rees 115 on at
    RE: CrmWRPCTokenKey expired - root cause?


    I just thought it would be worth noting that we upgraded to dynamics 365 ( and found that on a windows Server 2016 we were getting these errors but with no adverse effects.  We have applied the XML file fix to prevent these rogue errors clogging up our event log and it looks to have fixed the issue.

    The Fix the MS suggested.

    Create a file called TestsToExclude.xml, and include the following:




                    <Test isDisabled="true">VerifyActiveCrmKeys</Test>




    Place this file in the following location: C:\Program Files\Microsoft Dynamics CRM\Monitoring.


    The service does not need to be restarted, it will read this .xml the next time the test runs (which by default is every 15 minutes).  You can validate this was successful by noticing the Event Viewer traffic is gone, but you can also validate by opening the latest Monitoring result file from C:\Program Files\Microsoft Dynamics CRM\Monitoring\results.  If you have properly stopped the faulty test, you will see the following in the results:






              <Title>Verify active crm keys exist for the deployment.</Title>








                  <Line>Skipped monitoring test VerifyActiveCrmKeys because it is marked as disabled in TestsToExclude.xml in the Monitoring directory</Line>






              <MonitoringTestRunCollection />




    I would say that I was only willing to apply this fix as Microsoft stated that these errors were erroneous and our testing found no issues.

  • Suggested answer
    Patrick Friedrich Profile Picture
    Patrick Friedrich 395 on at
    RE: CrmWRPCTokenKey expired - root cause?

    We finally fixed it using MS Support after long sessions together:

    In the event viewer log you should see some messages that the CrmWRPCTokenKey expired. That´s because the new key wasnt generated correctly or CRM is reffering to any older key which already expired and try to use the old one. Both scenarios doesn´t make sense and might be the reason for the issue.

    So you should open a ticket with MS Support, explain the problem and also refer to this thread. I can give you the ticket number REG:218030717766722002 "Collaboration - Plattform - underlying Problem causing : ON-PREM SSS not working, Active Key expired" to get in touch with the same architects again. They provided a XML file which we had to install on the SQL-Server to fix the problem. Since like 5 months the problem didnt occur anymore.

  • Gerald Gut Profile Picture
    Gerald Gut 50 on at
    RE: CrmWRPCTokenKey expired - root cause?

    Hi Community,

    also on our environments we have this issues. But only for multi-server environment setup.

    On an All-in-one server environment, this issue do not appear.

    I did a manual token deletion in the database and the error was gone. 

    Unfortunately, only until next maintenance where I needed to execute server restarts.

    My feeling is, that due to server restart, CRM KeyGeneration is not executed properly. Or because of connection lost the key regeneration / cleanup gets in troubles.

    But this is only a feeling and cannot be justified by facts.

    Another reason can be another Win Update which causes side affects as we had also during previous update installations.

    As these messages do not create any failure on CRM side and valid Keys are generated, this issue is not on high priority anymore on my side.

    I am hoping that this issue will be gone with next CRM version release, but we will never know until trying.

    In case anyone finds a solution to this, please let me know. I am running out of possibilities to fix this.

    Best regards,


  • Allie_B Profile Picture
    Allie_B 64 User Group Leader on at
    RE: CrmWRPCTokenKey expired - root cause?

    Is there an updated link for this workaround? I get an error, "This page can’t be displayed".

  • Allie_B Profile Picture
    Allie_B 64 User Group Leader on at
    RE: CrmWRPCTokenKey expired - root cause?

    We get this error, too. We already rolled back the update KB3186539 RE: .NET Framework but want new functionality. We'll have to try the  "Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R" with IIS reset. Thanks for posting this!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CrmWRPCTokenKey expired - root cause?

    Disregard, the errors came back after 24 hours :/

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CrmWRPCTokenKey expired - root cause?

    I manage multiple 365 On-Prem deployments running on Windows Server 2012.  After I uninstalled KB3186539 from the server running the asynchronous role, the key expiration warning went away.  Hope that helps someone.

  • jphoekstra Profile Picture
    jphoekstra 20 on at
    RE: CrmWRPCTokenKey expired - root cause?

    This has been my experience also. The keys in the database are correct, but the monitoring service indicates expired keys. I tried all of the suggestions on this list without any change. Last week I scheduled a daily task to restart the MSCRMMonitoringService 20 minutes after the CRMTicketKey expires. This gives me one 18702 error a day. If this magically gets fixed, I'll hopefully catch that the error is missing and I can cancel the scheduled task. In the meantime my event log is not flooded with these errors so I can catch real problems.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: CrmWRPCTokenKey expired - root cause?

    Same stuff here, ran Microsoft.Crm.Tools.WRPCKeyRenewal.exe /R then restarted both Async Processing services and IISReset, no luck with that. So, we tried to manually clean up the MSCRM_CONFIG.CrmKeySetting and MSCRM_CONFIG.CrmKey tables of stale tokens using SQL statement as described here: then restarted the Application server, and the errors went away.

    Unfortunately, still no idea on what caused them to suddenly start appearing. Also afraid of not knowing whether they're gonna be back or not. Will definitely ask putting monitoring over server's EventViewer to catch and report 18949 / 18962 EventIDs.

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .


André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,696 Super User

Martin Dráb Profile Picture

Martin Dráb 225,490 Super User

nmaenpaa Profile Picture

nmaenpaa 101,148


Featured topics

Product updates

Dynamics 365 release plans