IIS 7 and Above
Server Error in Application "Default Web Site"
Last post May 25, 2010 08:58 PM by otagomes
Jan 01, 2008 06:09 PM|sasha2007|LINK
I have a problem on my local machin (Vista Premium, IIS7), which looks as follows:
1. I start my web cgi application from the default.asp page: <form action='mycgi.exe' method='POST' target='_self'>
2. file mycgi.exe works correctly, BUT the other cgi applications, which are called by the mycgi.exe don't work
and I get message:
HTTP Error 502.2 - Bad Gateway
Error Code: 0x00000103
Requested URL: http://localhost:80/mysite/mycgi_2.exe?p1=v1&p2=v2&p3=v3
Physical Path: C:\inetpub\wwwroot\mysite\mycgi_2.exe
Logon User: Anonymous
Logon Method: Anonymous
Most likely causes:
The CGI process was shut down or terminated unexpectedly before it finished processing the request.
The CGI process has a flaw and does not return a complete set of HTTP headers.
What you can try:
Check the event logs on the system to see whether the CGI process is shutting down unexpectedly.
Troubleshoot the CGI application to determine why it is not sending a complete set of HTTP headers.
Server Version Information: Internet Information Services 7.0.
3. There is one interesting thing: if I change in the default.asp method='POST' by method='GET' the mycgi.exe doesn't work too
and I get the same message.
Jan 01, 2008 10:38 PM|anilr|LINK
If you upgrade to vista sp1 rc, the detailed error message will have the exact output that IIS received from the CGI executable - that will let us know why the response is malformed.
Jan 02, 2008 09:18 PM|sasha2007|LINK
I instalied Vista SP1 RC and in addition I got message:
cgi moduls are written with Borland C++ Builder 6. But situation the same: if in the form method is 'POST', cgi works, if method is GET, cgi returns above message
Jan 02, 2008 09:30 PM|anilr|LINK
Sounds similar to this thread -
http://forums.iis.net/t/1100323.aspx - we do not create a stdin pipe for requests without request entity body - since, the pipe is unneeded - if you are trying to use stdin pipe for those requests, you will hit an error.
Jan 03, 2008 12:40 AM|sasha2007|LINK
Nothing will deter progress:) There isn't used stdin and stdout in the cgi. All done with using Borland web component model. May be it's a problem bpl-files. But it's really interesting why does it work when method POST is used and doesn't work in any other
case? CGI called with method POST works absolutely correctly and returns well formed html page. The problem is that this page can't call other cgi.
Jan 03, 2008 09:34 PM|sasha2007|LINK
Does it means that all the cgi projects won't work with IIS7?
Jan 03, 2008 10:00 PM|anilr|LINK
Again, IIS is not creating stdin for GET requests, only for POST requests - you will need to change your code or maybe some of the sdk code you are compiling against to not use stdin in case of non-POST requests.
Mar 30, 2010 03:46 PM|issijohn|LINK
Did you ever solve this problem? I have this problem with a CGI built with Borland C++ Builder 6 and can't figure out how to fix it.
May 25, 2010 08:58 PM|otagomes|LINK
But, i have an application in the same conditions and this trouble occurs but under dll not. I mean, if I create an apl.exe, the problem occurs, if i create an apl.dll doesn't occurs. This is because .dll didn't use stdin?
Tnx for your help and patience.