Generic ANS-MES-0003 error returned instead of detailed errors when using IIS 7.0

Problem
When using Analysis Studio via an IIS 7.0 webserver, conditions that would normally result in a specific error indicating the root cause of a problem are now returning the following error which does not explain what went wrong:

ANS-MES-0003 A server error occurred. Unable to complete the action

Conditions that will result in this error include but are not limited to:
- when a user tries to save a report in a folder for which Write permissions have not been granted
- When an inactivity timeout occurs (the error is returned instead of a prompt for logon)
- When the message "Working ... Cancel" is displayed and the user decides to cancel, ANS-MES-0003 is returned instead of a "Request was cancelled" message

Cause
IIS 7 is intercepting status code messages from the IBM Cognos dispatcher and returning a generic error to Analysis Studio.

Environment

The gateway's web server is Microsoft IIS 7.0
Solution
There are 2 possible solutions:

Tip: Backup the applicationHost.config file prior to making changes to it.

Solution 1 (global):
1) Open the IIS config file, usually located at C:\Windows\System32\inetsrv\config\applicationHost.config
2) Search for "httpErrors" (don't include quotation marks when searching)
3) Replace the httpErrors element with the following:
<httpErrors existingResponse="PassThrough" />

For example, replace:

<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
<error statusCode="401" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="401.htm" />
<error statusCode="403" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="403.htm" />
<error statusCode="404" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="404.htm" />
<error statusCode="405" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="405.htm" />
<error statusCode="406" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="406.htm" />
<error statusCode="412" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="412.htm" />
<error statusCode="500" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="500.htm" />
<error statusCode="501" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="501.htm" />
<error statusCode="502" prefixLanguageFilePath="%SystemDrive%\inetpub\custerr" path="502.htm" />
</httpErrors>


with:

<httpErrors existingResponse="PassThrough" />


Solution 2 (local):
1) Stop the IIS Server
2) Open the IIS config file, usually located at C:\Windows\System32\inetsrv\config\applicationHost.config
3) Search for <section name="httpErrors" overrideModeDefault="Deny" /> and change "Deny" to "Allow", if necessary.

The following attribute may also need to be removed:
Search for <system.webserver>
Search for its child <httpErrors ... >

If it has an attribute lockAllAttributesExcept="errorMode" (e.g. , <httpErrors lockAllAttributesExcept="errorMode"> ), remove the attribute and its value.

4) Save and exit the file.
5) On a command line, enter the following command (make sure to substitute the name of your website and virtual directory):

%windir%\system32\inetsrv\appcmd.exe set config "<Your Website>/<Your virtual directory>" -section:system.webServer/httpErrors - existingResponse:PassThrough

<Your Website> refers to the name found under “sites” which is usually default web site. The <Your virtual directory> is the name associated with the gateway's webcontent directory such as ibmcognos.

For example, for the following web server you must enter

%windir%\system32\inetsrv\appcmd.exe set config "default web site/ibmcognos" -section:system.webServer/httpErrors - existingResponse:PassThrough

If the command is successful you will get a response along the lines of Configured Application Settings

6) Start the IIS server

www.cogknowhow.com