How to resolve 'Exception Details: System.Web.HttpException: Request timed out.' errors?

Article:HOWTO3830  |  Created: 2006-06-12  |  Updated: 2006-06-12  |  Article URL http://www.symantec.com/docs/HOWTO3830
Article Type
How To



Problem

We discovered this issue today when trying to update a secured collection that has fifty sub-collections.  The NS was timing out after 100 seconds regardless of the fact that the database timeout and IIS ASP Script timeout values were set to 999 seconds.

Priority: 1
Date: 6/12/2006 6:51:53 AM
Tick Count: 127223968
Host Name: NS
Process: w3wp.exe (1912)
Thread ID: 6644
Module: AltirisNativeHelper.dll
Source: global.asax
Description: Unhandled exception.  Type=System.Web.HttpException Msg=Request timed out.
StackTrace=

Host Name: NS
Process: w3wp.exe (1912)
Thread ID: 180
Module: AltirisNativeHelper.dll
Source: Altiris.NS.StandardItems.Collection.BaseCollection.UpdateSubCollections
Description: Updating of a subcollection of 'Secured Collection' failed, child guid = 'Sub-Collection'. Exception: System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Data.SqlClient.SqlCommand.ExecuteRead

Environment
NS 6.0.6074

Cause

This problem is due to the ASPNET session state timeout value being set too low:

http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/2a42175f-8756-4409-8db4-8c08b33b810b.mspx?mfr=true

Configuring ASP.NET Applications to Use the Appropriate Session State (IIS 6.0)

You can configure ASP.NET session state persistence in the <sessionState> section of the Machine.config file for all of the ASP.NET applications on the Web server, or you can configure it in the Web.config file for each ASP.NET application. If the <sessionState> section of the Web.config file for an ASP.NET application is empty, the session state configuration for the application is inherited from the <sessionState> section of the Machine.config file.

If the <sessionState> section does not exist in the Machine.config file or the Web.config file, the following is the default session state behavior:

• The session time-out value for an ASP.NET session state is 20 minutes.
 
• The session state is maintained within all of the applications running in the same application pool.
 
• The session state is only maintained on the local Web server (where the session state mode attribute is set to InProc), not across multiple servers in a Web farm.
 

In addition to the configuration settings that are specific to the mode you selected for maintaining session state, the following attributes need to be configured:

• The cookieless attribute. This attribute determines whether or not the session identifier is transferred between the Web server and the client by using cookies. When the cookieless attribute is set to True, cookies are not used to convey session identifiers. When the cookieless attribute is set to False, cookies are used to convey session identifiers. The default setting is False.
 
• The timeout attribute. This attribute specifies the number of minutes that a session is considered valid. When the time specified in the timeout attribute expires, the session is disconnected. The default time-out limit is 20 minutes.
 

Configure the session state settings in the <sessionState> section for the mode that you selected.

Session state is maintained in-process
To maintain session state in-process, you can either delete the <sessionState> section or configure the <sessionState> section in the Machine.config file or the Web.config file.

The following is an example of the configuration when maintaining session state in-process:

<configuration>
  <system.web>
     <sessionState

         cookieless="true"
         timeout="20"
     </sessionState>
  </system.web>
</configuration>
Top of page
Session state is maintained out-of-process with the ASP.NET state service
To configure ASP.NET to maintain session state with the ASP.NET state service, modify the following attributes in addition to the mode attribute:

• The stateConnectionString attribute. This attribute specifies the IP address and port number where the ASP.NET state service is running. The format for this attribute is tcpip=server:port, where server is the IP address or host name of the server, and port is the TCP port number that the ASP.NET state service is configured to use. The default port number is 42424.
 
• The stateNetworkTimeout attribute. This optional attribute specifies the length of time, in seconds, that the TCP/IP network connection between the Web server and the server running the ASP.NET state service can be idle before the session is abandoned. The default time-out limit is 10 seconds.
 

The following is an example of the configuration when maintaining session state out-of-process with the ASP.NET state service:

<configuration>
  <system.web>
     <sessionState

         cookieless="true"
         timeout="20"

     </sessionState>
  </system.web>
</configuration>
Top of page
Session state is maintained out-of-process with a computer running Microsoft SQL Server
To configure ASP.NET to maintain session state with a computer running SQL Server, modify the sqlConnectionStringattribute in addition to the mode attribute. The sqlConnectionStringattribute specifies the ODBC data connection string used for establishing the connection to the computer running SQL Server.

The format for the sqlConnectionStringattribute is data source=odbc_connection_string, where odbc_connection_string is any valid ODBC data connection string that is valid for the computer running SQL Server. For more information about creating ODBC data connection strings for Microsoft SQL Server, see How to allocate handles and connect to SQL Server (ODBC) on MSDN.

The following is an example of the configuration when maintaining session state out-of-process with a computer running SQL Server:

<configuration>
  <system.web>
     <sessionState

         cookieless="true"
         timeout="20"

     </sessionState>
  </system.web>
</configuration>

Resolution

To correct this situation, change the httpRuntime executionTimeout value of the metabase.xml file to the same value as the ASP Script timeout, which should be equal or greater than the database timeout value:

http://support.persits.com/show.asp?code=PS01111374

Script timeout error 

Problem Description
When uploading large files, the following error may occur:
Active Server Pages, ASP 0113 (0x80004005)
The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.


Solution
In the IIS configuration tools, right-click on your virtual directory where your ASP script is running and choose "Properties". On the main tab of the property sheet, click Configuration under Application Settings. If this button is not present, click on the Create button to create an application first.
On the Application Configuration dialog, select the App Options tab. Under ASP Script Timeout, enter a large number such as 900.

 

--------------------------------------------------------------------------------
In Windows 2003 , there is an additional timeout setting. IIS 6.0 has a file named metabase.xml which resides in the folder C:\Windows\system32\inetsrv . By default, this file has this entry:
AspScriptTimeout = "90"

You can change that to a higher value such as 900 seconds, and save the file. (You may need to restart IIS for the change to take effect.)

 

--------------------------------------------------------------------------------
Under ASP.NET , the timeout error message reads as follows:
Exception Details: System.Web.HttpException: Request timed out.

In .NET, there is an additional setting for this. The default script timeout is set to 90 seconds by the httpRuntime section of the machine.config file. You can change this setting to affect all applications on your site, or you can override the settings in your application-specific web.config as follows:

<system.web>
<httpRuntime executionTimeout="900" />
</system.web>

The .NET config files are usually stored in the folder C:\Windows\Microsoft.NET\Framework\[version]\Config where [version] is the version of the .NET Framework such as v1.1.4322. You may need to restart IIS for such changes to take effect.


Legacy ID



23598


Article URL http://www.symantec.com/docs/HOWTO3830


Terms of use for this information are found in Legal Notices