If I have an error in my ColdFusion script, I'm getting a 500 error message from IIS instead of ColdFusion. This only happens if I provide the file name in the URL and does not happen if I open the URL without the script name (which would open index.cfm).
For example:
I can reproduce this problem on 2 of my 3 ColdFusion platforms:
My index.cfm & foobar.cfm:
<!--- provoke a coldfusion error --->
<cfset foo
My web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<httpErrors errorMode="Custom" existingResponse="PassThrough" />
</system.webServer>
</configuration>
For me it looks like there's a problem with the ColdFusion connector with IIS 8 and IIS 8.5.
IIS error The error 500.19 is an internal server error often occurring on a server using Microsoft IIS software. It indicates that the configuration data for the page is invalid. To solve the issue, delete the malformed XML element from the Web. config file or from the ApplicationHost.
Most of the time, the issue is only temporarily and can be corrected by trying the page again. You can use the refresh/reload button, pressing F5 , or by trying the URL again from the address bar. Sometimes this error is caused when a service restarts, and you happen to catch it at exactly the wrong time.
HTTP Error 500 message indicates that a problem has occurred on the Web server that hosts the Web site at the time the error is returned.
Okay, I was finally able to fix this.
The problem
I run multiple web applications each in a own virtual directory under the same IIS website. It turned out that adding existingResponse="PassThrough"
to the web.config only works partially in virtual directories. Without that setting I never get any ColdFusion error and instead I always see the IIS 500 error. If I add existingResponse="PassThrough"
in the web.config of a virtual directory, ColdFusion errors are only forwarded if you access the site without calling a .cfm script directly (for example: example.com/ instead of example.com/index.cfm).
The solution
The solution was easy. I just had to add the existingResponse="PassThrough"
setting to the web.config of the root IIS website aswell and everything is working.
I think this is a bug in IIS 8 and 8.5 since I double checked that on my IIS 7.5 server and I didn't had to add the property on the root website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With