Epicor Error Query Failed to Run

I have rebooted, cleared client cache & recycled app pool. Can anyone give further advice on these errors:
Client side Business Logic Error:

An error occurred when trying to load or compile project 'TI_TRAILER', please review and correct any errors. 
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while reading from the store provider's data reader. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Lock request time out period exceeded.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.HandleReaderException(Exception e)
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
   at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TArg2,TResult](TArg0 arg0, TArg1 arg1, TArg2 arg2)
   at Epicor.Data.DBExpressionCompiler.GetResult[TDataContext,TQuery,TResult](Func`3 executeQuery, Cache cacheSetting, TDataContext dataContext, TQuery query) in C:\_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 445
   at Epicor.Data.DBExpressionCompiler.InvokeSingle[TDataContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TDataContext dataContext, Func`2 getDataCacheKey, Func`2 compileQuery, Func`3 executeQuery) in C:\_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 306
   at Epicor.Data.DBExpressionCompiler.<>c__DisplayClass34_0`4.<Compile>b__0(TContext context, TArg1 arg1, TArg2 arg2) in C:\_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.Generated.cs:line 1110
   at Erp.Internal.PC.Configuration.RuleEngine.RuleEngine`2.InitializeHedAndDtlTables(LinqRow TargetEntityRow, LinqRow HeaderEntity) in C:\_Releases\ERP\UD10.2.400.9\Source\Server\Internal\PC\Configuration\RuleEngine\RuleEngine.cs:line 452
   at Erp.Internal.PC.Configuration.RuleEngine.RuleEngine`2..ctor(ErpContext Db, IConfiguration configuration, Boolean trackResults, Boolean testMode) in C:\_Releases\ERP\UD10.2.400.9\Source\Server\Internal\PC\Configuration\RuleEngine\RuleEngine.cs:line 140
   at Erp.Internal.Cfg._TI_TRAILER.VER71._TI21_RuleEngine..ctor(ErpContext Db, IConfiguration configuration, Boolean trackResults, Boolean testMode)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Erp.Internal.PC.ECFFacade.GetPCCustomization[TCustomization](ErpContext ctx, String customizationTarget, Object[] args) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\PC\ConfiguratorResolver\ECFFacade.cs:line 25
   at Erp.Internal.PC.ConfigurationResolver.ResolveMethodRuleEngine(IConfiguration configuration, PartRev partRevRow, Guid testID, Boolean trackResults, Boolean testMode) in C:\_Releases\ERP\ERP10.2.400.0\Source\Server\Internal\PC\ConfiguratorResolver\ConfigurationResolver.cs:line 246

Server side:
C:_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 301
(ctx, company_ex, quoteNum_ex) => ctx.QuoteHed.With(UpdLock).Where(row => ((row.Company == company_ex) AndAlso (row.QuoteNum == quoteNum_ex))).FirstOrDefault()

Query failed to run
System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while reading from the store provider's data reader. See the inner exception for details. ---> System.Data.SqlClient.SqlException: Lock request time out period exceeded.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 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()
   --- End of inner exception stack trace ---
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.HandleReaderException(Exception e)
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.StoreRead()
   at System.Data.Entity.Core.Common.Internal.Materialization.Shaper`1.SimpleEnumerator.MoveNext()
   at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
   at System.Data.Entity.Core.Objects.CompiledQuery.ExecuteQuery[TResult](ObjectContext context, Object[] parameterValues)
   at System.Data.Entity.Core.Objects.CompiledQuery.Invoke[TArg0,TArg1,TArg2,TResult](TArg0 arg0, TArg1 arg1, TArg2 arg2)
   at Epicor.Data.DBExpressionCompiler.GetResult[TDataContext,TQuery,TResult](Func`3 executeQuery, Cache cacheSetting, TDataContext dataContext, TQuery query) in C:\_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 445
   at Epicor.Data.DBExpressionCompiler.InvokeSingle[TDataContext,TQuery,TResult](Expression expression, Cache currentCacheSetting, Boolean cacheQuery, TDataContext dataContext, Func`2 getDataCacheKey, Func`2 compileQuery, Func`3 executeQuery) in C:\_Releases\ICE\ICE3.2.400.0\Source\Framework\Epicor.System\Data\DBExpressionCompiler.cs:line 301
(ctx, company_ex, quoteNum_ex) => ctx.QuoteHed.With(UpdLock).Where(row => ((row.Company == company_ex) AndAlso (row.QuoteNum == quoteNum_ex))).FirstOrDefault()

Doesn’t look like you’re using AndAlso properly.

Edit

Should the .Where clause just be:
.Where(row => row.Company == company_ex AND row.QuoteNum == quoteNum_ex)

1 Like

Something is bad in your Configurator Rule, perhaps some logic.

Erp.Internal.Cfg._TI_TRAILER.VER71._TI21_RuleEngine
1 Like

Well, yes and no, logic was fine, but the some of the input data had a ’ ’ (space) in the part number so hard to see in lookup table kept causing crashes. It really don’t like spaces in part numbers. :exploding_head:

@ckrusen & @hasokeric Thank you both for lookin!

Ok, so I FINALLY found the culprit for these weird glitchy errors!

It was due to configurator field values being limited to 50 characters. Go figure. The original Value being stored was the description and some are 80 ish characters. This was really upsetting to the DB serializer and storage engine.

Original Thoughts WRONG!

Original Thoughts

I was gifted a semi working configurator and never realized the underlying dataset fields were length limited. I have since updated the logic and methodology for populating the option combo boxes to come from BAQ dataset stored in UD table which are attached to the (25) ultracombos as datasets so now it does not query on every option choice either. You can find how I update sibling fields using the columns within the combobox here.

New Reasoning:
I was tasked with changing MoM’s by removing operations and turning them into Phantoms without operations. When doing this for any part marked as ‘Pull as Asm’ or ‘Plan as Asm’ this would flake out the BO Engine & Save conditions within the Configurator between pages and on Exit but would not give any error and looked like there was a programming error in the configurator by the errors that popped up after timing out from update lock.

Make sure any Phantom BOM without operations and is NOT marked as Pull or Plan as assembly.

This fix has cured the freezes and errors.