Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-18905

Cleanup tasks fail with "No search context found for id" error

    XMLWordPrintable

    Details

    • Story Points:
      3

      Description

      On three occasions now we've seen the repository cleanup tasks fail with an error like the one below. This seems to occur when the elasticsearch query takes too long to complete.

      We've had users work around this by reducing the amount of components selected by the cleanup policy.  But I think this points to a flaw in our code.  If the machine that Nexus Repo is running on is slow, or the cleanup policy is selecting a large number of components it should cause the cleanup to run slowly, not fail entirely.

       

      2019-01-18 12:20:26,371-0500 WARN [quartz-2-thread-20] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskJob - Task 080a3b05-ada1-45a0-91e1-8b715fbc3dc4 : 'Cleanup service' [repository.cleanup] execution failure
      org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed
      at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction.onPhaseFailure(SearchScrollQueryAndFetchAsyncAction.java:155)
      at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction.access$300(SearchScrollQueryAndFetchAsyncAction.java:41)
      at org.elasticsearch.action.search.SearchScrollQueryAndFetchAsyncAction$1.onFailure(SearchScrollQueryAndFetchAsyncAction.java:142)
      at org.elasticsearch.action.ActionListenerResponseHandler.handleException(ActionListenerResponseHandler.java:46)
      at org.elasticsearch.transport.TransportService$DirectResponseChannel.processException(TransportService.java:874)
      at org.elasticsearch.transport.TransportService$DirectResponseChannel.sendResponse(TransportService.java:852)
      at org.elasticsearch.transport.TransportService$4.onFailure(TransportService.java:389)
      at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:39)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)
      Caused by: org.elasticsearch.transport.RemoteTransportException: [03BE0352-264E5695-7C25F189-A53EC373-372DEEDA][local[1]][indices:data/read/search[phase/query+fetch/scroll]]
      Caused by: org.elasticsearch.search.SearchContextMissingException: No search context found for id [7]
      at org.elasticsearch.search.SearchService.findContext(SearchService.java:626)
      at org.elasticsearch.search.SearchService.executeFetchPhase(SearchService.java:553)
      at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchScrollTransportHandler.messageReceived(SearchServiceTransportAction.java:416)
      at org.elasticsearch.search.action.SearchServiceTransportAction$SearchQueryFetchScrollTransportHandler.messageReceived(SearchServiceTransportAction.java:413)
      at org.elasticsearch.transport.TransportRequestHandler.messageReceived(TransportRequestHandler.java:33)
      at org.elasticsearch.transport.RequestHandlerRegistry.processMessageReceived(RequestHandlerRegistry.java:77)
      at org.elasticsearch.transport.TransportService$4.doRun(TransportService.java:378)
      at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.lang.Thread.run(Thread.java:748)

       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rseddon Rich Seddon
                Last Updated By:
                Joe Tom
              • Votes:
                2 Vote for this issue
                Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Date of First Response: