We're updating the issue view to help you get more done. 

NPE when clearing the index in Elasticsearch

Description

Stack trace:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 java.lang.AssertionError: PurgeAllLuceneWork: org.infinispan.query.test.Person java.lang.NullPointerException at org.hibernate.search.elasticsearch.work.impl.DefaultElasticsearchRequestSuccessAssessor.isSuccess(DefaultElasticsearchRequestSuccessAssessor.java:119) at org.hibernate.search.elasticsearch.work.impl.DefaultElasticsearchRequestSuccessAssessor.checkSuccess(DefaultElasticsearchRequestSuccessAssessor.java:88) at org.hibernate.search.elasticsearch.work.impl.SimpleElasticsearchWork.execute(SimpleElasticsearchWork.java:71) at org.hibernate.search.elasticsearch.processor.impl.ElasticsearchWorkProcessor.executeSafely(ElasticsearchWorkProcessor.java:126) at org.hibernate.search.elasticsearch.processor.impl.ElasticsearchWorkProcessor.executeSafely(ElasticsearchWorkProcessor.java:114) at org.hibernate.search.elasticsearch.processor.impl.ElasticsearchWorkProcessor.executeSyncSafe(ElasticsearchWorkProcessor.java:87) at org.hibernate.search.elasticsearch.impl.ElasticsearchIndexManager.performOperations(ElasticsearchIndexManager.java:433) at org.hibernate.search.backend.impl.LocalBackendQueueProcessor.applyWork(LocalBackendQueueProcessor.java:38) at org.hibernate.search.backend.impl.WorkQueuePerIndexSplitter.commitOperations(WorkQueuePerIndexSplitter.java:46) at org.hibernate.search.backend.impl.BatchedQueueingProcessor.performWorks(BatchedQueueingProcessor.java:83) at org.hibernate.search.backend.impl.PerTransactionWorker.performWork(PerTransactionWorker.java:87) at org.infinispan.query.backend.QueryInterceptor.performSearchWorks(QueryInterceptor.java:243) at org.infinispan.query.backend.QueryInterceptor.purgeAllIndexes(QueryInterceptor.java:215) at org.infinispan.query.backend.QueryInterceptor.processClearCommand(QueryInterceptor.java:489)

This is the elasticsearch request:

1 2 3 4 5 6 request = {ElasticsearchRequest@10273} method = "POST" path = "/person/org.infinispan.query.test.Person/_delete_by_query/" parameters = {Collections$EmptyMap@10283} size = 0 bodyParts = {Collections$UnmodifiableRandomAccessList@10285} size = 1 0 = {JsonObject@10287} "{"query":{"match_all":{}}}"

And this is what elasticsearch responded:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 { "took":5, "timed_out":false, "total":3, "deleted":0, "batches":1, "version_conflicts":3, "noops":0, "retries":{ "bulk":0, "search":0 }, "throttled_millis":0, "requests_per_second":-1.0, "throttled_until_millis":0, "failures":[ { "index":"person", "type":"org.infinispan.query.test.Person", "id":"S:Navin", "cause":{ "type":"version_conflict_engine_exception", "reason":"[org.infinispan.query.test.Person][S:Navin]: version conflict, current version [2] is different than the one provided [1]", "index_uuid":"hzQ2rk7STGSYwMeOzwDD6A", "shard":"1", "index":"person" }, "status":409 }, { "index":"person", "type":"org.infinispan.query.test.Person", "id":"S:MiniGoat", "cause":{ "type":"version_conflict_engine_exception", "reason":"[org.infinispan.query.test.Person][S:MiniGoat]: version conflict, current version [2] is different than the one provided [1]", "index_uuid":"hzQ2rk7STGSYwMeOzwDD6A", "shard":"3", "index":"person" }, "status":409 }, { "index":"person", "type":"org.infinispan.query.test.Person", "id":"S:BigGoat", "cause":{ "type":"version_conflict_engine_exception", "reason":"[org.infinispan.query.test.Person][S:BigGoat]: version conflict, current version [2] is different than the one provided [1]", "index_uuid":"hzQ2rk7STGSYwMeOzwDD6A", "shard":"4", "index":"person" }, "status":409 } ] }

Not sure why ES is answering with a version conflict when I send a clear command. In any case, this kind of response is causing the NPE in the line

1 ignoredErrorTypes.contains( ROOT_ERROR_TYPE.get( parsedResponseBody ).getAsString() )

Environment

None

Status

Assignee

Yoann Rodière

Reporter

Gustavo Fernandes

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Affects versions

5.8.0.Beta2

Priority

Major