13

I make a web request to a third-party api from my ASP.NET Core application.

  1. When app is running alone itself, request succeeds.
  2. When app is running in IIS on the same server, request timeouts.

Request is made from a Hangfire recurring job to Asana API endpoint (HTTPS) via RestSharp client. All the own app's pages are available through IIS, but app cannot make any requests.

Where should I look and what to debug to solve this problem?

3

1 Answer 1

19

IIS behavior is driven by the web.config, I have configured to deal with request < 20 min specifying requestTimeout="00:20:00":

<aspNetCore
  requestTimeout="00:20:00"
  processPath="%LAUNCHER_PATH%"
  arguments="%LAUNCHER_ARGS%"
  stdoutLogEnabled="false"
  stdoutLogFile=".\logs\stdout"
  forwardWindowsAuthToken="false">
  <environmentVariables>
    <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="staging" /> <!-- value could be "development", "staging" or "production"-->
  </environmentVariables>
</aspNetCore>
Sign up to request clarification or add additional context in comments.

8 Comments

Doesn't it set timeout for requests that come into IIS? Because my problem is related to requests that come from the app to another app on anoter server with a RestSharp client. And when app is running without IIS, those requests are passing ok.
My bad, I didn't get you right then. But what does trigger the call from your ASP.NET Core, an incoming call to IIS right? What about your application if your incoming call from IIS timeout? Wouldn't your app and its request get interrupted as well? Not sure about that, just a supposition.
No, there is no incoming request, it's a recurring job set with Hangfire.
Is it possible to specify requestTimeout as an environment variable ala %LAUNCHER_PATH%? When I attempt this, intellisense indicates The string '%REQUEST_TIMEOUT%' is not a valid Time value. and my navigating to my webapp gives: The specified CGI application encountered an error and the server terminated the process.
@Daboul - This is good information but this setting is not applied. Reason with details is - I read the details for these settings on this page - learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/… & it turned out that default hostingModel setting is InProcess & requestTimeout setting for this hosting model is ignored. Here is snap from that page "Doesn't apply to in-process hosting. For in-process hosting, the module waits for the app to process the request." Please let me know about this.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.