Baffling ColdFusion Random Error CF11 referring from another site

Every now and again I get error see below. It is traffic linking through from various sites. I go to the referring site and follow their link and it goes through OK

Any idea what causes this in my site index.cfm?  And what does the <pre> mean? Any idea how to prevent?

example 1
ErrorDate         Thu Jul 23 23:49:50 CDT 2015
     Browser           Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/44.0.2403.89 Safari/537.36
     Remote Address
     HTTP Referrer     http://random-referring-site
         Template          /index.cfm
     Query String      
     HTML Code Format  <PRE>null null &lt;br&gt;The error occurred on line -1.</PRE> 

example 2
ErrorDate         Thu Jul 23 22:47:38 CDT 2015
     Browser           Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36
     Remote Address
     HTTP Referrer     http://random-site2
         Template          /index.cfm
     Query String      hop=xxxxxx
     HTML Code Format  <PRE>null null &lt;br&gt;The error occurred on line -1.</PRE> 

Open in new window

Ian WhiteOwner and FounderAsked:
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.

Yeah, that error can be tough to track down.  I've seen it a few times in older versions.  It's been a while but from what I remember, it's a very generic error that can occur in any recent version of CF. There is no single cause or cure.   If you do a search, it shows up in connection with everything from image code, to stored procs to client variables/cookies (if you are using client variables, the latter might be a good place to start). I vaguely recall it often being somewhat of a red herring.  Meaning the application is throwing a meaningful exception somewhere but it bubbles up into a cryptic "null null The error occurred on line -1" error. .  

In my case, I checked the logs and the exception trace was really generic, like "NullPointerException".  Not very useful since NullPointerException can occur with any code at all.  Fortunately, it was reproducible in the app, but because it's so generic I ended up having to comment out code an try it a few lines at a time ..  arduous, but eventually located the problem.  Turned out to be some obscure problem with the framework the app was using.

Before you go that route, check all of your logs ({cf_root}\logs\ and {cf_root}\runtime\logs\ ) for errors around that time period and post the full trace here.  Don't truncate the traces because any "caused by" sections will appear at the bottom of the trace.

Also, how are you trapping the above error? ie Specially what error handling is used in the application,  Application.cfc/OnError, Application.cfm/cferror  ?
Ian WhiteOwner and FounderAuthor Commented:
Ok Thanks for your help. No don't use client variables. I use session variables only. I trap in the application.cfm route to error page  then display the error and send myself an email with the error.

From application.cfm
<CFIF (CGI.CF_TEMPLATE_PATH IS NOT "#path#error_request2.cfm")
 AND (CGI.CF_TEMPLATE_PATH IS NOT "#path#error_request.cfm")>


<!--- error_request.cfm --->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<META NAME="robots" CONTENT="noindex">
   <TITLE>House Carers</TITLE>
<BODY BGCOLOR="#ffffff" onLoad="document.ErrorForm.submit()">

<DIV ALIGN="center">
   <FONT FACE="Arial" SIZE="2">
   <H3>The Application Has Encountered a Request Error!</H3>

   <H4>Please wait while the administrator is
   <FORM ACTION="error_request2.cfm" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <INPUT TYPE="Hidden" 
      <TEXTAREA NAME="Diagnostics"
   <HR>For questions please email: 
   <A HREF="mailto:#Error.MailTo#">#Error.MailTo#</A>


<!DOCTYPE html>
<html class="no-js">
<META NAME="robots" CONTENT="noindex, nofollow">



<body id="why" class="no-top-nav left-main">
	<div id="wrap">
				<h1 class="top-headings">Internal Error...</h1>
		<!-- Main Content BEGIN -->
		<div id="middle">
			<section id="main" class="container" role="main">
				<div class="left-col">
      NOT ISDEFINED("FORM.ErrorDate") AND 
      NOT ISDEFINED("FORM.RemoteAddress") AND
      NOT ISDEFINED("FORM.Template") AND
      NOT ISDEFINED("FORM.QueryString")>
An internal server error has occurred, but our
squad of CF Ninjas are looking into it! Naturally,
you won't be able to tell that they're doing
anything because they are Ninjas! But, rest assured,
stuff is getting done.


<cfmail to="" from="" subject="Error has occured" >
     ErrorDate         #FORM.ErrorDate#
     Browser           #FORM.Browser#
     Remote Address    #FORM.RemoteAddress#
     HTTP Referrer     #FORM.HTTPReferer#
	 Template     	   #FORM.Template#
     Query String      #FORM.QueryString#
     HTML Code Format  #HTMLCodeFormat(FORM.Diagnostics)#

      <H3>The Application Has Encountered an
   Here is some of the information that has been
   submitted to the site administrator. <P>
   <LI><B>Date of the Error:</B> #FORM.ErrorDate#</LI>
   <LI><B>Browser being used:</B> #FORM.Browser#</LI>
   <LI><B>Remote Address:</B> #FORM.RemoteAddress#
   <LI><B>Page on which error occurred:</B>
     <LI><B>HTTP Referrer</B>     #FORM.HTTPReferer#
	 <LI><B>Template</B>     	   #FORM.Template#
     <LI><B>Query String</B>      #FORM.QueryString#
     <TABLE class="ErrorTable">
    <th>HTML Code Format</th>


      <B><A HREF="index.cfm">Click here for Foo Home
      <HR>For questions please click the contact link below 





Open in new window

What did you find in the logs?
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Also, in addition to checking the logs:

A) Are you including "error.generatedContent" in the debugging information? That variable is available for "request" handlers and might provide more details.

B) Does the application have an "exception" handler? Unlike "request" handlers, those can include cfml code.
Ian WhiteOwner and FounderAuthor Commented:
Thanks How do I set up A?
No I only have a request handler.
Can you point me to a exception handler?
So the exception handler handles everything ? Including request errors?
Do I change the request handler to an exception handler?
Sorry, work's been busy...

I haven't used an Application.cfm/cferror in a while, but I think request handlers are a subset of exception handlers.  In which case switching to an exception handler should cover everything.  You can always add a site wide error just in case as a backup.

The nice thing about exception handlers is that you can use cfml code.  There's a very thorough example here.  It's too long to copy, so I'll just include the link.  Basically you could dump all of the scopes available (which is more than in request handlers), see if that yields more info.

BTW, did you ever check the logs?  That might yield more clues in the mean time.

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
Ian WhiteOwner and FounderAuthor Commented:
thanks for your help
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.