Cannot open a Memcached cache settings in Lucee Administrator

I’ve got a couple Memcached caches that I created in .CFConfig.json that I cannot view in the Lucee Administrator. When I try to open either of the cache settings, I get the error:

Cannot invoke “java.util.List.size()” because the return value of “lucee.commons.io.cache.Cache.keys()” is null

I tried to create a brand new Memcached cache through the administrator, and I still cannot open the settings page for it.

I’m running Memcached extension: org.lucee.memcached.extension (4.0.0.14)

The Lucee stack trace (this is really interesting!):

The Error Occurred in
/admin/services.cache.create.cfm: line 79
called from /admin/services.cache.cfm: line 41
called from /admin/web.cfm: line 521
called from /admin/web.cfm: line 515
called from /var/my-app/www/admin/index.cfm: line 3

Notice the bottom line in the stack trace. I put in “my-app” as a placeholder, but it really is the path to the app I’m running, and that directory does exist. I suspect this could be part of the problem.

In addition, the Java stacktrace is:

lucee.runtime.exp.NativeException: Cannot invoke "java.util.List.size()" because the return value of "lucee.commons.io.cache.Cache.keys()" is null
 at lucee.runtime.functions.cache.CacheCount.call(CacheCount.java:42)
 at services_cache_create_cfm1104$cf.call(/admin/services.cache.create.cfm:79)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1118)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1012)
 at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:993)
 at services_cache_cfm414$cf.call(/admin/services.cache.cfm:41)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1118)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1012)
 at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:993)
 at web_cfm$cf.call_000007(/admin/web.cfm:521)
 at web_cfm$cf.call(/admin/web.cfm:515)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1118)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1012)
 at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:993)
 at index_cfm$cf.call(/admin/index.cfm:3)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1118)
 at lucee.runtime.PageContextImpl._doInclude(PageContextImpl.java:1012)
 at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:215)
 at lucee.runtime.listener.ModernAppListener.onRequest(ModernAppListener.java:102)
 at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2816)
 at lucee.runtime.PageContextImpl._execute(PageContextImpl.java:2803)
 at lucee.runtime.PageContextImpl.executeCFML(PageContextImpl.java:2774)
 at lucee.runtime.engine.Request.exe(Request.java:45)
 at lucee.runtime.engine.CFMLEngineImpl._service(CFMLEngineImpl.java:1113)
 at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:1070)
 at lucee.loader.engine.CFMLEngineWrapper.serviceCFML(CFMLEngineWrapper.java:97)
 at lucee.loader.servlet.jakarta.CFMLServlet.service(CFMLServlet.java:52)
 at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:710)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:128)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:107)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:165)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:77)
 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:492)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:113)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:83)
 at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:685)
 at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:654)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:72)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:341)
 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:397)
 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:903)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1801)
 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)
 at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:946)
 at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:480)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:57)
 at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because the return value of "lucee.commons.io.cache.Cache.keys()" is null
 ... 49 more

OS: Ubuntu 24.04 (Noble)
Java: OpenJDK 21
Tomcat Version: 11.0.6
Lucee Version: 6.2.6.19
Memcached: org.lucee.memcached.extension (4.0.0.14)

I’m thinking I should file a bug report on this. The extension seems to be trying to load the request from my app:

From error stack:

called from /var/my-app/www/admin/index.cfm: line 3

Waiting for confirmation and I’ll be happy to log the bug report.

there’s a few layers this one!

memcached doesn’t support enumerating cache keys, which leads to a few different problems, as the loader cache api, fetches keys and counts them, as there is no size api. hacky stuff like returning an empty collection for the count, but that brakes other things

the admin workaround is brittle ( case in point)

https://luceeserver.atlassian.net/browse/LDEV-4422

memcached returns null, so I’m thinking about handling that and just having cacheCount() / cfobjectcache size simply both return -1 which makes sense and isn’t a NPE ? wanna file a ticket for that?

the admin can then gracefully handle that, rather than bombing

1 Like

New ticket here: LDEV-6323