How to enable robust exception debugging in ColdFusion

I'm running CF11. I'm trying to enable Robust Exception debugging but whenever I check the box on Administrator, and try to submit changes, the box unchecks itself.
I seem to remember there is a file I can edit to enable this but I can't remember where it is. Help?

Also, I have a page that is giving me an odd error:
"The 2 parameter of the Right function which is now 0, must be a positive integer".
I did a google search and found some reference to a Regular expression, but the line number that is coming back isn't a regular expression. How can I do a struct dump of this page? Or is there some better kind of debugging dump I can use to see more of what's happening.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The setting should be stored in neo-debug.xml.

Line numbers aren't always exact. That error could occur without any regex's.  For example, this code throws that error:

      <cfset result = right("abc", 0)>

It just means the number of characters passed into the the function is wrong.  ie Saying "return 0 characters from the right side of this string" isn't valid.  The number of characters must be > 0 or an error occurs.  

Check the code near that line number for the RIGHT() function.
nachtmskAuthor Commented:
I think it was another file referenced from the file that threw the error.
Because I found this on lines 80 and 81  (The error was said to be on line 81)

80 <cfset rightCount = Len(revTemplate) - Find("/", revTemplate)>
81 <cfset navTemplate = Reverse(Right(revTemplate, rightCount)) & "/subnav.cfm">

So, I guess the variable rightCount is returning 0 sometimes.

Yep. you always have to validate the positions with substring functions.  The exact handling all depends on what you want to do when Find() returns 0.  You might want to execute a completely different section of code:

<cfset rightCount = Len(revTemplate) - Find("/", revTemplate)>
<cfif rightCount gt 0>
     <cfset navTemplate = Reverse(Right(revTemplate, rightCount)) & "/subnav.cfm">
      do something else ...

... or just use the whole value instead, ie

    <cfset rightCount = Len(revTemplate) - Find("/", revTemplate)>
    <!--- if "/" is found, use substring. Otherwise use the whole string --->
    <cfset baseText = rightCount ? Right(revTemplate, rightCount) : revTemplate>
    <cfset navTemplate = Reverse(Right(revTemplate, rightCount)) & "/subnav.cfm">

>> The error was said to be on line 81

Yes, line numbers are often wrong. They just mark the point where the engine fell down.  I've seen compile errors be off by more than 50 lines, due to a missing or misplaced quote or # sign.
Angular Fundamentals

Learn the fundamentals of Angular 2, a JavaScript framework for developing dynamic single page applications.

nachtmskAuthor Commented:
Thanks again.
This came about because I updated CF9 to CF11. Once the update finished, this error cropped up. CF9 never had a problem with this code, and in fact, I didn't write this code so I'm not exactly certain what it's doing in the context of the file I found it in. I need to get some debug statements in there to see exactly what's going on.


Well I don't think it's caused by any changes in those functions in CF11 (not directly anyway). Honestly it could have occurred in any version, if "revTemplate" didn't contain a "/".  

I guess the next questions would be: how is it populated and what is the actual value when that error occurs? "revTemplate" seems to contain some sort of path or URL. (Perhaps the code or function used to populate iit is what has changed in CF11.) Dumping the value should give you an idea how to fix specific line of code.  Then work backward to see if you need to modify anything else.

Were you able to enable debugging by modifying the neo*.xml file's debug settings? I know it worked in CF10 as long as your calling IP was not restricted.  Not sure about 11.  If all else fails, you could always wrap the entire block of code in a cftry/cfcatch and do a dump of the error message inside the catch clause  <cfdump var="#cfcatch#"> .
nachtmskAuthor Commented:
No, the neo* file didn't help.
On my CF9 site, something is enabled that shows a dump at the bottom of every page/screen.
It first says "Debugging Information" and give some basic info.
Then there is a heading that says "Execution time" and it shows in detail every page that was called.

Then there is an area called
SQL Queries

Stored Procedures

and then finally
Scope Variables.

I don't remember how I turned this on so I could see all this debugging info on the CF9 server.
Any ideas?
nachtmskAuthor Commented:
Never mind the question above about the debugging. I found out what that was.

I've discovered more about my problem.
The code:
<cfset revTemplate = Reverse(CGI.PATH_INFO)>
<cfset rightCount = Len(revTemplate) - Find("/", revTemplate)>
<cfset navTemplate = Reverse(Right(revTemplate, rightCount)) & "/subnav.cfm">

What seems to be happening is that CGI.PATH_INFO is returning a blank string. It didn't do this in CF9 but it's doing it in CF11.
The blank string is causing RightCount to be 0, thus passing a 0 to the "Right" function which is called on the next line.

So, now the question is, what else can I use other then CGI.PATH_INFO?
I didn't write this code initially so I'm not yet certain what it's doing or I should say, how I could do it another way.
Hm.. this thread mentions changed behavior in CF10 - some related to IIS. That sounds like your blank value.  I haven't read the whole thread, but one guy suggests this returns the same result


But you'd have verify it returns the expected result on your end.

Out of curiosity, create a test page that does a simple dump of the CGI scope <cfdump var="#CGI#">.  What's the output if you append a few dummy url variables? ie


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
>> getDirectoryFromPath(CGI.SCRIPT_NAME)

More reading suggests it may not be quite that clear cut. See the URL's in this response Seems like expectations vary depending on what the app is doing (rewriting, etc...).  I'd definitely recommend more research and testing, to figure out what's the expected result for your app.

Came across this blog entry while researching. Gotta love the title ;-)

You are not going crazy CGI.PATH_INFO is empty in ColdFusion 10

CF10 Bug Report 3305486
nachtmskAuthor Commented:
Thanks for the information. That fixed it.
CGI.PATH_INFO is indeed blank in CF11, but not in CF9. I verified it with cfdump.
I changed to CGI.SCRIPT_NAME, which appears to return the same thing that PATH_INFO used to return and my problem is solved.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.