Skip to content

Error when storing a session #169

@severinfl

Description

@severinfl

Environment

Appengine Standard Java 21 (EE10)

Problem

On Saving a Session after processing a request we get an error:

Unable to release Session AppEngineSession@4eb65c63{id=C0oSpqulxPbxIESCPxbQkw,x=C0oSpqulxPbxIESCPxbQkw.node0,req=0,res=true}
java.lang.NullPointerException: Operation not allowed in a thread that is neither the original request thread nor a thread created by ThreadManager
at com.google.appengine.api.NamespaceManager.set(NamespaceManager.java:112)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore$SessionDataStoreImpl.entityFromSession(DatastoreSessionStore.java:232)
at com.google.apphosting.runtime.jetty.DatastoreSessionStore$SessionDataStoreImpl.doStore(DatastoreSessionStore.java:148)
at org.eclipse.jetty.session.AbstractSessionDataStore.lambda$store$2(AbstractSessionDataStore.java:196)
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.run(ContextHandler.java:1292)
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.run(ContextHandler.java:1285)
at org.eclipse.jetty.session.SessionContext.run(SessionContext.java:92)
at org.eclipse.jetty.session.AbstractSessionDataStore.store(AbstractSessionDataStore.java:207)
at org.eclipse.jetty.session.CachingSessionDataStore.store(CachingSessionDataStore.java:131)
at org.eclipse.jetty.session.AbstractSessionCache.release(AbstractSessionCache.java:515)
at org.eclipse.jetty.session.AbstractSessionManager.complete(AbstractSessionManager.java:229)
at org.eclipse.jetty.session.AbstractSessionManager$SessionStreamWrapper.doComplete(AbstractSessionManager.java:1478)
at org.eclipse.jetty.server.handler.ContextHandler$ScopedContext.run(ContextHandler.java:1298)
at org.eclipse.jetty.session.AbstractSessionManager$SessionStreamWrapper.succeeded(AbstractSessionManager.java:1467)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.completeStream(HttpChannelState.java:728)
at org.eclipse.jetty.server.internal.HttpChannelState$HandlerInvoker.run(HttpChannelState.java:654)
at com.google.apphosting.runtime.jetty.delegate.internal.DelegateConnection.lambda$handle$0(DelegateConnection.java:145)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter$2.run(JettyServletEngineAdapter.java:136)
at com.google.apphosting.runtime.jetty.delegate.internal.DelegateConnection.handle(DelegateConnection.java:141)
at com.google.apphosting.runtime.jetty.delegate.DelegateConnector.service(DelegateConnector.java:49)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:267)
at com.google.apphosting.runtime.RequestRunner.dispatchServletRequest(RequestRunner.java:262)
at com.google.apphosting.runtime.RequestRunner.dispatchRequest(RequestRunner.java:227)
at com.google.apphosting.runtime.RequestRunner.run(RequestRunner.java:193)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:273)
at java.base/java.lang.Thread.run(Thread.java:1583)

It seems to be that the ApiProxy.getCurrentEnvironment() is returning null on the NamespaceManager.set call.
here someone had a similar problem. We did not had any problems after migrating from java8 to java21 in march. The error occurs since sunday (05.05.2024). In contrast to the problem mentioned in Stackoverflow, we do not access the ApiProxy directly from our code, it is the call from the appengine library. Was there a change on the underlying structure?

Please let me know if you need some additional information.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions