Developer forum

Forum » Dynamicweb 10 » Timeouts in Azure AppService

Timeouts in Azure AppService

Aki Ruuskanen
Aki Ruuskanen
Reply

Hi, 

We are experiencing constant timeouts in backend on a DW10 installation in a Azure Service. It is running on Premium v3 P2V3. 

Example of timeout error : 

2025-12-02 14:56:58.6887: Request failed. Trace ID: 00-1d59e7872618b83c53486d9fc9849a1e-e6b9bc10593a6dd0-00. System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
 ---> System.ComponentModel.Win32Exception (258): The wait operation timed out.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.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.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds)
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior)
   at Dynamicweb.Data.Database.CreateDataReader(IDbCommand command, CommandBehavior behavior)
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, CommandBehavior behavior, Int32 commandTimeout)
   at Dynamicweb.Data.Database.CreateDataReader(CommandBuilder commandBuilder, IDbConnection connection, IDbTransaction transaction, Int32 commandTimeout)
   at Dynamicweb.Data.GeneralLogRepository.GetEvents(LogEventQuery query)
   at Dynamicweb.Logging.LogEvents.LogEventService.GetEvents(LogEventQuery query)
   at Dynamicweb.Dashboard.Widgets.WidgetsHelper.GetLogEvents(String eventLevel, String category, DateTime startTime, String orderBy, Int32 top)
   at Dynamicweb.Dashboard.Widgets.WidgetsHelper.GetLogEvents(String eventLevel, String category, DateTime startTime)
   at Dynamicweb.Dashboard.Widgets.WidgetsHelper.GetLogEvents(String eventLevel, String category, TimePeriodUnit timePeriod)
   at Dynamicweb.Insights.UI.Dashboard.Widgets.EventCountWidget.GetCounterValue(String& formattedValue)
   at Dynamicweb.Dashboard.Widgets.ThresholdCountWidget.GetCounterNumber()
   at Dynamicweb.Application.UI.Queries.Dashboard.DashboardNumberWidgetQuery.GetModel()
   at Dynamicweb.CoreUI.Screens.ScreenBuilders.DefaultScreenBuilder`2.Make()
   at Dynamicweb.CoreUI.Screens.ScreenBuilder.MakeScreen(BuildRequest request)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetScreenFromDefinition(String screenDefinition, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetLayoutDefinition(String screenDefinition, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetScreen(String layout, String navigationPath, String shadowEditId)
   at Dynamicweb.Management.UI.Controllers.AdminController.GetUI()
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Dynamicweb.Management.UI.Middleware.AdminUIRedirectMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddlewareImpl.<Invoke>g__Awaited|10_0(ExceptionHandlerMiddlewareImpl middleware, HttpContext context, Task task)
ClientConnectionId:a99e3b4b-66d2-4a44-86c2-bc9261bb6a10
Error Number:-2,State:0,Class:11
ClientConnectionId before routing:111cf3ab-23bf-432e-b54d-03290c0c5905
Routing Destination:f6df6e3f52fc.tr1213.swedencentral1-a.worker.database.windows.net,11007
2025-12-02 14:56:59.1768: Request headers: [
  "Accept",
  "Accept-Encoding",
  "Accept-Language",
  "Cookie",
  "Host",
  "Max-Forwards",
  "Referer",
  "User-Agent",
  "sec-ch-ua-platform",
  "dw-screen-only",
  "sec-ch-ua",
  "dw-navigation-path",
  "sec-ch-ua-mobile",
  "Sec-Fetch-Site",
  "Sec-Fetch-Mode",
  "Sec-Fetch-Dest",
  "X-ARR-LOG-ID",
  "CLIENT-IP",
  "DISGUISED-HOST",
  "X-SITE-DEPLOYMENT-ID",
  "WAS-DEFAULT-HOSTNAME",
  "X-Forwarded-Proto",
  "X-AppService-Proto",
  "X-ARR-SSL",
  "X-Forwarded-TlsVersion",
  "X-Forwarded-For",
  "X-Original-URL",
  "X-WAWS-Unencoded-URL"
]
2025-12-02 14:56:59.4571: Request item keys: [
  "DW_Current_ExecutionTable"
]
2025-12-02 14:56:59.7524: Request form: []

 

Regards / Aki

 


Replies

 
Morten Snedker Dynamicweb Employee
Morten Snedker
Reply
This post has been marked as an answer

Hi Aki,

I can see that the error derives from LogEventService.GetEvents(). That method will try to retrieve events from table GeneralLog. This table easily gets quite extensive in its number of rows, if retention for some reason does not work, prompting a frequent clean-up of the table. Try making  a count on the table, also perhaps a SELECT MIN(LogDate) FROM GeneralLog, to get an idea of how far back the log reaches. Relate to it, and act accordingly.

Compare the table schema with one from a default DW database, and ensure that indexes on the table are intact.

Finally, with the above checked and still no luck:  review performance of Azure, see if there should be any I/O limit or alike.

BR
Snedker

Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi Morten,

Thanks for the input. The GeneralLog contains data from 18 april 2023 so its quite a lot. 

I have set the Database logs retension to 5 days. And the Scheduled Task "Cleanup Logs" is running, but it failes. I cannot see any reason for why it fails in the logs?

2025-12-22 14:07:21.7500|ScheduledTasks|INFORMATION|Task 'Cleanup logs' ID=17: task execution started
2025-12-22 14:07:53.1958|ScheduledTasks|INFORMATION|Task 'Cleanup logs' ID=17: Method Dynamicweb.Logging.ScheduledTaskAddIns.LogsCleanupScheduledTaskAddIn, Dynamicweb.Core.Run returned: False
2025-12-22 14:07:53.2018|ScheduledTasks|INFORMATION|Task 'Cleanup logs' ID=17: task execution finished

Regards / Aki 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Aki

When the log table gets this big, the cleanup cannot run. You can run a truncate on the table to clear it all out.

To truncate the table - use SQL manager:

TRUNCATE TABLE GeneralLog;

Or you can delete old records - start by adding an index on the date column and then delete in batches:

CREATE INDEX IX_GeneralLog_LogDate ON dbo.GeneralLog(LogDate);

WHILE 1 = 1
BEGIN
    DELETE TOP (10000)
    FROM dbo.GeneralLog
    WHERE LogDate < DATEADD(DAY, -30, GETDATE());

    IF @@ROWCOUNT = 0
        BREAK;
END
Votes for this answer: 1
 
Aki Ruuskanen
Aki Ruuskanen
Reply

Hi,

Yes, I did a truncate on the table. Thanks.

/Aki  

 

You must be logged in to post in the forum