Wednesday, November 30, 2016

Houston, we have a problem – Aysnc Service is down.. Unable to restart.


Houston, we have a problem – Aysnc Service is down.. Unable to restart.
After install Framework in CRM Database server and restart we Got a major problem Async Maintaince Service is down and failed to upload..

 
Error message:
  
Host XXX : 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.<>c__DisplayClassc.<RetrieveSqlServerName>b__a(Object[] values)

at Microsoft.Crm.Asynchronous.JobDataAccess.ExecuteSqlOrganizationScopeAndProcessRecords(IDbCommand command, Guid organizationId, RecordProcessor recordProcessor)

at Microsoft.Crm.Asynchronous.JobDataAccess.RetrieveSqlServerName(Guid orgId)

at Microsoft.Crm.Asynchronous.JobDataAccess.UpdateJobTargetServer(AsyncJob job)

at Microsoft.Crm.Asynchronous.JobDataAccess.GetNextJob(IList`1 orgsAvailableForMaintenance, DateTime startCycleTime, Int32 maxJobsToReturn)

at Microsoft.Crm.Asynchronous.JobDataAccess.GetNextJobInAppLock(IList`1 orgsAvailableForMaintenance, DateTime startCycleTime, Int32 maxJobsToReturn)

at Microsoft.Crm.Asynchronous.JobDataAccess.SelectJobs(DateTime startCycleTime, Int32 maxJobsToRetrieve)

at Microsoft.Crm.Asynchronous.JobManager.RetrieveAndQueueJobs()

at Microsoft.Crm.Timers.Timer.InvokeElapsedWithCancellationToken(Object state)

at Microsoft.Crm.Timers.Timer.InvokeElapsed()

at Microsoft.Crm.Timers.Timer.TimerProcessor.ExecuteTimers(Object data)

at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)

at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)

at System.Threading.ThreadHelper.ThreadStart(Object obj)


 

 steps to fould the reason:

  1. Use CRM Trace when try to restart the service got the error:

  2. crm 2011 failed while monitoring asynchronous operations queue. Exception: System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
  3. In CRM we have 3 organization , disabled specific one Async successs to restart.. then I checked MSCRM_Config – organization table looks perfect like all other organization..

  4. Backup problematic organization DB and remove the organization + try to import this organization got the next error message

The instance name must be the same as computer name.

 


The reason for this problem found by running this command @@servername in sql management…



How to solve:
 
 
 
select @@servername - result is NULL (should contain server name)

SP_DROPSERVER "SERVERDBNAME"

SP_ADDSERVER "SERVERDBNAME ", local


 
restart the MSSQLSERVER service



Async Maintanice servce back to life.
 
 
Enjoy,

Rami Heleg

+972-52-5695114
 

No comments:

Post a Comment