Updated April 16, 2008.
I’ll be writing a series of articles regarding the various issues that we have encountered while installing CRM 4.0 and migration CRM 3.0 to 4.0. We have found solutions and fixes for all of these. Hopefuly these articles will save you some time or tickets with Microsoft.
Article one – the dreaded “The Microsoft CRM Asynchronous Processing Service service terminated unexpectedly” service crashes.
After finaly installing CRM 4.0 and upgrading your organization, everything appears to be running OK. However, a small crm service called MSCRMAsyncService keeps crashing. The quick fix is to set the service to automatically restart after a crash and do this perpetually:

However, this is not a good fix as it will lead to a small memory lead that will eventually cause CRM to completely stop responding. This will also make your system log not very usable as it will be filled with service crashes and restart:

So what is the fix?
Here are the 3 action items should fix this if the issue is related to workflows being ’stuck’ or not running properly.
Action A. Set the MSCRMAsyncService to run as ‘local system’ instead of ‘network service’ account.

Action B. The MSCRMAsyncService is processing a workflow and for some reason it is crashing. These workflows are probably old, stuck, and perhaps missing some type of required resource. To identify these workflows, use the System Jobs in the Settings area.

Then created an advanced find view to search for ‘in progress’ or ‘waiting for resource’ workflow jobs.

Examine the actual workflow to see why they are not running properly. First, fix or stop the actual workflow that is not running properly. Then go back to this advanced find, and ‘cancel’ any in progress and ‘waiting for resources’ workflow that has been in this status for a while.

Depending on the number of running/stuck workflows that are being cancelled, this may take a while.
This alone may solve this issue. If it does not, then proceed to plan B.
Action C. So after having this blog post for a few weeks I received an email from Microsoft Support stating that Action C can cause major damage. Action C used to suggest to a full sql backup on the config database and the organization(s) database then delete dbo.WorkflowWaitSubscriptionBase, dbo.WorkflowLogBase, dbo.DuplicateRecordBase, and dbo.AsyncOperationBase. Do not do this as it could have side effects including stopping out of the box jobs such as duplicate detection jobs, contract state jobs, and full text catalog jobs.
Instead take a look at KB949844 and KB950680. These are two hotfixes related to the CRM Asynchronous job.
If this helps you, please let us know!!!

I have upgraded 3.0 to 4.0 and nothing is being delete from the DB. One example, incident.deletionstatecode is set to ‘2′ for 3 days now and there are no eror in the event log. I have re-started the Crm Async. Process. Any ideas?
Try to run the async service as local system account instead of the network service account.
Alex
Thanks for the idea but it made it worse. Work Flow stop working. After re-install 4.0 to reset to network service Work Flow still does not work. I will try to rebuild tonight.
Check to see if any workflows are ‘hung’. Is the workflow service keeps constantly crashing – clean out these tables:
DELETE FROM dbo.WorkflowWaitSubscriptionBase
DELETE FROM dbo.WorkflowLogBase
DELETE FROM dbo.DuplicateRecordBase
DELETE FROM dbo.AsyncOperationBase
Alex
Nice post. In CRM 3.0 can i use following script to delete old stuck/failed Workflow, because in Workflow monitor status shows as “Running”
DELETE FROM dbo.WorkflowWaitSubscriptionBase
DELETE FROM dbo.WorkflowLogBase
DELETE FROM dbo.DuplicateRecordBase
DELETE FROM dbo.AsyncOperationBase”
-Manish
Guys (Gals if we are out there)… Be careful deleting the contents of the four db’s as I have been on phone with Microsoft for almost 9 hours after I did it. They suggested not doing it. I must give Kudo’s to the MS team though (especially Tami). I will update this site if we figure out what happened. Thanks
I am unable to delete from the AsyncOperationBase. When I try, I get the following:
Msg 547, Level 16, State 0, Line 1
The DELETE statement conflicted with the REFERENCE constraint “AsyncOperation_BulkDeleteOperation”. The conflict occurred in database “AmericanProfitRecovery_MSCRM”, table “dbo.BulkDeleteOperationBase”, column ‘AsyncOperationId’.
The statement has been terminated.
Any suggestions?
Nevermind, I resolved it.
Tim – Please tell us! What resolution method(s) did you use?
well, everyone
Have any effects, after “DELETE dbo.DuplicateRecordBase” ?
Tim how did you resolve it?
I am trying to delete out part of my asynoperationbase table and am getting the same error. My table is huge and takeing up all the disk space on the server. 45,332.695 MB and counting.
Hi,
I am a newbie to Dynamics – one last thing I am unable to resolve following an installation for a client.
Environment:
Small Business Server 2008 (Premium Edition). Therefore SQL 2008 as well.
And yes, I know we should not run all the server roles on 1 box, but there are only 10 users, and it is a powerful server.
We have a problem with import jobs that just have a status of “waiting”. I have read and re-read the blogs and other posts, and so far none the wiser.
I have tried the following:
Installed Rollup 6 – no difference
Cancelled all the jobs via Settings -> system jobs, and deleted them
Re-created the small import job (5 records)
Help greatly appreciated,
Don
Hi Don,
First thing I’d try is to change the async service to run as ‘local system’.
Do other workflows run?
Did you change any iis settings (such as ports) after installin gms crm?
Alex
I have the same problem of Don, did you resolve the problem ??
Tony,
One thing to check would be to make sure that the Asynchronous Process service is running as ‘Local System’ rather than ‘Network Service.’ I have seen the Async service stop when it is checked as ‘Local System’
Changed Async to run as Local System, rebooted the server, and boom, thousands of stacked up workflows completed successfully. Thanks a million for this post!