PlanningFailureException when Flux returned from repository to Mono<ServerResponse>

CREATE INDEX Index1_classname
ON employee(_class)
WHERE _class = “com.example.couchbase65.dao.Employee” USING GSI;

This seems bit weird. Wouldn’t it be nice to have default id based index automatically and let the index service to identify best fitting indexes when multiple gsi indexes are present?

"Wouldn’t it be nice to have default id based index automatically "
Again, an id-based index is not needed or even used because the kv-api is used to findById.
A default _class based index would be just enough to allow queries to execute, while making them as inefficient as possible by having to read the data for every document of that type to evaluate other predicates - so maybe not a great strategy. Also - automatically generating indexes or any other type of DDL in spring-data is a whole other can of worms.

BTW - the underlying reason for the exception is indeed included. I’ve withdrawn DATACOUCH-565. You should revisit the exception handling in your application - it seems to dump out the exception.getStackTrace() but not the exception.getMessage()

com.couchbase.client.core.error.PlanningFailureException: The server failed planning the query
{“completed”:true,“coreId”:“0x937c1c9100000001”,“errors”:[{“code”:4000,“message”:“No index available on keyspace 0f99037c-4a1a-4afd-ae1d-40c490a39f08 that matches your query. Use CREATE INDEX or CREATE PRIMARY INDEX to create an index, or check that your expected index is online.”}],“idempotent”:false,“lastDispatchedFrom”:“127.0.0.1:56879”,“lastDispatchedTo”:“127.0.0.1:8093”,“requestId”:81,“requestType”:“QueryRequest”,“retried”:0,“service”:{“operationId”:“8e2ae226-68a3-4aa1-95d6-b5e8b4fe35b8”,“statement”:“SELECT META(0f99037c-4a1a-4afd-ae1d-40c490a39f08).id AS __id, META(0f99037c-4a1a-4afd-ae1d-40c490a39f08).cas AS __cas, 0f99037c-4a1a-4afd-ae1d-40c490a39f08.* FROM 0f99037c-4a1a-4afd-ae1d-40c490a39f08 WHERE _class = “org.springframework.data.couchbase.domain.Airport” AND iata = $1”,“type”:“query”},“timeoutMs”:75000,“timings”:{“dispatchMicros”:19772,“totalMicros”:109701351}}
at com.couchbase.client.core.io.netty.query.QueryChunkResponseParser.errorsToThrowable(QueryChunkResponseParser.java:136)
at java.base/java.util.Optional.map(Optional.java:265)
at com.couchbase.client.core.io.netty.query.QueryChunkResponseParser.error(QueryChunkResponseParser.java:117)
at com.couchbase.client.core.io.netty.chunk.ChunkedMessageHandler.lambda$maybeCompleteResponseWithFailure$1(ChunkedMessageHandler.java:260)
at java.base/java.util.Optional.orElseGet(Optional.java:369)

@mreiche Thanks for the clarifications and invaluable insights.