Keep running into this bug with Lucee 6 (currently...
# lucee
s
Keep running into this bug with Lucee 6 (currently 6.0.3.1) re: sessions when
this.sessioncluster = true
.
Copy code
lucee.runtime.type.QueryImpl; incompatible types for field recordcount
The error is thrown on the first reference to anything in the session scope. Anecdotally, this appears to happen when switching between Lucee 5.4 and Lucee 6 servers, after a time the session gets corrupted and won't write back to the server without throwing a sql error. (SQL Server 2019) Additionally, Application.cfc appears to be cached and only after restarting Lucee entirely do changes to Application.cfc start getting picked up again (this may be a Lucee 6.0.3.1 issue). On top of that, the reference to session throws an error that breaks out of try/catch. So you can't trap the error and rotate the session or anything like that. It throws a hard error that can't be captured with a try/catch. The only solution? Clearing your cookies.
b
I would suspect you need to clear the contents of your cache
and not share an external cache between different Lucee versions
s
Well, we're trying to do a slow rollout to find Lucee 6 issues, so we're running on Lucee 5.4 server (in case we need to rollback) and a Lucee 6 server
But using sql server as the shared cache
b
right, and that ain't gonna work 🙂
the recordcount field in Lucee's query object was changed from an
int
to an
AtomicInteger
in Lucee 6 https://github.com/lucee/Lucee/blob/6.1/core/src/main/java/lucee/runtime/type/QueryImpl.java#L137C10-L137C24
s
Fair enough, then why is the error throwing outside of a try/catch?
b
So Lucee can't deserialize classes from one version of Lucee to another
s
Ahhh
b
I'd have to see the stack trace
but it's likely in the pre-request logic before your code even runs
s
lucee.runtime.exp.NativeException: lucee.runtime.type.QueryImpl; incompatible types for field recordcount at java.base/java.io.ObjectStreamClass.matchFields(ObjectStreamClass.java:2372) at java.base/java.io.ObjectStreamClass.getReflector(ObjectStreamClass.java:2266) at java.base/java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:743) at java.base/java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1960) at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1829) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2117) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422) at lucee.commons.collection.concurrent.ConcurrentHashMapNullSupport.readObject(ConcurrentHashMapNullSupport.java:1336) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1175) at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2273) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2144) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646) at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2412) at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2306) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2144) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646) at java.base/java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:2412) at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2306) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2144) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422) at lucee.commons.collection.concurrent.ConcurrentHashMapNullSupport.readObject(ConcurrentHashMapNullSupport.java:1336) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at java.base/java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1175) at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2273) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2144) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1646) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:464) at java.base/java.io.ObjectInputStream.readObject(ObjectInputStream.java:422) at lucee.runtime.type.scope.storage.IKStorageValue.deserialize(IKStorageValue.java:75) at lucee.runtime.type.scope.storage.IKStorageValue.getValue(IKStorageValue.java:63) at lucee.runtime.type.scope.storage.IKStorageScopeSupport.getInstance(IKStorageScopeSupport.java:152) at lucee.runtime.type.scope.ScopeContext.getCFSessionScope(ScopeContext.java:564) at lucee.runtime.type.scope.ScopeContext.getSessionScope(ScopeContext.java:440) at lucee.runtime.PageContextImpl.sessionScope(PageContextImpl.java:1662) at lucee.runtime.PageContextImpl.sessionScope(PageContextImpl.java:1656) at admin.application_cfc$cf.udfCall1(/admin/Application.cfc:231) at admin.application_cfc$cf.udfCall(/admin/Application.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:787) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:797) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1999) at admin.application_cfc$cf.udfCall1(/admin/Application.cfc:145) at admin.application_cfc$cf.udfCall(/admin/Application.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:787) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:797) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1999) at one_cfc$cf.udfCallf(/framework/one.cfc:2974) at one_cfc$cf.udfCall(/framework/one.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.type.scope.UndefinedImpl.call(UndefinedImpl.java:787) at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues(VariableUtilImpl.java:797) at lucee.runtime.PageContextImpl.getFunction(PageContextImpl.java:1999) at one_cfc$cf.udfCall6(/framework/one.cfc:997) at one_cfc$cf.udfCall(/framework/one.cfc) at lucee.runtime.type.UDFImpl.implementation(UDFImpl.java:112) at lucee.runtime.type.UDFImpl._call(UDFImpl.java:356) at lucee.runtime.type.UDFImpl.call(UDFImpl.java:223) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:702) at lucee.runtime.ComponentImpl._call(ComponentImpl.java:590) at lucee.runtime.ComponentImpl.call(ComponentImpl.java:2014) at lucee.runtime.listener.ModernAppListener.call(ModernAppListener.java:445) at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:136) at lucee.runtime.listener.MixedAppListener.onRequest(MixedAppListener.java:44) at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2716) at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2702) at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2673) at lucee.runtime.engine.Request.exe(Request.java:45) at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1259) at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1205) at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97) at lucee.loader.servlet.CFMLServlet.service(CFMLServlet.java:51) at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:154) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:179) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:154) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:134) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doNext(FusionReactorRequestHandler.java:772) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doHttpServletRequest(FusionReactorRequestHandler.java:344) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.doFusionRequest(FusionReactorRequestHandler.java:207) at com.intergral.fusionreactor.j2ee.filter.FusionReactorRequestHandler.handle(FusionReactorRequestHandler.java:809) at com.intergral.fusionreactor.j2ee.filter.FusionReactorCoreFilter.doFilter(FusionReactorCoreFilter.java:36) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.intergral.fusionreactor.j2ee.filterchain.WrappedFilterChain.doFilter(WrappedFilterChain.java:71) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.intergral.fusionreactor.agent.filter.FusionReactorStaticFilter.doFilter(FusionReactorStaticFilter.java:54) at com.intergral.fusionreactor.agent.pointcuts.NewFilterChainPointCut$1.invoke(NewFilterChainPointCut.java:42) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:168) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at mod_cfml.core.invoke(core.java:152) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:670) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:346) at org.apache.coyote.ajp.AjpProcessor.service(AjpProcessor.java:424) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1786) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: java.io.InvalidClassException: lucee.runtime.type.QueryImpl; incompatible types for field recordcount ...
The error in TagContext is Application.cfc:231
This is called from setupRequest in FW/1.
b
Does the error in the stack trace appear on only in the logs, or is it what the browser sees as well?
It's NativeException which seems like it should be caught
s
It's dumped right to the browser.
image.png
It also fires as part of onError() handling to go into our logs
b
yeah, that's an odd one-- I don't know why you can't catch that. Lucee's catch mechanism may be preventing that for some reason
s
Yeah, without being able to catch it, there's not much recourse. I could wipe out the CFID cookie programmatically, or maybe rotate the session, or any of a number of other possible solutions, but I can't do anything except "tell customer to clear their cookies" and instead of a friendly error page it shows a Lucee dump
I have to say this is the first example I've ever encountered of a Lucee error that can't be caught
Additionally, this should constitute an upgrade issue. Even if I'd updated every server in production to Lucee 6, there would still be existing sessions that would suddenly break and return the ugly error above once all the servers are converted. There's no migration/upgrade for 'broken' sessions.
b
yeah, but that's always been the case
Any change in Lucee version generally means you need to wipe any caches
I know it's not ideal, but Lucee's serialization and deserialization of classes is very specific to the underlying Java classes in the source code, so any changes to them will cause issues
s
Understandable. If nothing else, I'd consider the inability to trap the error in a try/catch a bug.
b
I agree there. A ticket may be in order
s
I'm also not sure if the Application.cfc's updates failing to be picked up on request is a regression or not, or specific to this issue, but that seems like new behavior. I'll see if I can isolate that one more.
Perhaps it's failing to cache it or pull a new version due to this error
(And no, in production, we have 'Once' set up for inspecting of changes, not 'Never')