null null error in cflocation line

Copy link to clipboard
Copied
I am running an application on ColdFusion 8. About twice a month, some parts of my application stop working. The error recorded in in the application log files is the following:
"null null <br>The error occurred on line 149., http://mywebsite.com, /mypage.cfm?id=MYID"
When I look at the line number, it refers to a line containing a cflocation. Any other line numbers recorded during the outage also refer to a line containing a cflocation. A restart of ColdFusion always clears the problem.
Any clues as to why the cflocation tag might all of a sudden start throwing a null null error? This part of the application does not use sessions and during the outage, any program containing the cflocation tag fails at the cflocation line number. After a ColdFusion restart, these same programs are running fine...
Any ideas? Thanks!
Copy link to clipboard
Copied
Could we see the code?

Copy link to clipboard
Copied
Sure, whatever helps shed some light to this problem.
Line 149 is:
<cflocation url="http://#CGI.HTTP_HOST#/v/s/#v_additional_params#id/#v_id#">
Prior to this line there is logic to set v_additional_params and id. The information is being pulled from the DB using CFQUERY. Is this the information you want to see or you want to see the entire program? Thanks for any input!
Copy link to clipboard
Copied
You want to concentrate on the variables.... The null null error almost always indicates a variable that is not defined OR has expired.

Copy link to clipboard
Copied
Thanks for your reply. You brought an interesting point about the variables...I thought that maybe the CF kept losing its reference to the cgi variable but that's not the case. Here is another line that is referenced in the log files:
<cflocation url="#v_link#">
This line contains no reference to cgi variables, just a local variable that is set in the statement prior to it:
<cfset v_link = MyUrlFunction(id1, id2, id3, v_params)>
My Url Function builds the URL based on CGI and this causes no error. The v_link variable is being set right before the cflocation line so I know it always gets executed.
I'm baffled by this problem. My application runs smoothly for weeks and all of a sudden it looks like CF decides to error out on all of my cflocation tag. There is no other indication of trouble. The parts of my application that do not use cflocation run just fine.
There is one thing I noticed last time this happened. I opened CF Administrator and I was able to access it fine. But when I opened the Server Monitor, the JVM crashed instantly and CF did an automatic restart. When I looked at the dump, I noticed the following:
PSYoungGen total 68288K, used 29141K [0xa4160000, 0xa8a60000, 0xa96b0000)
eden space 62208K, 46% used [0xa4160000,0xa5dd55f8,0xa7e20000)
from space 6080K, 0% used [0xa8470000,0xa8470000,0xa8a60000)
to space 6272K, 0% used [0xa7e20000,0xa7e20000,0xa8440000)
PSOldGen total 699072K, used 195804K [0x796b0000, 0xa4160000, 0xa4160000)
object space 699072K, 28% used [0x796b0000,0x855e71c0,0xa4160000)
PSPermGen total 80256K, used 79734K [0x6d6b0000, 0x72510000, 0x796b0000)
object space 80256K, 99% used [0x6d6b0000,0x7248dbd8,0x72510000)
It looks like it ran out of memory but I think this happened because I tried to open the Server Monitor. In the past, the NULL NULL error has happened for 12 hours straight without the server crashing or restarting. I have an alert system that monitors the server response time, JVM memory allocation above a threshold, busy threads, etc but no alerts are issued during these errors...
Any more ideas?
Copy link to clipboard
Copied
I am with Ian here. If you put this just before the cflocation you will confirm the devil in the machine:
<cflog file="nullNullError" text="#CGI.HTTP_HOST#/v/s/#v_additional_params#id/#v_id#">

Copy link to clipboard
Copied
Thanks for your answer...I kept looking around at all my cflocation errors and one was showing up at line 13 on a different program which was:
<cflocation url="/error/page_not_available.cfm">
There are no variables involved in this one...just a simple and straightfoward cflocation...Any ideas why you would all of a sudden start getting a NULL NULL error on this line? Just to recap...this code usually works. All of a sudden, CF starts throwing a NULL NULL error in every page that contains a cflocation and at the cflocation line. Any other programs in the system work as usual. A restart of CF clears the problem and then the application behaves normally and all my code works. Any more ideas?
Thanks!
Copy link to clipboard
Copied
There was a piece on the null null error in Pete Freitag's site in 2004 already. It seems to occur if, for some reason, either of Coldfusion's cookies, CFID or CFTOKEN, is corrupt or missing. That could happen, for example, if you store client variables in a database table which then got corrupted.
That suggests two workarounds. Just before the point of failure, test for the existence of cookie.cfid and cookie.cftoken, and supply a default value when the cookie doesn't exist. The second workaround is to create the client database table anew(if you had been using one).

Copy link to clipboard
Copied
Thanks for your response. My application does not use application or session variables. It does not use cookies either. It's a pretty simple application. Last time the error was happening, I turned off the site-wide error handling and I saw the following error:
ROOT CAUSE:
java.lang.IncompatibleClassChangeError
at coldfusion.tagext.net.LocationTag.doEndTag(LocationTag.java:133)
at coldfusion.runtime.CfJspPage._emptyTag(CfJspPage.java:2641)
at cfinit2ecfm810907047.runPage(/myapp/init.cfm:149)
at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:192)
at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:366)
at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:279)
at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
at coldfusion.filter.NoCacheFilter.invoke(NoCacheFilter.java:46)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.CfmServlet.service(CfmServlet.java:175)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:86)
at coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at jrun.servlet.FilterChain.doFilter(FilterChain.java:94)
at jrun.servlet.FilterChain.service(FilterChain.java:101)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:106)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:284)
at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:543)
at jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:203)
at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:320)
at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:428)
at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:266)
at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
I then decided to start memory tracking in the ColdFusion application. When I clicked the Memory Tracking button, the server crashed. I looked at the log files, showed this error:
# An unexpected error has been detected by HotSpot Virtual Machine:
#
# SIGSEGV (0xb) at pc=0xab8c27b1, pid=23226, tid=1416625072
#
# Java VM: Java HotSpot(TM) Server VM (1.5.0_12-b04 mixed mode)
# Problematic frame:
# J coldfusion.monitor.memory.MemoryTrackerProxy.onAddObject(Ljava/lang/Object;)V
A closer look at the hs error logs:
Heap
PSYoungGen total 76864K, used 69691K [0xa4160000, 0xa96b0000, 0xa96b0000)
eden space 66048K, 97% used [0xa4160000,0xa8075fd8,0xa81e0000)
from space 10816K, 47% used [0xa8c20000,0xa9118dd0,0xa96b0000)
to space 10496K, 0% used [0xa81e0000,0xa81e0000,0xa8c20000)
PSOldGen total 699072K, used 418297K [0x796b0000, 0xa4160000, 0xa4160000)
object space 699072K, 59% used [0x796b0000,0x92f2e790,0xa4160000)
PSPermGen total 82176K, used 81397K [0x6d6b0000, 0x726f0000, 0x796b0000)
object space 82176K, 99% used [0x6d6b0000,0x7262d500,0x726f0000)
The eden space is almost out of memory and the PSPermGen is full. We do get alerts when memory is low or threads are maxed out and we got no alerts. In the past, if I don't open the Administrator, the server will not crash and it will keep erroring out on those programs until I restart ColdFusion. We get no memory alerts or any other alerts in the meantime, which tells me that memory is not the cause of the problem. Any more ideas??? Anybody else having the same problem????
Copy link to clipboard
Copied
My application does not use application or session variables. It does not use cookies either.
Then that bus is going nowhere.

Copy link to clipboard
Copied
Thanks for your suggestion...I appreciate your feedback. I have a feeling that I might have stumbled accross an obscure bug...
Copy link to clipboard
Copied
Any more ideas???
Client variables choking the registry full. See the Client Variables page of the Administrator.

