Attribute validation error for tag cfoutput

2,020 views
Skip to first unread message

Scott Thornton

unread,
Jan 30, 2012, 11:00:41 PM1/30/12
to cfau...@googlegroups.com

G'day,

 

A strange problem just cropped up in one of my live systems ( CF 9 ).

 

This page works on a CFMX6.1 server ( against a different database ).

The page works when I run it locally ( cf 9 against the same datbase  )

 

When I look at the debug output for the page, I can see that the query "BBERA_OK" works, but does not return any rows which is fine

 

Essentially the code reads

 

<cfquery name="BBERA_OK" datasource="#DSN#">

select

a bunch of stuff

from

a lot of tables

</cfquery>

 

<cfoutput  query="BBERA_OK"> ( on line 111 )

 

  do stuff

 

</cfoutput>

 

 

From the exception log:

"Error","jrpp-3768","01/31/12","14:38:47","Bilby","Attribute validation error for tag cfoutput.The value of the attribute query, which is currently BBERA_OK, is invalid. The specific sequence of files included or processed is: D:\platypus2\batch\sbbp40.cfm, line: 111 "

coldfusion.tagext.InvalidTagAttributeException: Attribute validation error for tag cfoutput.

                at coldfusion.tagext.QueryLoop.setQuery(QueryLoop.java:86)

                at cfsbbp402ecfm359291098._factor12(D:\platypus2\batch\sbbp40.cfm:111)

                at cfsbbp402ecfm359291098.runPage(D:\platypus2\batch\sbbp40.cfm:1)

                at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:231)

                at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:416)

                at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)

                at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:381)

                at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)

                at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)

                at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)

                at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:79)

                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.filter.CachingFilter.invoke(CachingFilter.java:62)

                at coldfusion.CfmServlet.service(CfmServlet.java:200)

                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:286)

                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)

 

From the application log

 

"Error","jrpp-3768","01/31/12","14:38:47","Bilby","Attribute validation error for tag cfoutput.The value of the attribute query, which is currently BBERA_OK, is invalid. The specific sequence of files included or processed is: D:\platypus2\batch\sbbp40.cfm, line: 111 "

 

I have confirmed that the source cfm file is the same locally, and on both servers.

 

I cannot think of a single thing that would cause this problem, and I am out of ideas.

 

Any suggestions?

Scott Thornton

unread,
Jan 30, 2012, 11:22:30 PM1/30/12
to cfau...@googlegroups.com

I changed my code to work within a cfloop ( which it should have been anyway ), and it works okay.

Kym Kovan

unread,
Jan 30, 2012, 11:29:49 PM1/30/12
to cfau...@googlegroups.com
When I see these sorts of issues I restart CF and they magically vanish :-)

On 31/01/2012 15:00, Scott Thornton wrote:
> G'day,
>
> A strange problem just cropped up in one of my live systems ( CF 9 ).
>
> This page works on a CFMX6.1 server ( against a different database ).
>
> The page works when I run it locally ( cf 9 against the same datbase )
>
> When I look at the debug output for the page, I can see that the query
> "BBERA_OK" works, but does not return any rows which is fine
>
> Essentially the code reads
>
> <cfquery name="BBERA_OK" datasource="#DSN#">
>
> select
>
> a bunch of stuff
>
> from
>
> a lot of tables
>
> </cfquery>
>
> <cfoutput query="BBERA_OK"> ( on line 111 )
>
> do stuff
>
> </cfoutput>
>

--
Yours,

Kym Kovan
mbcomms.net.au


charlie arehart

unread,
Jan 31, 2012, 11:02:36 AM1/31/12
to cfau...@googlegroups.com

Hmm. You’re saying that a CFLOOP QUERY worked where a CFOUTPUT QUERY would not? That would indeed be curious.

If you’d still needed to (or want to) solve the mystery, I would have suggested doing a CFDUMP of the variable, to see what it said it was. Assuming that when you ran it, you still got an error referring to it (next) in a CFOUTPUT QUERY, it would be very strange if the CFOUTPUT QUERY failed where the CFDUMP showed that it was indeed a query.

Now, I press that point about making sure that the CFOUTPUT QUERY fails after the dump, because there is the possibility that it might work, which would suggest that there’s some other time when it fails, and it’s THEN that the CFDUMP would be most valuable. I could think of a number of scenarios where a variable might not have what it seems it should have. I won’t take your collective time speculating. But if you do get the error and do get a dump, and it is a query, let us know what you find. Again, that’s all if you want to press on. You may be happy to just leave it as a query loop.

/charlie

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfau...@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

Scott Thornton

unread,
Jan 31, 2012, 4:27:19 PM1/31/12
to cfau...@googlegroups.com

Hi Charlie,

 

Thanks as always for your continued support of the CFAussie forum. I always appreaciate your replies.. they include so much detail!

 

I attempted to CFDUMP the query straight after the CFQUERY, and the attribute was not defined, which is very odd. Yes, I triple checked the name of the query, as I thought I must have made a mistake typing and ended up copy-and-pasting it :-)

 

However I could defintly see that the query had executed and had returned 0 rows from the debug output displayed below the error text.

 

Odder still, I cant get the error to occur again this morning, despite the query returning 0 rows still.

 

I have put back in the cfoutput to try  and see if it happens again. I really hope I can replicate it someday.

 

Thanks again.

charlie arehart

unread,
Jan 31, 2012, 11:53:16 PM1/31/12
to cfau...@googlegroups.com

Thanks for the kind regards, Scott. (Though I know that not everyone likes all the “detail” I offer. It’s an acquired taste!)

So about your results below, I’m curious: are you saying that you also placed a CFOUTPUT loop following the CFDUMP and that *did not* get an error this time? It’s just not clear, because you refer to “the debug output displayed below the error text”, but then you say “I can’t get the error to occur again”.

I press this point because it’s critical (for what I was trying to confirm) that you do BOTH the CFDUMP and THEN the CFOUTPUT loop in the same request. If the dump worked but then the CFOUTPUT loop did not, it would be vital to confirm then what the dump showed. Again, I have a suspicion of something that could be happening, but let’s the diagnostics tell us more before speculating. (Also, what version of CF are you running?)

Finally, are you saying you’re surprised that the query returned 0 records? That too is not clear. Of course, if a query had 0 records, a CFOUTPUT loop would not error but just do nothing, so I realize that’s no “the cause” of your error. We just can’t tell if you are surprised that it returned 0 records.

Scott Thornton

unread,
Feb 1, 2012, 12:32:13 AM2/1/12
to cfau...@googlegroups.com

G'Day,

 

the code original read:

 

<cfquery name="queryname">

select

..

from

group by

..

having

..

</cfquery>

<cfoutput query="queryname">

</cfoutput>

 

The error referred to <cfoutput query="queryname">

 

The debug output was the generic query debug output you might see when debugging was turned on on the server, which gets displayed after the errors etc.

 

eg

 

SQL Queries

queryname (Datasource=datasourcename, Time=62ms, Records=0)

 

To test what was happening, I Used CFDUMP, eg:

 

<cfquery name="queryname">

select

..

from

group by

..

having

..

</cfquery>

<cfdump var="#queryname#">

<cfoutput query="queryname">

</cfoutput>

 

and the error moved to the <cfdump var="#queryname#">

 

The code is now running as expected though, I removed the CFLOOP and put back in CFOUTPUT and the error is no longer reproducable. It is as if nothing has happened at all and the page never had an error.

 

No server restart required I might add.

charlie arehart

unread,
Feb 1, 2012, 9:08:33 AM2/1/12
to cfau...@googlegroups.com

OK. If it happens again and you want to debug it, and especially to catch it while the code is running in production, rather than doing the cfdump to the screen, put a test for isquery(“queryname”) before the CFOUTPUT LOOP, and if it’s not a query, then do the CFDUMP but write it to a file (using the new OUTPUT attribute for CFDUMP, added in CF8), to see what is in that variable at that point.

I’m not surprised that the error is coming and going. I suspect (and have from the beginning) that you have a situation where another thread is overwriting the variable. I appreciate that you might say, “but the query is in the variables scope, so how could that happen?” But let’s not speculate. Let the diagnostics tell you what’s going on. If the trap above springs, you’ll see what CF thinks at that moment the variable is, and you may from that then recognize (or can search) where that may be being set, elsewhere in code.

Hope that’s helpful.

 

/charlie

 

From: cfau...@googlegroups.com [mailto:cfau...@googlegroups.com] On Behalf Of Scott Thornton
Sent: Wednesday, February 01, 2012 12:32 AM
To: cfau...@googlegroups.com
Subject: RE: [cfaussie] RE: Attribute validation error for tag cfoutput

 

G'Day,

Reply all
Reply to author
Forward
0 new messages