Copy link to clipboard
Copied
Hi,
I have an Intranet application running on a CF8 Enterprise edition and the last few weeks we see a strange behaviour of our server: sometimes it just returns a blank page.
This occurs in the morning of a random day, when the first people try to log in to the Intranet. When we view the source of the returned page, it is totally blank, not even a hint of HTML code. We tried finding a clue in the log files, but as no error whatsoever is produced, no trace can be found.
The current solution is restarting the 'ColdFusion 8 Application Service' and everything works as normal. It intervals at around 5 days.
CF version : 8,0,1,195765
Operating System : Windows 2003 (5.2)
Java Version : 1.6.0_04
Enabled Session and Application variables.
Does anybody out there experiance the same or comparable problems? Does anybody know of a more permanent solution?
Thanks for ready.
Copy link to clipboard
Copied
Are you using any type of framework? Typically if CF times out or has an error, it will display a specific error message even if the server has crashed.
Copy link to clipboard
Copied
I do not use any kind of predefined framework (the Intranet app predates all those).
I did however found out there was a scheduled task to clear the application store ever night at 11h. Also I've seen that the default APPLICATION timeout was 2 hours while my app configured it to one day.
I cleaned that up by setting the default timeout back to two days and stopping the scheduled task.
The believe would be that when the APPLICATION store was cleared but timed out, everything would work as expected. But when the cleared application would not timeout, will it still be initialized? (e.g. firing OnApplicationStart in cfc) When it would not be, I would assume it throws an error that the datasourcename for the DB was missing instead of the empty page.
The thing to note about the situation is that the setup was not changed for at least 6 months, and these happenings just started with no apparent reason.
ps the scheduled task was there to clear queries which resided in the APPLICATION scope, and needed refreshing each day
Thanks for the reply, I really hope to get to the bottom of this.
Copy link to clipboard
Copied
Bert,
It sounds like you're using Application.cfc, well based on the onApplicationStart reference, anyway! If this is the case, are you using the onError method? It's been good to me at times when I've hit a wall.
When I've hit a snag in my bug hunting/error fixing, I will add a CFFILE tag to the onError method, writing the argument.exception details to a file on the server, naming the file with a time stamp (so it doesn't get overwritten). Of course, writing the details to a DB might be easier to manage on an active Intranet app!
I know it's not a 'solution' but it's been a useful tool for me when I'm stumped and has, at times, turned up error information I don't get elsewhere.
Copy link to clipboard
Copied
Hi,
I indeed use an Application.cfc and the main reason to was so I could use the OnError method. In this method I defined the logic to email all developers cfdumps of the following scopes : exception,session,url,form,cgi. After that, the request is relocated to a generic error page with cflocation.
In this way I can see the error, template and incoming parameters for this template. It has been a serious help in debugging our Intranet.
Used methods :
OnApplicationStart : loads DSN,paths, language dependant labels,default queries, some cfc's into APPLICATION scope. Also cflog's the start/flush of the app.
OnRequestStart : used to set some locals and check for a URL.flush param to reload OnApplicationStart.
OnError : see above
OnApplicationEnd : used to cflog the end of the application.
As to the matter of the returned empty page, there is no error generated. So no email was send.(and no log generated)
I tried to validate my previous assumptions by starting up the development site and clearing the entire application scope. The next request to the site does fire the OnApplicationStart method.
Thanks & cheers,
Bert.
Copy link to clipboard
Copied
Shoot! Was hoping you didn't use it ! I was afraid that it might not report anything given the 'blank output' from CF.
Here are some thoughts:
1. Turn on System Profiling/Monitoring in the Administrator (it has some decent tools there, if you haven't used it previously)
2. Ensure that your CF enterprise edition has a valid license key (I'm guessing it does but not having a license key in the Enterprise edition, or Standard, can cause problems so it's good to just check)
3. I read on CFDEV about a similar sounding issue and one response mentioned an incorrectly used/developed onError method, which I thought was interesting (can you post that onError code...no biggie if not, of course!).
4. When you get the dreaded 'blank screen' can you get any CFM pages to render (even a simple test page that just sets and outputs a variable)?
5. Is there a condition in which OnRequestStart could return false and not true? If so, this would cause all other request processing won't fire. http://livedocs.adobe.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=ColdFusion_Documentation&file=00000700.htm
I think numbers 2 and 5 might be good places to start, especially number 5. It seems to fit the symptoms pretty well thus far.
Best,
Craig
Copy link to clipboard
Copied
Here we go :
1. We used the Monitoring tool from the moment we upgraded to CF8, mainly to set alerts on JVM and unresponsive server. As in the logfiles, nothing of interest appears on the monitor.
2. I verified that the key is valid and no doubles exist on the network.
3. See below
4. Other templates do not render either. If I call the Intranet by another alias (being IP or machine name) it does create a new memory store and initializes the app correctly. (We normaly work with an alias to call the Intranet, I also verified that the alias is correctly translated and I do call the correct server)
5. I hard-coded <cfreturn true> at the end of the OnRequestStart method. (I also read that post somewhere I recall )
Code for OnError :
<cffunction name="OnError" access="public" returntype="void" output="true" hint="Fires when an exception occures that is not caught by a try/catch.">
<cfargument name="Exception" type="any" required="true" hint="Struct identical to a cfcatch variable">
<cfargument name="EventName" type="string" required="false" default="">
<!--- to catch cfabort actions, which automatically fire OnError(), also expired sessions should not be caught here --->
<cfif ListFindNoCase("onSessionEnd,onApplicationEnd",ARGUMENTS.EventName)
OR ARGUMENTS.Exception.Type EQ "coldfusion.runtime.AbortException"
OR Not IsDefined("SESSION.user.id")>
<cfreturn/>
</cfif>
<!--- do main error catching routine --->
<cfif IsDefined("SESSION.user.id")> <!--- User is not timed-out? --->
<cfif NOT IsDefined("SESSION.showErrors")> <!--- option can be set for developers--->
<!--- session is still active --->
<cfmail from="<our mail address>" to="<our develpment group address>" subject="Site Error" type="html">
<html>
<head>
<title>Site Error</title>
</head>
<body>
<div><cfdump var="#ARGUMENTS.Exception#" label="EXCEPTION"></div>
<cfif IsDefined("SESSION")>
<div><cfdump var="#SESSION#" label="SESSION"></div>
</cfif>
<cfif IsDefined("URL")>
<div><cfdump var="#URL#" label="URL"></div>
</cfif>
<cfif IsDefined("FORM")>
<div><cfdump var="#FORM#" label="FORM"></div>
</cfif>
<cfif IsDefined("CGI")>
<div><cfdump var="#CGI#" label="CGI"></div>
</cfif>
</div>
</body>
</html>
</cfmail>
<cflocation url="/ErrorTemplates/Error_500.cfm" >
<cfelse> <!--- User is developer, just show all scopes --->
<div><cfdump var="#ARGUMENTS.Exception#" label="EXCEPTION"></div>
<cfif IsDefined("SESSION")>
<div><cfdump var="#SESSION#" label="SESSION"></div>
</cfif>
<cfif IsDefined("URL")>
<div><cfdump var="#URL#" label="URL"></div>
</cfif>
<cfif IsDefined("FORM")>
<div><cfdump var="#FORM#" label="FORM"></div>
</cfif>
<cfif IsDefined("CGI")>
<div><cfdump var="#CGI#" label="CGI"></div>
</cfif>
</div>
</cfif>
<cfelse>
<!--- session has expired --->
<cflocation url="/ErrorTemplates/Session_Expired.cfm" >
</cfif>
</cffunction>
Copy link to clipboard
Copied
I was just reading about problems with onSessionEnd and onApplicationEnd and onError. I'm going to fire up CF8 (I use Railo 3.1 mostly now) and run a few tests to see what happens when I invoke onError from the on...End methods. I'll post some results shortly.
Crap: forgot to ask, what do you do in onSessionEnd and onApplicationEnd?
Cheers,
Craig
Message was edited by: craigkaminsky
Copy link to clipboard
Copied
As mentioned a few replies back, I do not currently use the OnSessionEnd method. The OnApplicationEnd method just does a cflog of the ending application
This Intranet was originally build in CF4.5 (or earlier). I just gradually update all code. Thats one of the reasons the Application.cfc is not used to its full potential. For instance, all user session handling is done manually. (including a template which tests session var at start of each cfm file)
I did some more testing. I disabled debugging info and in the OnRequestStart returned false : the source code returned was a blank html page, containing the document type, html-, head- and body tags. (with an empty body). But it does return some form of HTML code... weird.
In any case, I really appreciate the time you are putting into this !
Thanks !
Copy link to clipboard
Copied
Sorry about that, Bert. I was looking at the onError code, which was checking for an onSessionEnd event and didn't check earlier in the post for added details. Does onApplicationEnd do anything other than log the end of the application?
I did see a post on ExpertsExchange that was related to II6 and CF8 and blank pages. The link is below but I didn't want to sign up for one of their "free" 7 day accounts, so I don't know if it would be useful but the topic at least matches, sort of, what you're dealing with:
http://www.experts-exchange.com/Software/Server_Software/Web_Servers/ColdFusion/Q_23639104.html
Copy link to clipboard
Copied
No, the OnApplicationEnd method only contains the cflog statement.
Thanks for the link, I read the post and they mention a Jrun hotfix exists for this behaviour. (google cache, you know )
I forgot to mention that the current fix for this problem is restarting the Coldfusion Application Service. Also as we migrated recently to a virtual server setup, I have no idea what IIS runs on currently. (before it used to be Server 2000 on IIS5) As it's Windows 2003 now, I assume it would be IIS6...
I will check the version of Jrun and the rest first thing tomorrow.
Cheers,
Bert.
Copy link to clipboard
Copied
Bert, I've got an idea (sort of ).
I was working on a CF utility this afternoon, switching back and forth between Railo 3.1 and CF8. I ran some tests on Railo, then stopped it and switched to CF8. I reloaded my page and got the old blank white page with no code whatsoever. After I laughed about this, I decided to check the site in Firefox (was on Safari) and use Firebug/ColdFire to see if I could see anything in greater detail.
While there was no code output, as you experienced, I was able to see in the ColdFire Execution tab/screen, that the onError method of Application.cfc was, in fact, called. Although my onError method is but a skeleton, I thought this was sort of encouraging.
I added the following code, just under the CFARGUMENTS:
<cfsavecontent variable="theError">
<cfdump var="#arguments.exception#" />
</cfsavecontent>
<cffile action="write" file="/path/to/my/Desktop/funky_err.html" output="#theError#">
I then reloaded the page and checked my Desktop. I was able to see the CFDUMP of the exception structure and read my error message. Once I fixed that error, I was able to see my page per normal and removed the above code from my onError method, never having to restart CF or anything like that.
This got me thinking that this tactic might be worth a try the next time you encounter the blank page output. When it occurs, reopen the page in Firefox, checking to ensure via ColdFire that the onError method was indeed fired. If so, you can then try to force onError to output the details (whatever means work for you, of course) and see if you can't get some more information.
Anyway, just a thought...
Copy link to clipboard
Copied
That is indeed a good tactic. I've put the dump-to-file code in place (in comment) for when it happens, so I'll be ready for it.
I also installed the Firefox plugins. (We work exclusively with IE6 SP3, but I gradually update the javascript/html/css to the DOM standard.)
We use IIS6, which ships with Windows 2003 and, concerning the hotfix, my Jrun is of a newer version then the one's mentioned in the article.
Thanks,
Bert.
Copy link to clipboard
Copied
I did not experience the blank page behaviour again, so I'm going to conclude that emptying the application scope is a bad thing.
Special thanks to craigkaminsky for his support.
Cheers,
Bert.
Copy link to clipboard
Copied
Bert,
Glad to hear you're not getting the blank page anymore! I'm sure that's quite a relief not to deal with.
Cheers,
Craig