MS CRM 2011 system too slow: COMMIT - System.Data.SqlClient.SqlException (0x80131904): Internal Query Processor Error
-
Thursday, May 03, 2012 11:24 AM
Hi All,
I am continuously getting the following exception in my event CRM logs(traces). I have checked (using SQL query) the AsyncOperationBase Table but I was unable to find any AsyncOperation by id 5c92fdb4-3442-43b0-96dc-4c44ac8c584e.
I have disabled all workflows in the system but error still keeps showing up in the logs almost every minute.
I will appreciate any help to pin the problem’s root cause or any help or pointer in getting this resolved.
Few more facts:
The system has been working without any issues for almost last eight months. We noticed system being too slow since last one or two days only.
Exception trace in the log:
>SERVERNAME.MSCRMAsyncService.5c92fdb4-3442-43b0-96dc-4c44ac8c584e: Exception while trying to execute query:
SET DEADLOCK_PRIORITY LOW
BEGIN TRANSACTION
DECLARE @res INT
EXEC @res = sp_getapplock
@Resource = 'AsyncService_app_lock',
@LockMode = 'Exclusive'
IF @res NOT IN (0, 1)
BEGIN
RAISERROR ( 'Unable to acquire App Lock', 16, 1 )
END
ELSE
BEGINWith TopSuspendedAsyncOperations(AsyncOperationId)
AS
(
Select Top(@numberOfSuspendedOperationsToSelect) AsyncOperationId
from AsyncOperationBase o1
where
StateCode = @suspendedState
and ((PostponeUntil is NULL) or (PostponeUntil <= @modifiedOn))
and ((DependencyToken is NULL) or (not exists (
select AsyncOperationId
from AsyncOperationBase o2
where
o2.Sequence < o1.Sequence
and o2.DependencyToken = o1.DependencyToken
and o2.RecurrencePattern is null
and o2.StateCode in (@readyState,@lockedState,@suspendedState))))
)
update AsyncOperationBase
set
StateCode = @readyState,
StatusCode = @waitingStatus,
ModifiedOn = @modifiedOn,
ModifiedBy = CreatedBy
From AsyncOperationBase join TopSuspendedAsyncOperations on
AsyncOperationBase.AsyncOperationId = TopSuspendedAsyncOperations.AsyncOperationIdEXEC @res = sp_releaseapplock
@Resource = 'AsyncService_app_lock'
END
COMMIT - System.Data.SqlClient.SqlException (0x80131904): Internal Query Processor Error: The query processor encountered an unexpected error during execution.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
at Microsoft.Crm.Asynchronous.DataAccessSharedBase.ExecuteSqlCommand(IDbCommand command, Nullable`1 expectedAffectedRecords)
[2012-05-03 21:09:13.995] Process:CrmAsyncService |Organization:d5d05d96-3675-421d-b5b7-ebe2fe481989 |Thread: 18 |Category: Platform.Workflow |User: 00000000-0000-0000-0000-000000000000 |Level: Error | AsyncEventLogHelper.LogOrganizationFailure
at AsyncEventLogHelper.LogOrganizationFailure(CrmEventLog eventLog, IOrganizationConfiguration orgConfiguration, Exception exception)
at QueueManager.ExecuteForAllOrganizations(OrganizationQueueDataAccessHandler handler)
at Timer.InvokeElapsedWithCancellationToken(Object state)
at ExecutionContext.runTryCode(Object userData)
at RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
at ThreadPoolWorkQueue.Dispatch()
at _ThreadPoolWaitCallback.PerformWaitCallback()
>Received SQL Exception accessing organization {D5D05D96-3675-421D-B5B7-EBE2FE481989}. Exception: System.Data.SqlClient.SqlException (0x80131904): Internal Query Processor Error: The query processor encountered an unexpected error during execution.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning()
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at Microsoft.Crm.CrmDbConnection.InternalExecuteWithRetry[TResult](Func`1 ExecuteMethod, IDbCommand command)
at Microsoft.Crm.CrmDbConnection.InternalExecuteNonQuery(IDbCommand command, Boolean capturePerfTrace)
at Microsoft.Crm.CrmDbConnection.ExecuteNonQuery(IDbCommand command, Boolean impersonate, Boolean capturePerfTrace)
at Microsoft.Crm.Asynchronous.DataAccessSharedBase.ExecuteSqlCommand(IDbCommand command, Nullable`1 expectedAffectedRecords)
at Microsoft.Crm.Asynchronous.QueueDataAccess.MoveSuspendedToReady()
at Microsoft.Crm.Asynchronous.QueueManager.<>c__DisplayClassf.<OnMoveSuspendedToReadyTimerEvent>b__e(IQueueDataAccess queueDataAccess, IOrganizationConfiguration orgConfig)
at Microsoft.Crm.Asynchronous.QueueManager.ExecuteForAllOrganizations(OrganizationQueueDataAccessHandler handler)
-Devashish
http://thecrmworld.wordpress.com
http://ebizartisans.com- Edited by Devashish Bajpai Thursday, May 03, 2012 11:49 AM
All Replies
-
Saturday, May 12, 2012 8:18 PM
Hello Devashish Bajpai:
Try to check the service account by which the CRM Async services are running on server. If the password of that account is changed then it may be the cause of service not working fine.
Saurabh Gupta, MS CRM 2011 Software Development Engineer
-
Saturday, May 12, 2012 8:33 PM
Devashish,
What version of SQL Server are you on? Does this issue generally comes up when SQL Server is on high pressure of memory?
If you are on SQL Server 2008, please have a look at this support link.
http://support.microsoft.com/kb/978190
Dimaz Pramudya - CRM Developer - CSG (Melbourne) www.xrmbits.com http://twitter.com/xrmbits
-
Sunday, May 13, 2012 3:08 AM
Hi Saurabh,
Other organizations are working fine so I dont think that this is a Service Password issue.
-Devashish
http://thecrmworld.wordpress.com
http://ebizartisans.com -
Sunday, May 13, 2012 3:20 AM
Hi Dimaz,
I am using Microsoft SQL Server 2008 R2 (RTM) - 10.50.1617.0 (X64). The log entry appears every 1 min. The SQL Server is a on a development machine so I dont think its is about load. I had enabled SQL Profiling (SQL Query logs) and found that the transaction role back due to either a deadlock or record not being there.
-Devashish
http://thecrmworld.wordpress.com
http://ebizartisans.com -
Monday, May 14, 2012 5:26 AM
Hello Devashish Bajpai:
If there is no issue with Service account, then I think the workflow execution in your organization is having resource lock while execution.
This may appear if so many workflows are execution at the same time or some workflows are having infinite time of execution. Hence you will be needing automation of CRM workflow.
Refer this link: http://workflowautomation.codeplex.com/
Let me know if this is any help for you.
Saurabh Gupta, MS CRM 2011 Software Development Engineer
-
Monday, May 14, 2012 7:11 AM
Hi Saurabh,
Thanks for the advice. But I have deleted all worflows from the system and still i am getting the error.
-Devashish
http://thecrmworld.wordpress.com
http://ebizartisans.com