# Problem with updating product

**URL:** <https://forum.litium.com/t/problem-with-updating-product/1705>\
**Category:** Questions\
**Tags:** litium-6\
**Created:** [October 19, 2020, 8:37am UTC](https://forum.litium.com/t/problem-with-updating-product/1705 "2020-10-19T08:37:22Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![krilin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/krilin/32/175_2.png) [@krilin](https://forum.litium.com/u/krilin)\
**Post date:** [October 19, 2020, 8:37am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/1 "2020-10-19T08:37:22Z")

</div>

Hi!

Our customer are from time to time experiencing trouble with updating product. At this time it works fine for us. The execption in the log is:

```
IWebLog exception 'An error occurred while updating the entries. See the inner exception for details.': 930489c9-b92d-4ee3-84a0-63966b1a7755

```

Litium.Data.DataException: An error occurred while updating the entries. See the inner exception for details. —\> Microsoft.EntityFrameworkCore.DbUpdateException:  
An error occurred while updating the entries. See the inner exception for details. —\> System.Data.SqlClient.SqlException: The INSERT statement conflicted with the FOREIGN KEY constraint “FK\_BaseProductProductListLink\_BaseProduct\_BaseProductSystemId”. The  
conflict occurred in database “Prod-Rev1”, table “Products.BaseProduct”, column ‘SystemId’.  
The statement has been terminated.  
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.TryConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString, Boolean isInternal, Boolean forDescribeParameterEncryption, Boolean shouldCacheForAlwaysEncrypted) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)  
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream,  
String method)  
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)  
at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.Execute(IRelationalConnection connection, DbCommandMethod  
executeMethod, IReadOnlyDictionary`2 parameterValues) at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.ExecuteReader(IRelationalConnection connection, IReadOnlyDictionary`2  
parameterValues)  
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)  
— End of inner exception stack trace —  
at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection)  
at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(DbContext \_, ValueTuple`2 parameters) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteImplementation[TState,TResult](Func`3 operation, Func`3 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable`1 commandBatches, IRelationalConnection connection)  
at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IReadOnlyList`1 entriesToSave) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Litium.Application.Data.LitiumDbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) --- End of inner exception stack trace --- at Litium.Application.Data.LitiumDbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Litium.Application.Data.Batching.BatchDataImpl.Commit() at Litium.Application.Products.ProductListServiceImpl.Update[T](T productList) at Litium.Web.Administration.WebApi.Products.Controllers.ProductListsController.Put(Guid systemId, ProductListModel model, String tab) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c __DisplayClass6_2.<GetExecutor>b__ 2(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2  
arguments, CancellationToken cancellationToken)  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Tracing.ITraceWriterExtensions.d\_\_17`1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Tracing.ITraceWriterExtensions.<TraceBeginEndAsyncCore>d__17`1.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.ActionFilterAttribute.d\_\_5.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Controllers.ActionFilterResult.d\_\_5.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.AuthorizationFilterAttribute.d\_\_3.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.AuthorizationFilterAttribute.d\_\_3.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Filters.AuthorizationFilterAttribute.d\_\_3.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Controllers.ExceptionFilterResult.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Web.Http.Controllers.ExceptionFilterResult.d\_\_6.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Tracing.Tracers.HttpControllerTracer.d\_\_10.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Tracing.ITraceWriterExtensions.d\_\_17`1.MoveNext()  
— End of stack trace from previous location where exception was thrown —  
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()  
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)  
at System.Web.Http.Dispatcher.HttpControllerDispatcher.d\_\_15.MoveNext()

What could cause this?

Litium version: 6.3.9

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [October 19, 2020, 9:25am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/2 "2020-10-19T09:25:56Z")

</div>

It can be some corrupted data on relationship links on some products. Does this happen from BO or on integration processes?

---

<div class="post-metadata">

**Author:** ![krilin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/krilin/32/175_2.png) [@krilin](https://forum.litium.com/u/krilin)\
**Post date:** [October 19, 2020, 9:45am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/3 "2020-10-19T09:45:08Z")

</div>

Hi! In the BO and so far we cannot reproduce, meaning it works for us at the same time the customer has problem, but I have seen it on the customers machine and the exception is there.

---

<div class="post-metadata">

**Author:** ![MartinBrandt](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@MartinBrandt](https://forum.litium.com/u/MartinBrandt)\
**Post date:** [October 19, 2020, 10:01am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/4 "2020-10-19T10:01:39Z")

</div>

Do you test on same server as customer?  
If not on same server, then another possibility is that the cache might be corrupt/invalid/behind on the server the customer uses.

---

<div class="post-metadata">

**Author:** ![steve.redstorm](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/steve.redstorm/32/14_2.png) [@steve.redstorm](https://forum.litium.com/u/steve.redstorm)\
**Post date:** [October 19, 2020, 10:05am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/5 "2020-10-19T10:05:03Z")

</div>

Yes Martin is correct, restart the site and try it out and if it still throws exception then create a ticket so we can examine the customer DB.

---

<div class="post-metadata">

**Author:** ![krilin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/krilin/32/175_2.png) [@krilin](https://forum.litium.com/u/krilin)\
**Post date:** [October 19, 2020, 11:38am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/6 "2020-10-19T11:38:48Z")

</div>

Yes, they only have on server so we are using the same server when they get the error and we don’t.  
Ok, I will restart and see what happens

---

<div class="post-metadata">

**Author:** ![patric.forsgard](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/patric.forsgard/32/10_2.png) [@patric.forsgard](https://forum.litium.com/u/patric.forsgard)\
**Post date:** [October 19, 2020, 11:40am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/7 "2020-10-19T11:40:49Z")

</div>

The error comes from a link between the base product and a product list. Do they use dynamic product lists that may add or remove the product from the product list on the same time when the customer are saving.

Does the history for the product indicate any other update of the product in the same time-frame as the error occur?

---

<div class="post-metadata">

**Author:** ![krilin](https://yyz2.discourse-cdn.com/flex030/user_avatar/forum.litium.com/krilin/32/175_2.png) [@krilin](https://forum.litium.com/u/krilin)\
**Post date:** [October 19, 2020, 11:45am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/8 "2020-10-19T11:45:02Z")

</div>

They have a lot of product lists but only static, they are not using any dynamic lists.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/litium/original/1X/12eddac3b8b661de1db86af10ac8151b571e6fb9.png) [@system](https://forum.litium.com/u/system)\
**Post date:** [November 16, 2020, 11:45am UTC](https://forum.litium.com/t/problem-with-updating-product/1705/9 "2020-11-16T11:45:04Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
