Vulnerability in EPiServer.Forms
We get the warehouses from integration, so I thought I'd remove the Default Warehouse since we do not use it. Didn't think about it, I just did it. Little did I know that the web app would not be able to start anymore without it.
Initialize action failed for 'Initialize on class EPiServer.Commerce.Initialization.CartModeInitializationModule, EPiServer.Business.Commerce, Version=126.96.36.199, Culture=neutral, PublicKeyToken=8fe83dea738b45b7'System.Exception: Exception in [ecf_ShippingMethod_Language]: ForeignKeyConstraint ShippingMethod_MarketShippingMethods requires the child key values (dade7f46-646b-4a16-9226-4e574c8c79e6) to exist in the parent table. ---> System.Data.ConstraintException: Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. at System.Data.DataSet.FailedEnableConstraints() at System.Data.DataSet.EnableConstraints() at System.Data.DataSet.set_EnforceConstraints(Boolean value) at System.Data.DataTable.EndLoadData() at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) at System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) 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(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) at Mediachase.Data.Provider.SqlDataProvider.<>c__DisplayClass21_0.b__0() at EPiServer.Data.Providers.SqlTransientErrorsRetryPolicy.Execute[TResult](Func`1 method) at Mediachase.Data.Provider.SqlDataProvider.WithRetry[TResult](Func`1 action at Mediachase.Data.Provider.SqlDataProvider.LoadDataSet(DataCommand command)
To me, this is definitely a bug. Don't allow the user to do this if it has such catastrofic effects.
Just to be clear, did you delete the warehouse, or did you delete the market? because the error appears to be related to the market, not warehouse
Then it is definitely a bug. I will try to reproduce it and file a bug to Commerce team. Thanks for bringing it into our attention
Unfortunately I can't reproduce it. the demo site we use for develop does not have Default warehouse by default. Maybe something is with your site, please contact developer service for further assistance
(not saying it's not a bug, it is probably still is, but we can't really fix it without understand what's wrong)
The stacktrace point to Shipping method: 'dade7f46-646b-4a16-9226-4e574c8c79e6'. This is a "In store Pickup" shipping metodh, that I think is a commerce default shipping method... We got the same error in CartModeInitializationModule when we change the setting "Is pickup location" for Default warehouse to 'No'. The site would not start the next time the site was restarted. Definitly a bug.
Just FYI this was created as a support case for the commerce development team and we are looking into it.