Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2742

NPE when clearing the index in Elasticsearch

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.8.0.Beta2
    • Fix Version/s: 5.8.0.Beta3
    • Component/s: elasticsearch
    • Labels:
      None

      Description

      Stack trace:

      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:

      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:

      {
         "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

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

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: