SystemCacheClear() throws error "Reduced views don't contain document ids"

I have declared that all my caches go to couchbase in application.cfc

THIS.cache.object = “cbluceestore”;
THIS.cache.template = “cbluceestore”;
THIS.cache.query = “cbluceestore”;
THIS.cache.resource = “cbluceestore”;
THIS.cache.function = “cbluceestore”;
THIS.cache.include = “cbluceestore”;

I then proceed to cache a query which I can see in couchbase as the only document in that bucket.

I then attempt to use

SystemCacheClear();

I would assume that that would clear the cached query. Instead I get:

Lucee 4.5.3.018 Error (java.lang.UnsupportedOperationException)
Message Reduced views don’t contain document ids
Cause java.lang.UnsupportedOperationException
Stacktrace The Error Occurred in
C:\Sites\www\breakdown-services-full_wwwroot\test.cfm: line 13

11:
12:
13: SystemCacheClear();
14:

Java Stacktrace Reduced views don’t contain document ids
at com.couchbase.client.protocol.views.ViewRowReduced.getId(ViewRowReduced.java:48):48
at ortus.extension.cache.couchbase.CouchbaseCache.remove(Unknown Source):-1
at lucee.runtime.cache.tag.timespan.TimespanCacheHandler.clear(TimespanCacheHandler.java:99):99
at lucee.runtime.cache.tag.CacheHandlerFactory.clear(CacheHandlerFactory.java:97):97
at lucee.runtime.functions.system.SystemCacheClear.queryCache(SystemCacheClear.java:89):89
at lucee.runtime.functions.system.SystemCacheClear.call(SystemCacheClear.java:51):51
at lucee.runtime.functions.system.SystemCacheClear.call(SystemCacheClear.java:43):43
at test_cfm$cf.call(C:\Sites\www\breakdown-services-full_wwwroot\test.cfm:13):13
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:954):954
at lucee.runtime.PageContextImpl.doInclude(PageContextImpl.java:906):906
at lucee.runtime.listener.ModernAppListener._onRequest(ModernAppListener.java:225):225
at lucee.runtime.listener.ModernAppListener.onRequest(ModernAppListener.java:101):101
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2265):2265
at lucee.runtime.PageContextImpl.execute(PageContextImpl.java:2228):2228
at lucee.runtime.engine.CFMLEngineImpl.serviceCFML(CFMLEngineImpl.java:456):456
at lucee.loader.servlet.CFMLServlet.service(Unknown Source):-1
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729):729
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291):291
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52):52
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239):239
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206):206
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219):219
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106):106
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502):502
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142):142
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79):79
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:617):617
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88):88
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:518):518
at org.apache.coyote.ajp.AbstractAjpProcessor.process(AbstractAjpProcessor.java:844):844
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:668):668
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2463):2463
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2452):2452
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142):1142
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617):617
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61):61
at java.lang.Thread.run(Thread.java:745):745

It seems that all of the lucee cache functions are throwing that same error. The first view in couchbase for the cache bucket has a reduce function. If I remove _reduce from the view then cache functions begin to work properly.

ie CacheGetAllIds("",“cbluceestore”)

How can I define which view the extension is to use when connecting to CB?

I also noticed this error in tomcat when the app starts:

2016-08-09 10:10:11.552 INFO com.couchbase.client.CouchbaseClient: viewmode property isn’t defined. Setting viewmode to production mode

It seems to me that there are additional settings that are not in the lucee admin / couchbase extension.

Hi Marc,

I believe we have a screenshare with you on Thursday. We will address these issues. Please note that the SystemCacheClear() requires the name of the cache as an argument. Did you pass it?

*> **How can I define which view the extension is to use when connecting to
CB?*

You can't, the extension creates the view it needs automatically. Can you
confirm if there is a view named "*LuceeCouchbase_allKeys*"? That is the
name of the view that is used and it should not have a reduce function.
Did you by chance manually edit this view and add a reduce function?

I also noticed this error in tomcat when the app starts:

That is not an error. You can see from the log entry, it is marked "INFO"
which means it's informational. It doesn't not represent anything
significant.

Thanks!

~Brad

*Developer Advocate*
*Ortus Solutions, Corp *

E-mail: brad@coldbox.org
ColdBox Platform: http://www.coldbox.org
Blog: http://www.codersrevolution.com