Getting NullPointerException while creating FTS index on newly couchbase docker image

Description

I am getting Null pointer exception in following class:

 

AsyncSearchIndexManager.java:171

-> getAllIndexes()

-> return new ArrayList<>(indexes.values());

Here indexes is null and because of that I am getting error.

 

Reproduce step:

  1. Start fresh Couchbase docker image,

  2. try to create FTS index from java code, it fails due to NullPointerException.

 

Workaround:

1. Create any FTS index from Couchbase UI

2. Remove created FTS index ( remove if u want, that does not matter )

3. Run java code to execute FTS index, it works.

 

It works only if we create at-least one manually.

The reason is because 

"/api/index" is returning response { "status" : "ok", "indexDefs" : null } when we try to create index on fresh docker image because here indexDefs is null, it causing NullPointerException.

And after we create & delete any FTS index manually and after  that we are getting different response  { "status" : "ok", "indexDefs" : { "uuid" :"XXXX", "indexDefs": {}, "implVersion" :"5.6.0" } }

 

Environment

Docker image: Couchbase:community-7.1.1 Java SDK: com.couchbase.client:java-client:3.3.3

Gerrit Reviews

None

Release Notes Description

None

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

CVSS/Severity

Medium

Story Points

Fix versions

Priority

Instabug

Open Instabug

PagerDuty

Sentry

Zendesk Support

Created August 19, 2022 at 7:14 AM
Updated August 31, 2024 at 11:03 AM
Resolved August 22, 2022 at 12:29 PM
Instabug