http 500 error on first visit only

The first time I visit a site I get a 500 - Internal server error. When I hit reload the site works just fine and will continue to work. If I open a different browser or close and reopen the current browser the process repeats.

http://motherscarehawaii.teamvision.biz/

The server is running IIS7.5 on windows server 2008 R2 + sp1 and this is one of many virtual hosts on the server, all others are working fine.

I see HTTP/1.1 GET / 503 32 Disabled motherscarehawaii.teamvision.biz listed in C:\Windows\System32\LogFiles\HTTPERR\httperr1.log but not sure what is disabled. The application pool is setup to run with .Net Framework v2.0.50727 in Classic mode.

Any idea's whats causing the error and how to fix it?


Solution 1:

It's something to do with session cookies and how the site handles them.

First pass, no session cookie at my end,

$ wget --load-cookies cookies --save-cookies cookies --keep-session-cookies -S http://motherscarehawaii.teamvision.biz/
--2011-07-21 21:37:05--  http://motherscarehawaii.teamvision.biz/
Resolving motherscarehawaii.teamvision.biz (motherscarehawaii.teamvision.biz)... 206.72.120.169
Connecting to motherscarehawaii.teamvision.biz (motherscarehawaii.teamvision.biz)|206.72.120.169|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 500 Internal Server Error
  Cache-Control: private
  Content-Type: text/html
  Server: Microsoft-IIS/7.5
  Set-Cookie: ASPSESSIONIDASCRDQBC=GAONOAEADFONKBABDHPPMCLG; path=/
  X-Powered-By: ASP.NET
  Date: Thu, 21 Jul 2011 20:36:51 GMT
  Connection: keep-alive
  Content-Length: 1208
2011-07-21 21:37:05 ERROR 500: Internal Server Error.

second pass, now loads the cookie from the file,

$ wget --load-cookies cookies --save-cookies cookies --keep-session-cookies -S http://motherscarehawaii.teamvision.biz/
--2011-07-21 21:37:06--  http://motherscarehawaii.teamvision.biz/
Resolving motherscarehawaii.teamvision.biz (motherscarehawaii.teamvision.biz)... 206.72.120.169
Connecting to motherscarehawaii.teamvision.biz (motherscarehawaii.teamvision.biz)|206.72.120.169|:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.1 200 OK
  Cache-Control: private
  Content-Length: 2843
  Content-Type: text/html
  Server: Microsoft-IIS/7.5
  X-Powered-By: ASP.NET
  Date: Thu, 21 Jul 2011 20:36:53 GMT
  Connection: keep-alive
Length: 2843 (2.8K) [text/html]
Saving to: `index.html'

100%[=======================================================================================================>] 2,843       --.-K/s   in 0.1s

2011-07-21 21:37:07 (24.1 KB/s) - `index.html' saved [2843/2843]

I hope that helps you track it down further.