Iis – Error 500 on first request for file

500-erroriisiis-7

I'm running IIS 7 and when I'm trying to download a file from a public folder the server returns Error 500. However, this only happens on the first request and if I try again the download proceed as expected. If I wait for a period of time the problem recur.

It seems to be something with the session handling?

Isn't error 500 application related? This seems weird since it's just a simple file request?

Edit:
I should mention that I'm using https if it could somehow be related.

Best Answer

In order to get some more details, I recommend that you enable "Failed Request Tracing Rules"

First, go to "Edit Site Tracing" and check it as "Enabled" note the location of the trace files, inside that location, you will find a directory with the site's ID.

  1. Go to IIS Manager -> Sites -> your site.
  2. Double click on "Failed Request Tracing Rules".
  3. In Actions (right side) select "Add..."
  4. Choose "All Content (*)"
  5. Select "v" for Status codes(s) and type "400-599" (that will cover the error ranges, including files-not found), click Next
  6. Select all the providers, and continue to Finish.

After the first request, on the Server, go to the location of the Trace files, and open it in Internet Explorer.

I hope that will help you find the fault module, or where the problem is really at.

Let me know if you need anything else, Idan.