We are encountering the following error in the AP Invoice Balance standard report in the classic version. Could you please provide a solution if anyone has faced this issue before?
Program Ice.Services.Lib.RunTask when executing task 1491160 raised an unexpected exception with the following message: RunTask:
System.Data.Entity.Core.EntityCommandExecutionException: Calling ‘Read’ when the data reader is closed is not a valid operation.
—> System.Data.SqlClient.SqlException (0x80131904): Cannot continue the execution because the session is in the kill state.
A severe error occurred on the current command. The results, if any, should be discarded.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action1 wrapCloseInAction) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) at System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) at System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) at System.Data.SqlClient.SqlDataReader.Read() at System.Data.Entity.Core.Common.Internal.Materialization.Shaper
1.StoreRead()
ClientConnectionId:00f693d2-f3f2-4bad-8183-cdffe3da42ba
Error Number:596,State:1,Class:21
— End of inner exception stack trace —
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper1.HandleReaderException(Exception e) at System.Data.Entity.Core.Common.Internal.Materialization.Shaper
1.StoreRead()
at System.Data.Entity.Core.Common.Internal.Materialization.Shaper1.SimpleEnumerator.MoveNext() at System.Data.Entity.Internal.LazyEnumerator
1.MoveNext()
at System.Collections.Generic.List1..ctor(IEnumerable
1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at Epicor.Data.DBExpressionCompiler.GetResult[TDataContext,TQuery,TResult](Func
3 executeQuery, Cache cacheSetting, TDataContext dataContext, TQuery query) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 414
at Epicor.Data.DBExpressionCompiler.InvokeList[TDataContext,TQuery,TResult](Operation operation, Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TDataContext dataContext, String callingMethod, Func2 getDataCacheKey, Func
2 compileQuery, Func3 executeQuery) at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass30_0
11.b__0(TDataContext dataContext, TArg1 arg1, TArg2 arg2, TArg3 arg3, TArg4 arg4, TArg5 arg5, TArg6 arg6, TArg7 arg7, TArg8 arg8, TArg9 arg9) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 347
at Erp.Internal.AP.APInvBalance.SelectAPInvoiceBalances(String company, String range, String PIOption, Nullable1 beginDate, Nullable
1 endDate, Boolean includeDM, String VendNumList, String VendGrupList, Boolean GetVendor) in C:_releases\ERP\ERP11.3.200.0\Source\Server\Internal\AP\APInvBalance\APInvBalance.Queries.cs:line 837
at Erp.Internal.AP.APInvBalance.ProcessAPInvoices() in C:_releases\ERP\ERP11.3.200.0\Source\Server\Internal\AP\APInvBalance\APInvBalance.cs:line 1358
at Erp.Internal.AP.APInvBalance.RunProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ERP\ERP11.3.200.0\Source\Server\Internal\AP\APInvBalance\APInvBalance.cs:line 1334
at Ice.Core.TaskBase`1.StartProcess(Int64 instanceTaskNum, String outputFileName) in C:_releases\ICE\ICE4.3.200.4\Source\Server\Internal\Lib\TaskLib\TaskBase\TaskBase.cs:line 84
at Ice.Hosting.TaskCaller.InnerExecuteTask(IceDataContext newContext) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 113
at Ice.Hosting.TaskCaller.ExecuteTask() in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 61
at Ice.Hosting.TaskCaller.ExecuteTask(IceDataContext dataContext, Boolean suppressTransaction) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Framework\Epicor.Ice\Hosting\TaskCaller\TaskCaller.cs:line 41
at Ice.Services.Lib.RunTaskSvc.<>c__DisplayClass30_2.b__1() in C:_releases\ICE\ICE4.3.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 460
at Ice.Lib.RunTask.BpmFriendlyTaskLauncher.Run(String sessionIdPrefix, IceContext db, Action taskRunner) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Services\Lib\RunTask\BpmFriendlyTaskLauncher.cs:line 57
at Ice.Services.Lib.RunTaskSvc.InnerRunTask(Int64 ipTaskNum, Boolean suppressTransaction) in C:_releases\ICE\ICE4.3.200.0\Source\Server\Services\Lib\RunTask\RunTask.cs:line 471