Skip to main content
Inspiring
February 19, 2009
Question

cfthread issue: Variable _cffunccfthread_cfact is undefined

  • February 19, 2009
  • 5 replies
  • 2176 views
I'm occasionally getting this error using the cfthread tag but don't know where to start to debug it. It doesn't always happen but a few times a day and sometime it spikes out my available memory. Can anyone point me in the right direction to tracking down this bug? I'm running the latest CF8 on Jrun.

Here is ths complete error:

1 "Error","cfthread-27","02/18/09","17:45:18",,"ThreadID8C35519B-C9E7-97E1-B91F-CE9A5082B3DC: Variable _cffunccfthread_cfact_InsertStatus2ecfm7047469871 is undefined. "

The "ThreadID8C35519B-C9E7-97E1-B91F-CE9A5082B3DC" is the name I gave to the thread using a GUID. The "InsertStatus2ecfm" part is the coldfusion template name.

Here are the exceptions building up to it:

1 "Error","cfthread-27","02/18/09","17:45:18",,"AUTOMATEDPROCESSID8C35519B-C9E7-97E1-B91F-CE9A5082B3DC: Variable _cffunccfthread_cfact_InsertStatus2ecfm7047469871 is undefined. "
2 coldfusion.runtime.UndefinedVariableException: Variable _cffunccfthread_cfact_InsertStatus2ecfm7047469871 is undefined.
3 at coldfusion.runtime.CfJspPage._get(CfJspPage.java:251)
4 at coldfusion.runtime.CfJspPage._get(CfJspPage.java:236)
5 at coldfusion.thread.Task.invokeFunction(Task.java:233)
6 at coldfusion.thread.Task.run(Task.java:141)
7 at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:201)
8 at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
This topic has been closed for replies.

5 replies

BKBK
Community Expert
Community Expert
February 25, 2009
We shouldn't leave the impression here that there is an issue with cfthread. As far as I know, there are no issues with cfthread.

It is in fact one of the most welcome additions to Coldfusion. It is lighter than a CFML gateway and offers you more control. However, working with threads requires skill and caution.



Participant
April 22, 2013

Hi, I've come across this same problem, but I cannot use event gateways as a fix.

It's one thread that causes the problem.

coldfusion.runtime.UndefinedVariableException: Variable _cffunccfthread_cfc8570911 is undefined.

It occurs after about 10 or 15 minutes of running the same test continously (about 600-800 runs). The threads (10 of them) are defined and run in a loop. Has anyone come across this issue before? I can't find anything else other than this topic online.

BKBK
Community Expert
Community Expert
February 24, 2009
I've replace the cfthread tag with a call to an eventgateway with the same code

Conceptually the same thing, really. Nice it now works.

Neo RyeAuthor
Inspiring
February 24, 2009
I'd also like to give credit to FusionReactor and their server monitor tool. This tool let me track down the specific piece of code having the issue so I could focus on it specifically. I was having memory spikes but didn't know where they were happening untill I installed it and logged it happening.

Anyway, if anyone is having issues or just want to monitor their CFMX instances I'd suggest they give it a try. I find it handy for general site monitoring too.
BKBK
Community Expert
Community Expert
February 20, 2009
I'm not too sure about the way you introduce metadata into the cfthread tag. Couldn't you have done something like this?

<cfthread action="run" name="ThreadID#CreateGUID()#">
<cfmodule template="/index.cfm" fuseaction="Events.AutomatedProcess_Trigger" Customer_UserID="#getCustomer.Customer_UserID#"
LocationID="#getCustomer.LocationID#"
Lead_StatusID="#getCustomer.Lead_StatusID#">
</cfthread>

Neo RyeAuthor
Inspiring
February 23, 2009
I've replace the cfthread tag with a call to an eventgateway with the same code and I no longer have the issue. I suspect it's down deeper in the core cfmx code than I want to go. I use cfthread in other places with no issue, it's just that this code is run often and can run for up to a minute, so I must have run into an issue there somewhere. I'm fine moving it to an eventgateway as it appears to like it there.
Inspiring
February 19, 2009
I've also tried placing try/catch around all the code and it does not catch the error, it only shows up in the exception & application log file in the cf administrator, so I don't think it's specifically code based. Although the module it calls is fairly complex and can take a minute or two to complete. This template also get called a lot.
BKBK
Community Expert
Community Expert
February 19, 2009
I think it's better to show the code.

Inspiring
February 19, 2009
This is the code in the InsertStatus.cfm template. It's not that complex:

<cfthread action="run" name="ThreadID#CreateGUID()#" Customer_UserID="#getCustomer.Customer_UserID#" LocationID="#getCustomer.LocationID#" Lead_StatusID="#getCustomer.Current_LeadStatusID#">
<cfmodule template="/index.cfm" fuseaction="Events.AutomatedProcess_Trigger" Customer_UserID="#Attributes.Customer_UserID#"
LocationID="#Attributes.LocationID#"
Lead_StatusID="#Attributes.Lead_StatusID#">
</cfthread>