Import products over service api fail in production environment only

Vote:
 

Products are updated over the service api from a external system. In development and stage environment import works fine, but in production import doesent work (we use the same import xml in stage and production, so should not be the xml generated) The error loged is not giving me enough to to work on. Any help or ideas? 

Solution is runninng commerce 11.6 and service api 4.2

error message from service api/ commerce:

{"TimestampUtc":"2018-07-10T08:44:34.1004871Z","MessageType":5,"Message":"One or more errors occurred.","StageName":"Exception","StageIndex":1,"StageCount":1,"StageProgress":1,"StageTotalProgress":1,"ExceptionMessage":"One or more errors occurred.","ExceptionStackTrace":"   at Mediachase.Data.Provider.TransactionScope.ExecuteActions(IEnumerable`1 actions)\r\n   at Mediachase.Data.Provider.TransactionScope.ThreadStaticTransactionScope.Commit()\r\n   at Mediachase.Data.Provider.TransactionScope.Complete()\r\n   at Mediachase.Commerce.Catalog.Managers.CatalogManager.SaveCatalog(CatalogDto dataset)\r\n   at Mediachase.Commerce.Catalog.ImportExport.Import.CatalogReader.Read(XmlReader reader)\r\n   at Mediachase.Commerce.Catalog.ImportExport.Import.Importer.Import(Stream stream, String sourceDirectory, Boolean overwrite)\r\n   at Mediachase.Commerce.Catalog.ImportExport.CatalogImportExport.Import(String directoryPath, Boolean overwrite)\r\n   at EPiServer.ServiceApi.Commerce.Jobs.CatalogImportJob.ExecuteJob(Guid jobId)"}


With some more tuning on errorlogging, I find this in the error log, which looks related:

[8] ERROR EPiServer.Framework.Cache.ObjectInstanceCacheExtensions: Failed to Read cacheKey = 'EP:ECF:MF:N__ExcludedCatalogEntryMarkets'
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
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)
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 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Mediachase.Data.Provider.SqlDataProvider.<>c__DisplayClass16_2.b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at Mediachase.Data.Provider.SqlDataProvider.LoadTable(DataCommand command)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteDataTable(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters)
at Mediachase.MetaDataPlus.Configurator.MetaDataPlusDatabase.StoredProcedure.ExecuteDataTable(MetaDataContext context)
at Mediachase.MetaDataPlus.Configurator.MetaField.LoadFromDb(MetaDataContext context, Func`2 dbLoader)
at EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait[T](IObjectInstanceCache cache, String cacheKey, Func`1 readValue, Func`2 evictionPolicy)
ClientConnectionId:19aa084c-55c6-4004-a6c0-382e214a1d8c
Error Number:-2,State:0,Class:11
System.Data.SqlClient.SqlException (0x80131904): Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out
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)
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 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)
at Mediachase.Data.Provider.SqlDataProvider.<>c__DisplayClass16_2.b__0()
at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method)
at Mediachase.Data.Provider.SqlDataProvider.LoadTable(DataCommand command)
at Mediachase.MetaDataPlus.Common.DBHelper.ExecuteDataTable(String connectionString, CommandType commandType, String commandText, Int32 commandTimeout, DataParameter[] commandParameters)
at Mediachase.MetaDataPlus.Configurator.MetaDataPlusDatabase.StoredProcedure.ExecuteDataTable(MetaDataContext context)
at Mediachase.MetaDataPlus.Configurator.MetaField.LoadFromDb(MetaDataContext context, Func`2 dbLoader)
at EPiServer.Framework.Cache.ObjectInstanceCacheExtensions.ReadThroughWithWait[T](IObjectInstanceCache cache, String cacheKey, Func`1 readValue, Func`2 evictionPolicy)
ClientConnectionId:19aa084c-55c6-4004-a6c0-382e214a1d8c
Error Number:-2,State:0,Class:11

#194980
Edited, Jul 10, 2018 13:00
Vote:
 

Resolved this issue. I tried to update the metadata, which gave this error:  "Violation of PRIMARY KEY constraint 'PK_CatalogItemChange'. Cannot insert duplicate key in object 'dbo.CatalogItemChange'. I deleted the content in this table, then tried new import. Things started to act normal again.

#194983
Jul 10, 2018 14:33
Vote:
 

We are aware of this issue and it has been fixed in a later version. Please upgrade to latest version if possible

#194994
Jul 10, 2018 22:37
Vote:
 

Thanks for answer.  Looks like the issue has come back today. do you know in which version it should be fixed?

#195011
Jul 11, 2018 9:44
Vote:
 

It is fixed in Commerce 12.0. But if you upgrade then we suggest to go directly to Commerce 12.4

#195017
Jul 11, 2018 10:42
Vote:
 

To be clear, it is not fixing the problem you have seen, but it prevents issues like that from happening in the future

#195020
Jul 11, 2018 12:18
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.