Opening the Reports web application fails with “The request failed with HTTP status 400: Bad Request.”

Problem:

You installed SQL Server 2005 Reporting Services (SP1, SP2, doesn’t matter) with the optional Report Manager web application and opening "http://servername/Reports/Pages/Folder.aspx" with the browser results in "The request failed with HTTP status 400: Bad Request."

Browser shows error message "The request failed with HTTP status 400: Bad Request." for http://servername/Reports/Folder.aspx

Don’t loose hope!

If you’re local, right-click and view the source code of the page. There’s a StackTrace META element.

If you’re remote, go and check the LogFiles directory in "MSSQL.2Reporting Services" or "MSSQL.3Reporting Services" (or similar) in the SQL Server installation directory. Check the most recent ReportServerWebApp__datetime.log file. The stack trace should be at the end of that file.

The stack trace probably reads like this:

System.Net.WebException: The request failed with HTTP status 400: Bad Request.
at Microsoft.SqlServer.ReportingServices2005.RSConnection.GetSecureMethods()
at Microsoft.ReportingServices.UI.Global.RSWebServiceWrapper.GetSecureMethods()
at Microsoft.SqlServer.ReportingServices2005.RSConnection.IsSecureMethod(String methodname)
at Microsoft.SqlServer.ReportingServices2005.RSConnection.ValidateConnection()
at Microsoft.ReportingServices.UI.ReportingPage.EnsureHttpsLevel(HttpsLevel level)
at Microsoft.ReportingServices.UI.ReportingPage.ReportingPage_Init(Object sender, EventArgs args)

Now go and check your %systemroot%system32LogFilesHTTPERRhttperr1.log (or similar) file. At the end, there will be something like

2007-03-12 15:49:30 127.0.0.1 3628 127.0.0.1 80 HTTP/1.1 POST /ReportServer/ReportService2005.asmx 400 – Hostname –

This tells you that IIS rejected 127.0.0.1 as hostname. Which means your server is multi-homed and you haven’t associated IIS’s Default Web Site with 127.0.0.1 (localhost). This could help.  So does using "(All interfaces)". But, I don’t know. I haven’t tried messing with the Default Web Site on my server. (I fear IT would come after me and do bad things to me if I did.)

Note: Reporting Service might be configured to use a different web site than Default Web Site.

Solution:

I suggest to change the Report Manager web site application configuration RSWebApplication.config in your "Reporting ServicesReportManager" directory.

Make a backup copy first. Then set the value of the ReportServerUrl element to http://servername/ReportServer and delete the value in the ReportServerVirtualDirectory element. (These elements are mutually exclusive. If Reports fails to start with a yellow screen of death complaining that ReportServerUrl is not a configuration setting, delete on of them element values, willya?)

<Configuration>
  <UI>
    <ReportServerUrl>
http://servername/ReportServer</ReportServerUrl>
    <ReportServerVirtualDirectory></ReportServerVirtualDirectory>
    <ReportBuilderTrustLevel>FullTrust</ReportBuilderTrustLevel>
  </UI>

Then start and stop the "ReportServer" application pool (or whatever the application pool is for your Report web). (Don’t restart IIS unless you’re in your scheduled downtime window.)

Now the sun should shine and the world should be a better place.

Recommended reading:

Mike’s Blog – Multiple Reporting Services instances on one machine

RSWebApplication Configuration File Documentation

Advertisements
This entry was posted in Software Development. Bookmark the permalink.

3 Responses to Opening the Reports web application fails with “The request failed with HTTP status 400: Bad Request.”

  1. Jose says:

    You rule!Thanks a lot!Jose

  2. Xio says:

    Excelent!! Thanks a lot!!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s