Posted on 18/03/2022 18:44:13
Hi DW,
I was trying to add a product to a cart via the /dwapi/ecommerce/carts/8106a0cda70342058a34839c44fde1f5/items/, with the body:
{
"ProductId": "SGK070",
"ProductVariantId": "SP10642.SP5786",
"Quantity": 1
}
and my request was taking a lot of time, so i canceled it, and then tried to get cart instead with /dwapi/ecommerce/carts/8106a0cda70342058a34839c44fde1f5,
which gave me this message in postman: "A network-related or instance specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"
I then figured it was because i lost connection to our VPN in the middle of the request to add a product.
I then reconnected to our VPN and then first tried to get the cart via the /dwapi/ecommerce/carts/8106a0cda70342058a34839c44fde1f5, which was ok, but when i tried to add product to the cart again, i got stuck with this message:
{
"Message": "An error has occurred.",
"ExceptionMessage": "Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.",
"ExceptionType": "System.Data.SqlClient.SqlException",
"StackTrace": " at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)\r\n at System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error)\r\n at System.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync()\r\n at System.Data.SqlClient.TdsParserStateObject.TryReadNetworkPacket()\r\n at System.Data.SqlClient.TdsParserStateObject.TryPrepareBuffer()\r\n at System.Data.SqlClient.TdsParserStateObject.TryReadByteArray(Byte[] buff, Int32 offset, Int32 len, Int32& totalRead)\r\n at System.Data.SqlClient.TdsParserStateObject.TryReadUInt16(UInt16& value)\r\n at System.Data.SqlClient.TdsParser.TryGetTokenLength(Byte token, TdsParserStateObject stateObj, Int32& tokenLength)\r\n at System.Data.SqlClient.TdsParser.TryGetDataLength(SqlMetaDataPriv colmeta, TdsParserStateObject stateObj, UInt64& length)\r\n at System.Data.SqlClient.TdsParser.TryProcessColumnHeaderNoNBC(SqlMetaDataPriv col, TdsParserStateObject stateObj, Boolean& isNull, UInt64& length)\r\n at System.Data.SqlClient.SqlDataReader.TryReadColumnInternal(Int32 i, Boolean readHeaderOnly)\r\n at System.Data.SqlClient.SqlDataReader.TryReadColumn(Int32 i, Boolean setTimeout, Boolean allowPartiallyReadColumn)\r\n at System.Data.SqlClient.SqlDataReader.GetValueInternal(Int32 i)\r\n at System.Data.SqlClient.SqlDataReader.GetValue(Int32 i)\r\n at Dynamicweb.Ecommerce.Assortments.AssortmentRepository.ExtractAssortmentItem(IDataReader dataReader)\r\n at Dynamicweb.Ecommerce.Assortments.AssortmentRepository.GetAssortmentItems(String assortmentId)\r\n at Dynamicweb.Ecommerce.Assortments.AssortmentService.LoadAssortmentItems(String assortmentId)\r\n at System.Lazy`1.CreateValue()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Lazy`1.get_Value()\r\n at Dynamicweb.Ecommerce.Assortments.AssortmentService.InternalHasAccessToProduct(Product product, User user)\r\n at Dynamicweb.Ecommerce.Assortments.AssortmentService.HasAccessToProduct(Product product)\r\n at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId, Boolean useAssortments)\r\n at Dynamicweb.Ecommerce.Products.ProductService.GetProductById(String productId, String productVariantId, String productLanguageId)\r\n at Dynamicweb.Ecommerce.Frontend.Cart.CartService.CreateCartLineFromModel(Order cart, OrderLineViewModel cartItem)\r\n at Dynamicweb.Ecommerce.WebAPI.Controllers.CartsController.AddLineToCart(String secret, OrderLineViewModel cartItem)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()",
"InnerException": {
"Message": "An error has occurred.",
"ExceptionMessage": "The wait operation timed out",
"ExceptionType": "System.ComponentModel.Win32Exception",
"StackTrace": null
}
}
I tried to login again via the dwapi and use a new token in my request, but the same error keeps occuring.
I even waited 5-10 min, and tried the request again. But got the same result.
Best regards,
Mikkel