CF7 IIS 7: getting 500 - internal error instead of cf error output - but not when run locally

Explorer ,
Nov 30, 2009 Nov 30, 2009

Copy link to clipboard

Copied

Hi all:

After a lot of tweaking, I got CF7 running on Win 2008 / IIS 7.I am now migrating apps from Win 2003 / IIS 6.

However, one problem I can't solve is that when I access a page over the Internet, and a Cold Fusion error occurs, all I get is the standard IIS 500 - Internal server error message.

Yet, if I access the page from a browser on the server itself, that is, if I access via the local host 127.0.0.1,  I get the usual partial page output, then the CF error output, like I used to always get before.

I suspect this has to do with IIS 7, or the tightened security in Win 2008, but I can't figure out how to fix it. I need the ability to see the error messages over the Internet. Any help would be greatly appreciated.

Thanks,

Joe

Views

10.8K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 30, 2009 Nov 30, 2009

Copy link to clipboard

Copied

Let me clarify a few things:

First, most .cfm pages are working fine. The 500 error only seems to show up if CF throws an error on the page.

Second, I do have friendly error messages turned on in IE.

Third, I get the same results in IE and Firefox.On the server machine I am only running IE).

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 01, 2009 Dec 01, 2009

Copy link to clipboard

Copied

Since nobody responded, I assume this was either a dumb question, or nobody else knew the answer.

But the for next poor soul that get stuck on this, here's what I found:

First, the 500 error wiill not appear if your turn OFF the Show HTTP Status Codes box in Cold Fusion Administrator. You will get the usual Cold Fusion error output. However, you will also see a Cold Fusion error in response to a non-existent template, which I hate, but there you are.

Second, IIS 7 is much more security-oriented, and it does in fact distinguish between local and remote users when outputting ISAPI error information. Local users get a lot more information, which in the case of ColdFusion includes rendered HTML up to the error, and then the gray error box. For non-ColdFusion errors it outputs detailed ISAPI error information and 'helpful' links.

I'm not sure there is a way to have IIS output detailed information to specific remote users, but you can force it to output detailed information to all users. Here's more information on that: http://forums.iis.net/t/1146653.aspx. You may have to edit the IIS config directly to do this, I haven't found the related settings in the management console.

It would be nice if ColdFusion would check the debug settings before outputting error information. IPs on the debug list should get detailed error information, everyone else should get an abbreviated message.

But you can't, unless that has been implemented in CF8 or 9, so the best solution is probably a site-wide CF error handler that can distinguish IPs.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 01, 2009 Dec 01, 2009

Copy link to clipboard

Copied

It would be nice if ColdFusion would check the debug settings before outputting error information. IPs on the debug list should get detailed error information, everyone else should get an abbreviated message.

But you can't, unless that has been implemented in CF8 or 9, so the best solution is probably a site-wide CF error handler that can distinguish IPs.

Good suggestion.  I recommend you raise it as an ehancement request:

http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html

Let us know the bug reference number and I'll go vote for it too.

--

Adam

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 20, 2015 Feb 20, 2015

Copy link to clipboard

Copied

LATEST

Thank you for this!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2010 Apr 23, 2010

Copy link to clipboard

Copied

I also encountered this issue when migrating a ColdFusion MX 7 app from Windows 2003 to Windows Server 2008 R2 (IIS 7.5).  Our custom CF errors through CFERROR tag were behaving strangely.  Took us a while to figure out what's happening…

Unlike IIS6, IIS7 "Error Pages" module post-process response from CF (or any other third party ISAPI). By default if IIS7 sees a 500, or 503, or 404 http header on a page returned by ColdFusion it overwrites the response body -- Your CF code does execute, so for example if you log errors or email them to yourself, that part still works. It's just that IIS7 overwrites the body of http response with "Service Not Available" for 503 or whatever else it has configured in "Error Pages".  There are three workarounds to restore your custom error messages:

First, you can reconfigure IIS to allow third party ISAPI error messages to be uncenso

red (for your site) by running this command on your server:

%windir%\system32\inetsrv\appcmd.exe set config "My ColdFusion Website Name/" -section:system.webServer/httpErrors -existingResponse:PassThrough

After this change IIS7 will behave like IIS6 when it comes to CFERROR or when you use CFHEADER statuscode=404/500.

Second option, is to let your cferror template handle behind the scene error handling/cleanup tasks.  Any html that you want user to see put it into a static html file and configure IIS7 > Error Pages> 503 error > Insert error response from a static file> file you just created.

Third option is for your cferror template to return a 302 redirect (cflocation) to another cfm/htm page that outputs message to the user.  IIS7 doesn't censor/overwrite 3xx responses, apparently only 4xx and 5xx.

Hope this helps.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 14, 2010 Sep 14, 2010

Copy link to clipboard

Copied

OMG, this was driving me crazy and I could not figure out why cferror worked on detailed but not on normal IIS 404 response, thanks soooo much!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines