How to fix Event code: 3005 Exception type: TaskCanceledException Exception message: A task was canceled

Ali 0 Reputation points
2023-05-18T12:18:34.4166667+00:00

In Web server when the request take more than 30 to 32 second below error appears.

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 5/18/2023 1:32:42 PM 
Event time (UTC): 5/18/2023 10:32:42 AM 
Event ID: 3012a15305c14e90948cb9b11508fb03 
Event sequence: 84 
Event occurrence: 2 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/1/ROOT/AxiaWeb-1-133288792326322979 
    Trust level: Full 
    Application Virtual Path: /AxiaWeb 
    Application Path: C:\inetpub\wwwroot\AxiaWeb\ 
    Machine name: xxxxxxxxxxxxx
 
Process information: 
    Process ID: 7612 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\Axia 
 
Exception information: 
    Exception type: TaskCanceledException 
    Exception message: A task was canceled.
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 
 
Request information: 
    Request URL: http://custody.albilad-capital.com/axiaweb/api/PortfolioAnalysis 
    Request path: /axiaweb/api/PortfolioAnalysis 
    User host address: xxxxxxxxxx
    User: xxxxxxxxxx
    Is authenticated: True 
    Authentication Type: ApplicationCookie 
    Thread account name: IIS APPPOOL\Axia 
 
Thread information: 
    Thread ID: 11 
    Thread account name: IIS APPPOOL\Axia 
    Is impersonating: False 
    Stack trace:    at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.StageAsyncResult.End(IAsyncResult ar)
   at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContext.EndFinalWork(IAsyncResult ar)
   at System.Web.HttpApplication.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
 
Custom event details: 

Also error appears in browser as 500 Server internal error

Please we need help to figure out the cause of the issue or where to look

Windows development | Internet Information Services
Developer technologies | ASP.NET | ASP.NET Core
Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Bruce (SqlWork.com) 78,006 Reputation points Volunteer Moderator
    2023-05-18T15:53:37.46+00:00

    You appear to have the site configured to have a 30 second request timeout. Either bump up configuration, or better yet make your site faster. 30 seconds is pretty slow,

    0 comments No comments

  2. Sam Wu-MSFT 7,561 Reputation points Microsoft External Staff
    2023-05-19T03:01:28.8666667+00:00

    @Ali

    You can try to increase timeout in iis to solve this problem.

    In IIS Manager, right click on the website and go to Manage Web Site -> Advanced Settings. Under Connection Limits option, you should see Connection Time-out.

    if not working yet, try using failed request tracing to see details about 500 error, this will generate detail log file, which will help you to identify the problem.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.