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    1.171.166.141
     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    61.3.56.138
     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

x
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.

_agx_Commented:
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
......
<CFSET PATH=GETDIRECTORYFROMPATH(#CGI.CF_TEMPLATE_PATH#)>
<CFIF (CGI.CF_TEMPLATE_PATH IS NOT "#path#error_request2.cfm")
 AND (CGI.CF_TEMPLATE_PATH IS NOT "#path#error_request.cfm")>

<CFERROR TYPE="REQUEST" 
   TEMPLATE="error_request.cfm" 
   MAILTO="systemadmin@foo.com">
</CFIF>
....

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

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

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

   <H4>Please wait while the administrator is
   notified....</H4>
   <FORM ACTION="error_request2.cfm" 
      METHOD="POST" 
      NAME="ErrorForm">
      <INPUT TYPE="Hidden" 
         NAME="ErrorDate" 
         VALUE="#Error.DateTime#">
      <INPUT TYPE="Hidden" 
         NAME="Browser" 
         VALUE="#Error.Browser#">
      <INPUT TYPE="Hidden" 
         NAME="RemoteAddress" 
         VALUE="#Error.RemoteAddress#">
      <INPUT TYPE="Hidden" 
         NAME="HTTPReferer" 
         VALUE="#Error.HTTPReferer#">
      <INPUT TYPE="Hidden" 
         NAME="Template" 
         VALUE="#Error.Template#">
      <INPUT TYPE="Hidden" 
         NAME="QueryString" 
         VALUE="#Error.QueryString#">
      <INPUT TYPE="Hidden" 
         NAME="MailTo" 
         VALUE="#Error.MailTo#">
      <TEXTAREA NAME="Diagnostics"
             COLS="42"
             ROWS="1"
             WRAP="VIRTUAL">#Error.Diagnostics#</TEXTAREA>
   </FORM>
   
   <HR>For questions please email: 
   <A HREF="mailto:#Error.MailTo#">#Error.MailTo#</A>
</DIV>

</BODY>
</HTML>

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

....

</HEAD>

<body id="why" class="no-top-nav left-main">
	
	<div id="wrap">
		......
				</nav>
-->
				<h1 class="top-headings">Internal Error...</h1>
				
			</div>			
		</header>
		
		<!-- Main Content BEGIN -->
		<div id="middle">
			<section id="main" class="container" role="main">
				<div class="left-col">
					<article>
	<CFIF NOT ISDEFINED("FORM.Diagnostics") AND
      NOT ISDEFINED("FORM.ErrorDate") AND 
      NOT ISDEFINED("FORM.Browser") AND
      NOT ISDEFINED("FORM.RemoteAddress") AND
      NOT ISDEFINED("FORM.HTTPReferer") AND
      NOT ISDEFINED("FORM.Template") AND
      NOT ISDEFINED("FORM.QueryString")>
      <cfoutput>
     	  <p>
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.
</p>
      </cfoutput>

<cfelse>     
   
<CFOUTPUT>

<cfmail to="systemadmin@foo.com" from="mailadmin@foo.com" 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)#
		
</cfmail>

      <H3>The Application Has Encountered an
      Error!</H3>
      <HR>
<p>   
  
   Here is some of the information that has been
   submitted to the site administrator. <P>
   <UL>
   <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>
   <LI><B>Page on which error occurred:</B>
   
   #FORM.HTTPReferer#
   </LI>
     <LI><B>HTTP Referrer</B>     #FORM.HTTPReferer#
     </LI>
	 <LI><B>Template</B>     	   #FORM.Template#
     </LI>
     <LI><B>Query String</B>      #FORM.QueryString#
     </LI>
     </UL>
  </P>
     <TABLE class="ErrorTable">
    <th>HTML Code Format</th>
<TR>
<TD>#HTMLCodeFormat(FORM.Diagnostics)#</TD>
</TR>
</table>

   
   

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

</p>


</CFOUTPUT>
</cfif>


</article>

......
					
					
</body>
</html>

Open in new window

_agx_Commented:
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.

_agx_Commented:
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?
_agx_Commented:
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.