Every other request returns no data

I’m a noob to Lucee, but not ColdFusion.
I just installed it, no problems. Configured a datasource and execute and display a query successfully.

Except…

Every other request returns data. Weird…

Server 2016
SQL Server
No errors displayed, don’t see anything in Tomcat, IIS logs.

Help!

Explain?

Simple query and output just to test the server install:

<cfquery name="query01" datasource="myDataSource">
    SELECT top 50 [employeeName]
  FROM [dbo].[myTable]
</cfquery>
<cfoutput>#q1.employeeName#</cfoutput>

Page loads the first time. Hit refresh, nothing. No errors. Debug doesn’t show that the query executed.

However, wait 5 minutes and it returns data. Or refresh twice and it returns data.

Thanks

Hmm, you’re saying that if you just leave the web page there and don’t touch it, the contents will suddenly appear after 5 minutes? Is the server processing for 5 minutes, or does the browser take 5 minutes to display it? I can’t say I’ve heard of either of those issues on a fresh Lucee install, but I would use a combination of Fusionreactor and my browser’s debugger to see what the request is doing.

Let me try to clarify. On the first page load, I get data from the query. If I hit the refresh button, no data, no errors. If I press refresh again, data.
When I load the page and wait 3-5 minutes, press refresh, I get data.
I don’t see any errors. Debug confirms that it didn’t run the query.
It seems like it may be a cache problem or a timing setting.
I have to say that the install was quite easy. I read the docs and threads before I installed and it worked great the first time. I do have years of experience with CF Server, Java and Tomcat so all the instructions were very easy to follow. Great group here! I’m happy that there’s an open source solution for CF!
Since it’s a odd problem, I am going to push forward today with the development and see what happens.
Thanks for the advice and I will update the thread if I figure it out.
It’s a really odd problem, and after I get into development it will probably be easier to diagnose or it could be a one off that goes away.
It is very consistent, every other page refresh I get data. If I wait a few minutes, data.
It’s almost like it’s not finished with the first request. Like it’s still hanging in memory.
IDK :neutral_face:

I did see one problem, the cache files are not being deleted. It may be a authority issue with that directory. I did the install as Administrator and ran all scripts as Administrator.
I don’t like how MS Server tries to constantly protect Admins from themselves. “Are you sure you want to run this? - Are you sure that you’re sure?!?”
Maybe I should have used a Linux Server.

Yeah, I don’t know what you’ve got going on but that’s not typical. I’ve hosted all my sites on Lucee for years now and not seen an issue like that. Can you verify with a tool like FusinoReactor that the request is hitting the server. Also, dump/abort at the top of your Application.cfc to confirm if the request is starting but maybe aborting elsewhere down the page.

the cache files are not being deleted

What cache files? I’m not sure what you’re talking about.

I’ll have to find them, I didn’t see the error this morning.

I’ll say one thing, it’s consistent!

First Load - you can see the SQL is processed:

getMBT (Datasource=XXXX, Time=21.1 ms, Records=2) in :\inetpub\wwwroot\mac\getMBT.cfm:1
Execution Time

Total Time Avg Time Count Template
125 ms 125 ms 1 C:\inetpub\wwwroot\mac\getMBT.cfm
0.447 ms 0.447 ms 1 C:\inetpub\wwwroot\mac\application.cfc
0.065 ms 0.065 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onRequest
0.007 ms 0.007 ms 1 C:\inetpub\wwwroot\mac\WEB-INF\lucee\context\Component.cfc
0.007 ms 0.007 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onRequestStart
0.004 ms 0.004 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onRequestEnd
0.042 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
105 ms APPLICATION EXECUTION TIME
21.1 ms QUERY EXECUTION TIME
126 ms TOTAL EXECUTION TIME

red = over 250 ms average execution time

Second Load - does not run the Query and no errors.

Execution Time

Total Time Avg Time Count Template
0.468 ms 0.468 ms 1 C:\inetpub\wwwroot\mac\application.cfc
0.247 ms 0.247 ms 1 C:\inetpub\wwwroot\mac\getMBT.cfm
0.071 ms 0.071 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onRequest
0.007 ms 0.007 ms 1 C:\inetpub\wwwroot\mac\WEB-INF\lucee\context\Component.cfc
0.006 ms 0.006 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onRequestStart
0.003 ms 0.003 ms 1 C:\inetpub\wwwroot\mac\application.cfc$onError
0.045 ms STARTUP, PARSING, COMPILING, LOADING, & SHUTDOWN
0.805 ms APPLICATION EXECUTION TIME
0 ms QUERY EXECUTION TIME
0.85 ms TOTAL EXECUTION TIME

red = over 250 ms average execution time

It’s every other load. This is so weird! Gremlins…

I will update when I figure this one out.

Thanks for responding!

What cache files? I’m not sure what you’re talking about.

You still didn’t answer my question. You need to slow down and provide the exact code your using so we can understand what’s going on. All you provided above was a cfquery and an output.

However, I just saw a post of yours in another thread were you mentioned “cached files” on a post about the <cfcache> tag. Are you using the cfcache tag in your code?? If so, this is very important information that you probably should have put in the very first post. Please provide more context to what you’re doing.

Thre are folders here:
C:\lucee\tomcat\lucee-server\felix-cache

Named:
bundle(0)
bundle(1) and so forth

The folder contains a file named "bundle.info:
Contents of that file are:

53
C:\lucee\tomcat\lucee-server\bundles\org.lucee.ehcache-2.10.3.jar
32
1
1562940044051
0

There is another folder where this file resides, always named “version0.0”
Contents:
bundle.jar
revision.info - which contains:

inputstream:

These are being dynamically generated, and the revision info seems to always have “inputstream:” and nothing following it.

Thanks!

Just going to leave this right here…

https://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-bundle-cache.html

Those files are managed by Lucee, yes. It is part of the OSGI bundle cache, only tangentially related to caching in that it also uses ehcache, but not something you need to worry about.

Also not not likely related to your OP.

HTH

– Denny

Thanks for clarifying what those are. Still having the every other load problem, except when I wait about 5 minutes. Seems like a timeout or something.
– Fred

I think I just found your issue. Look at the second request-- it’s hitting your onError method. IF your onError method in Application.cfc is empty, then the page will just display nothing. Comment out that method or rethrow the error to see what’s actually happening.

1 Like

Bingo - Did I mention it’s been about 7 years since I wrote any CFML? lol :smile:

We used “application.cfm” not “application.cfc” - so it looks a lot different and I did not catch that.

I copied the application.cfc from documentation and the error page is not defined.

So now I am at every other load throws:

500 Internal Server Error

But at least I can research that a little more.

Thanks for the help!

For now just comment out your onError entirely to “see” the error. Or you can dump the exception in the arguments scope and abort.

I’ll do that, I just get the very descriptive Microsoft Error -
500 Internal Server Error
I suppose I can use these as with ACF:

#Error.DateTime#
#Error.Browser#
#Error.HTTPReferer#
#Error.Template#
#Error.QueryString#
#Error.Diagnostics#

I changed the timeout setting for SQL Server from 1 minute to 0 and the error went away.