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

Filter in cleanup policy preview causes "The filter is invalid so results could not be retrieved"

    Details

    • Story Points:
      3
    • Sprint:
      NXRM Neo Sprint 31, NXRM Neo Sprint 32
    • Notability:
      3
    • InvestmentLayer:
      support-escalated
    • Aha Concept:
      non-concept

      Description

      SYMPTOM:

      Typing some filter starts with "/" in the Cleanup policy preview section causes "An error occurred loading data. The filter is invalid so results could not be retrieved." error.
      Once this happens, removing / changing characters in the Filter field does not fix the issue.

      REPRODUCE STEPS:

      1. Create a cleanup policy for "maven2" format with some criteria, for example: ".+" in Asset Name Matcher
      2. Select a repository, for example: "maven-central"
      3. Click [ Preview ] button and confirm it shows some asset
      4. Type "/org" or "/com" in the Filter field, which causes this error
      5. Try removing all characters you typed in Filter, and it still shows the error, and [ Retry ] does not work either

      EXPECTED BEHAVIOUR:

      Showing error because of incorrect Filter might be OK but removing or changing the filter should stop showing the error.

      ACTUAL BEHAVIOUR:

      nexus.log with DEBUG shows below:

      2022-02-22 08:45:45,076+0000 DEBUG [qtp1441284042-1102]  admin org.sonatype.nexus.repository.search.query.SearchQueryServiceImpl - Invalid query explanation: [0420f90ff808642f04e8da4e76323224efa15062] QueryParsingException[Failed to parse query [/co*]]; nested: ParseException[Cannot parse '/co*': Lexical error at line 1, column 5.  Encountered: <EOF> after : "/co*"]; nested: TokenMgrError[Lexical error at line 1, column 5.  Encountered: <EOF> after : "/co*"];; org.apache.lucene.queryp... (repeat a lot) ... 
      

      Then shows WARN:

      2022-02-22 08:45:45,079+0000 WARN  [qtp1441284042-1102]  admin org.sonatype.nexus.siesta.internal.UnexpectedExceptionMapper - (ID 6b2c0361-776b-4558-84da-236455f857ea) Unexpected exception: java.lang.IllegalArgumentException: Invalid query
      java.lang.IllegalArgumentException: Invalid query
              at org.sonatype.nexus.repository.search.query.SearchQueryServiceImpl.validateQuery(SearchQueryServiceImpl.java:304)
              at org.sonatype.nexus.repository.search.query.SearchQueryServiceImpl.search(SearchQueryServiceImpl.java:141)
              at org.sonatype.nexus.cleanup.internal.search.elasticsearch.AbstractSearchCleanupComponentBrowse.invokeSearchByPage(AbstractSearchCleanupComponentBrowse.java:113)
              at org.sonatype.nexus.cleanup.internal.orient.search.elasticsearch.OrientElasticSearchCleanupComponentBrowse.browseByPage(OrientElasticSearchCleanupComponentBrowse.java:79)
              at org.sonatype.nexus.cleanup.internal.orient.service.OrientCleanupPreviewHelperImpl.searchForComponents(OrientCleanupPreviewHelperImpl.java:98)
              at org.sonatype.nexus.transaction.TransactionalWrapper.proceedWithTransaction(TransactionalWrapper.java:58)
              at org.sonatype.nexus.transaction.TransactionInterceptor.proceedWithTransaction(TransactionInterceptor.java:66)
              at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:55)
              at org.sonatype.nexus.cleanup.internal.orient.service.OrientCleanupPreviewHelperImpl.getSearchResults(OrientCleanupPreviewHelperImpl.java:87)
              at org.sonatype.nexus.cleanup.internal.rest.CleanupPolicyResource.previewContent(CleanupPolicyResource.java:254)
      ...
      

        Attachments

          Activity

            People

            Assignee:
            tahir.awan Tahir Awan
            Reporter:
            hosako Hajime Osako
            Last Updated By:
            Michael Oliverio Michael Oliverio
            Team:
            NXRM - Neo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response:

                tigCommentSecurity.panel-title