locked
Asynchronous Service will not start RRS feed

  • Question

  • Until two days ago this service was running fine.  Now I cannot manually or automatically start the service.  Each time an attempt is made I am presented with the following error.

    "Could not start the Microsoft CRM Asynchronous Processing Service service on Local Computer.

    Error 1067: The process terminated unexpectedly."

    We have installed on the server .Net Framework 3.0 SP2 and .Net Framework 3.5 SP1

    I have tried using both Local System account and a Network account to Log On.

    I have been unable to find any more detailed information.  Could anyone provide some assistance please?

     

     

     

    Thursday, July 21, 2011 3:34 PM

Answers

  • To resolve this I had to simply restart the SQL Server. 
    Wednesday, July 27, 2011 3:50 PM

All replies

  • Hi,

    Try running service with account having administrator privleges to MS CRM database and local system. Also give a try by changing the Service login account to CRM deployment adminsitraor account.

    Try also check in event viewer for exact error details.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Thursday, July 21, 2011 4:49 PM
  • You should enable tracing as shown here http://support.microsoft.com/kb/907490 if the you do not get more detail then set tracing at Verbose Level using the TraceCetegories reg setting.

     


    MS CRM Bing'd - http://bingsoft.wordpress.com
    Useful Tools  CRM 4 to CRM 2011 JavaScript Converter Tool
    CRM 2011 OData Query Designer
    CRM Forum Guidance on how to Help Us Help You
    • Proposed as answer by Jim Glass Jr Thursday, July 21, 2011 6:29 PM
    Thursday, July 21, 2011 4:51 PM
    Moderator
  • Hi,

    Try running service with account having administrator privleges to MS CRM database and local system. Also give a try by changing the Service login account to CRM deployment adminsitraor account.

    Try also check in event viewer for exact error details.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".

    I have checked and tested with all accounts but this fails regardless of account level.
    Friday, July 22, 2011 7:51 AM
  • Have you tried tracing as I mentioned earlier, it should give you the best detail on the issue.
    MS CRM Bing'd - http://bingsoft.wordpress.com
    Useful Tools  CRM 4 to CRM 2011 JavaScript Converter Tool
    CRM 2011 OData Query Designer
    CRM Forum Guidance on how to Help Us Help You
    Friday, July 22, 2011 8:38 AM
    Moderator
  • Have you tried tracing as I mentioned earlier, it should give you the best detail on the issue.
    MS CRM Bing'd - http://bingsoft.wordpress.com  
    Useful Tools  CRM 4 to CRM 2011 JavaScript Converter Tool
      CRM 2011 OData Query Designer
    CRM Forum Guidance on how to Help Us Help You


    This is what I can now see.

    Event Type: Error
    Event Source: MSCRMAsyncService
    Event Category: None
    Event ID: 17411
    Date:  22/07/2011
    Time:  08:55:41
    User:  N/A
    Computer: CRM2
    Description:
    Host CRM2: failed while monitoring asynchronous operations queue. Exception: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
       at Microsoft.Crm.Asynchronous.JobDataAccess.RetrieveSqlServerName(Guid orgId)
       at Microsoft.Crm.Asynchronous.JobDataAccess.SelectJob(DateTime startCycleTime)
       at Microsoft.Crm.Asynchronous.JobManager.OnOrgDatabaseMaintenanceTimerEvent(Object sender, ElapsedEventArgs e)
       at Microsoft.Crm.Asynchronous.Timer.InvokeElapsed()
       at Microsoft.Crm.Asynchronous.Timer.TimerProcessor.ExecuteTimers(Object data)
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart(Object obj)

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Friday, July 22, 2011 2:52 PM
  • Hi,

    Try tracing the table (Run SQL Profiler as mentioned in the following post and then start Async service, http://blogs.msdn.com/b/emeadcrmsupport/archive/2011/03/01/create-a-crm-profiler-template-and-trace-for-crm-issues.aspx) if where exactly the error is occuiring.


    Jehanzeb Javeed

    http://worldofdynamics.blogspot.com
    Linked-In Profile |CodePlex Profile

    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer".
    Friday, July 22, 2011 3:11 PM
  • So this has now helped to narrow down the problem to "Exception while executing async service: MSCRMAsyncService - System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'."

    I am trying to find out if there is a workflow with a missing primary attribute but cannot see how to easily do this.  The MS knowledge base again isn't very helpfull.

     

    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | Timer.Start
    >Starting timer 'State and Status Update' with 5000 millisecond interval
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:   16(MSCRM:-TimerProcessor.ExecuteTimers) |Category: Platform.Sql |User: 00000000-0000-0000-0000-000000000000 |Level: Info | CrmDbConnection.InternalExecuteNonQuery
    >update AsyncOperationBase
    set
     StateCode =
      case StatusCode
       when 22 then 3
       when 21 then 1
       else 0
      end,
     StatusCode =
      case StatusCode
       when 22 then 32
       when 21 then 10
       else 0
      end,
     ModifiedOn = DATEADD(MILLISECOND, -1*DATEPART(MILLISECOND, GETUTCDATE()), GETUTCDATE()),
     ModifiedBy = CreatedBy
    where
     ModifiedOn < '07/25/2011 08:15:36'
     and StateCode = 2
     and DeletionStateCode = 0
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | TimerProcessor.StopTimerThread
    >Stopping timer thread: 16
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:   13 |Category: Platform.Sql |User: 00000000-0000-0000-0000-000000000000 |Level: Info | CrmDbConnection.FillDataSet
    >select * from Attribute where InProduction = 1 order by CustomizationLevel asc
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | TimerProcessor.StartTimerThread
    >Started timer thread: 17
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Info | AsyncManagerBase.StartMonitoring
    >MGI-CRM2.MSCRMAsyncService.7b37dad9-ea1a-49f2-b6eb-f9997e2a1b18: Entering StartMonitoring
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | Timer.Start
    >Starting timer 'CRM Organizations db Maintenance' with 300000 millisecond interval
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | TimerProcessor.StopTimerThread
    >Stopping timer thread: 17
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | TimerProcessor.StartTimerThread
    >Started timer thread: 18
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | Timer.Start
    >Starting timer 'CRM Organizations db Maintenance timeout' with 1800000 millisecond interval
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:    4 |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Verbose | TimerProcessor.StopTimerThread
    >Stopping timer thread: 18
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:   18(MSCRM:-TimerProcessor.ExecuteTimers) |Category: Platform.Sql |User: 00000000-0000-0000-0000-000000000000 |Level: Info | CrmDbConnection.InternalExecuteReader
    >SELECT distinct OrganizationId FROM ScaleGroupOrganizationMaintenanceJobs where State=1
    [2011-07-25 09:20:36.2] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:   18(MSCRM:-TimerProcessor.ExecuteTimers) |Category: Platform.Sql |User: 00000000-0000-0000-0000-000000000000 |Level: Info | CrmDbConnection.InternalExecuteReader
    >SELECT  LOWER(@@servername)
    [2011-07-25 09:20:36.3] Process:CrmAsyncService |Organization:00000000-0000-0000-0000-000000000000 |Thread:   18(MSCRM:-TimerProcessor.ExecuteTimers) |Category: Platform.Async |User: 00000000-0000-0000-0000-000000000000 |Level: Error | AsyncService.OnUnhandledException
    >Exception while executing async service: MSCRMAsyncService - System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
       at Microsoft.Crm.Asynchronous.JobDataAccess.RetrieveSqlServerName(Guid orgId)
       at Microsoft.Crm.Asynchronous.JobDataAccess.SelectJob(DateTime startCycleTime)
       at Microsoft.Crm.Asynchronous.JobManager.OnOrgDatabaseMaintenanceTimerEvent(Object sender, ElapsedEventArgs e)
       at Microsoft.Crm.Asynchronous.Timer.InvokeElapsed()
       at Microsoft.Crm.Asynchronous.Timer.TimerProcessor.ExecuteTimers(Object data)
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart(Object obj)
    # CRM Tracing Version 2.0
    # LocalTime: 2011-07-25 09:21:22.1
    # Categories: *:Verbose
    # CallStackOn: No
    # ComputerName: MGI-CRM2
    # CRMVersion: 4.0.7333.3414
    # DeploymentType: OnPremise
    # ScaleGroup:
    # ServerRole: AppServer, AsyncService, DiscoveryService, WebService, ApiServer, HelpServer, DeploymentService

    Monday, July 25, 2011 9:11 AM
  • It looks to me like the problem is that a query to find a server name is returning a null. As far as I know, the server names are only stored in the MSCRM_Config database, which would indicate trying the following:

    • Run Deployment Manager, and see what information it gives regarding Servers. If it looks like something is missing, you may be able to correct it here (you may need to temporarily disable the organisation to allow you to make changes)
    • If you have a recent backup of the MSCRM_Config database from when the Async service worked, then you could try restoring this (though take a backup of the current one). However, check if any CRM users had been added since that backup, as you can cause yourself problems with a mismatch of data in the MSCRM_Config and organisation databases
    • You could try running a repair installation - I'm not sure if it can repair data in MSCRM_Config, but it's a little quicker than the final option...
    • ...Backup all organisation databases, uninstall CRM. Reinstall CRM (this will rebuild MSCRM_Config), then import the backedup organisation databases

    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Monday, July 25, 2011 10:44 AM
    Moderator
  • To clarify - as I cant seem to post the table properly - the only NULL fields are:

    'location'

    'provider_string'

    'catalog'

    'collation_name'

    Monday, July 25, 2011 10:48 AM
  • To resolve this I had to simply restart the SQL Server. 
    Wednesday, July 27, 2011 3:50 PM
  • This did not work for me (Restarting SQL Server) any other thoughts?
    Friday, September 29, 2017 6:03 PM