tracker issue : CF-4204277

select a category, or use search below
(searches all categories and all time range)
Title:

Intermittent NullPointerExceptions occurring when processing OnSessionEnd()

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Paul T. / ()

Created: 04/30/2019

Components: Core Runtime, Session Management

Versions: 2018

Failure Type: Incorrectly functioning

Found In Build/Fixed In Build: 2018.0.03.314033 /

Priority/Frequency: Normal / Unknown

Locale/System: English / Win8 Server 64-bit

Vote Count: 1

===================[Problem Description]=================
Once of our clients is experiencing an intermittent issue with their OnSession() End function in their site application, wherein a the code that they utilize to clear the cart for expiring sessions will encounter a NullPointerException at random intervals each day. 

Unfortunately, there does not appear to be any consistency between this issue and these occurrences, except that the null pointer exception errors that are being encountered had temporarily ceased after finding that at least one of the client's ColdFusion scheduled tasks had stopped running unexpectedly. Wherein the scheduled task in question does not interact with the client's cart, and is mainly used to trigger their application to clear and re-cache certain data. Additionally, I would note that the cache refreshing scheduled task is calling a CFM page that is calling additional pages which handle specific caching tasks via CFHTTP calls, which are nested within CFThread tags to conduct asynchronous execution of the cache refresh steps..

However, while there seems to be some correlation with this setup, the scheduled task in question runs a large number of instances of the task through out the day, wherein only a handful are triggering a NullPointerException error. Additionally it should also be noted that these erroring instances typically occur in batches of approx. 3-5 error occurrences near the same time, while the remaining task executions complete without any indication of an issue.

Overall, we are seeking any assistance in finding the root cause of these exception instances, any additional details that would allow this issue to be investigated further (i.e. any method of getting the CF service to provide additional details regarding the NullPointer Exception encountered), or a fix for an issue that has been reported within CF releases 11, 2016, and 2018.
===================================================================


===================[Resolution Steps Attempted]=================

In this case, this issue has persisted within the client's original CF11 services, as well as a new CF2018 instance that we had setup to migrate the client's services onto due to CF11's imminent deprecation,wherein both CF11 and CF2018 had been running the latest available Hotfixes. 

Furthermore, this issue has persisted after upgrading the CF11 service to the latest version of Java  8 available; In addition to the latest JAVA 8, 10, and 11 releases on CF2018.

Finally, we have also re-built the client's Scheduled Tasks from scratch in CF2018, after finding some details in the previous report of this issue that issues with the server's Neo-Cron.xml file seemed to have played a part per the previous bug report: 
https://tracker.adobe.com/#/view/CF-4199420

Despite these changes, the error persists without any additional details outside the occurrence of a null-pointer exception being encountered.
===================================================================


===================[Error Details]=================

In regards to the details of the error being encountered, the client is being emailed anytime a error is caught within their OnSessionEnd code, wherein the error details seen in the following screenshot are being reported.

https://img.hostek.net/p/f46473c5d979ec159a4d


Furthermore, the only entries we are able to find concerning this issue within the client's CF2018 service logs are as follows

---[coldfusion-out.log]---
Apr 29, 2019 15:42:38 PM Error [scheduler-2] - '' The specific sequence of files included or processed is: ''''

---[exception.log]---
"Error","scheduler-1","04/29/19","15:37:18",,"'' The specific sequence of files included or processed is: '''' "
java.lang.NullPointerException
	at coldfusion.runtime.NeoJspWriter.writeOutput(NeoJspWriter.java:227)
	at coldfusion.runtime.NeoJspWriter.flush(NeoJspWriter.java:361)
	at coldfusion.cfc.CFCProxy.flush(CFCProxy.java:350)
	at coldfusion.cfc.CFCProxy.doInvoke(CFCProxy.java:325)
	at coldfusion.cfc.CFCProxy.invoke(CFCProxy.java:295)
	at coldfusion.runtime.AppEventInvoker.onSessionEnd(AppEventInvoker.java:489)
	at coldfusion.runtime.SessionTracker.invokeOnSessinEnd(SessionTracker.java:292)
	at coldfusion.runtime.SessionTracker.cleanUp(SessionTracker.java:275)
	at coldfusion.runtime.SessionTracker.access$000(SessionTracker.java:43)
	at coldfusion.runtime.SessionTracker$SessionCleanUpAgent.run(SessionTracker.java:484)
	at coldfusion.scheduling.ThreadPool.run(ThreadPool.java:260)
	at coldfusion.scheduling.WorkerThread.run(WorkerThread.java:71)
	
"Error","scheduler-2","04/29/19","15:42:38",,"'' The specific sequence of files included or processed is: '''' "
java.lang.NullPointerException



==========[Sanitized Sample of Session oriented details within Application.cfc]============
    <cfset THIS.SessionManagement = "yes" />
    <cfset THIS.SessionTimeout = CreateTimeSpan(0,1,0,0) />    

    <!--- onSessionEnd() --->
    <cffunction name="onSessionEnd" access="public" returntype="void" output="no">  
    	<!--- clean-up activities when the session ends. A session ends when the session is inactive for the session time-out period --->        
        <cfargument name="SessionScope" required="yes" /> 
        <cfargument name="AppScope" required="yes" />
 
        <cftry>
            <!--- clear any empty carts --->
            <cfif isObject(arguments.AppScope.Site) AND arguments.AppScope.Site.isValidOrderCart(arguments.SessionScope.Order)>
                <cfset unlockit = arguments.SessionScope.Order.authorise(0) />
                <cfif arguments.SessionScope.Order.get().allocated
                    AND arguments.SessionScope.Order.get().Items.RecordCount EQ 0>
                        <cfset killit = arguments.SessionScope.Order.delete() />
                </cfif>
            </cfif>
			
            <!--- catch errors & alert admin --->
            <cfcatch type="any">
                <cfthread name="onSessionEndError-#DateFormat(Now(),"yyyymmdd")#-#TimeFormat(Now(),"hhnnss")#-#createUUID()#" 
                    action="run" priority="low"
                    exceptioninfo="#cfcatch#" session="#arguments.SessionScope#">
                    <cfmail from="XXXX@XXXXXX.CCC" to="XXXX@XXXXXX.CCC" type="html" 
                        subject="[error][dev] application.onSessionEnd() #Now()#">
                        <cfdump var="#attributes.exceptioninfo#" />
                        <cfdump var="#attributes.session#" />
                    </cfmail>
                </cfthread>
            </cfcatch>
        </cftry>
		
    </cffunction>
=====================================================================

Attachments:

Comments:

Paul, Can we replicate the issue outside your environment I tried by load testing some simple session start and end test code, (with CF2018u3) but did not observe the NPE error. Is it possible for you to come up with some test code with which the issue can be reproduced. Also how are you killing the sessions. can you expands on this: killit = arguments.SessionScope.Order.delete()
Comment by Piyush K.
30777 | May 20, 2019 01:33:39 PM GMT
Paul, Pls. share the information requested my my previous comment. I have attached the test code that I used to attempt to reproduce the issue.
Comment by Piyush K.
33303 | March 16, 2020 07:41:22 AM GMT
closing this since haven't heard back from the reporter. If this needs to be investigated any further, pls. feel free to reopen this or if that is not an option, log it as a new bug or write to me at pnayak@adobe.com
Comment by Piyush K.
33333 | March 23, 2020 06:48:47 AM GMT