Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-70462

Typing "<" to create or search for labels as the first character in the string throws NPE

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 8.0.0, 8.3.3, 8.4.2
    • None

    Description

      Issue Summary

      Typing "<" to create or search for labels as the first character in the string throws NPE

      Steps to Reproduce

      1. Open any Jira issues;
      2. If not present, include the Labels field (or any Custom Field of the same type);
      3. Click to edit on the fly;
      4. Start typing a new label where the first character is "<";

      Expected Results

      A label starting with "<" is created or found.

      Actual Results

      A pop-up saying an internal server error is shown.

      The below exception is thrown in the atlassian-jira.log file:

      2020-01-07 17:01:54,058 http-nio-8080-exec-5 ERROR heinzen 1021x349x1 ea8i74 0:0:0:0:0:0:0:1 /rest/api/1.0/labels/11903/suggest [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: null
      java.lang.NullPointerException
      	at com.atlassian.jira.issue.statistics.util.PrefixFieldHitCollector.collect(PrefixFieldHitCollector.java:33)
      	at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:233)
      	at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:184)
      	at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:660)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:462)
      	at com.atlassian.jira.index.DelegateSearcher.search(DelegateSearcher.java:169)
      	at com.atlassian.jira.index.DelegateSearcher.search(DelegateSearcher.java:169)
      	at com.atlassian.jira.index.UnmanagedIndexSearcher.search(UnmanagedIndexSearcher.java:9)
      	at com.atlassian.jira.index.DelegateSearcher.search(DelegateSearcher.java:169)
      	at com.atlassian.jira.index.ManagedIndexSearcher.search(ManagedIndexSearcher.java:15)
      	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:314)
      	at com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search(LuceneSearchProvider.java:150)
      	at com.atlassian.jira.issue.label.suggestions.PrefixSearchLabelsProvider.findByPrefixToken(PrefixSearchLabelsProvider.java:23)
      	at com.atlassian.jira.issue.label.suggestions.LabelSuggester.getSuggestions(LabelSuggester.java:57)
      	at com.atlassian.jira.issue.label.suggestions.LabelSuggester.getSuggestedLabels(LabelSuggester.java:26)
      	at com.atlassian.jira.issue.label.DefaultLabelManager.getSuggestedLabels(DefaultLabelManager.java:146)
      	at com.atlassian.jira.bc.issue.label.DefaultLabelService.getSuggestedLabels(DefaultLabelService.java:178)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy512.getSuggestedLabels(Unknown Source)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:56)
      	at org.eclipse.gemini.blueprint.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:60)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:70)
      	at org.eclipse.gemini.blueprint.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:53)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:136)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:124)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:185)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
      	at com.sun.proxy.$Proxy3076.getSuggestedLabels(Unknown Source)
      	at com.atlassian.jira.rest.v1.labels.IssueLabelsResource.getSuggestionsHelper(IssueLabelsResource.java:127)
      	at com.atlassian.jira.rest.v1.labels.IssueLabelsResource.getSuggestions(IssueLabelsResource.java:119)
      	... 2 filtered
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	... 3 filtered
      	at com.atlassian.jira.rest.v2.issue.scope.RequestScopeInterceptor.intercept(RequestScopeInterceptor.java:39)
      	... 15 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:159)
      	... 1 filtered
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:69)
      	... 32 filtered
      	at com.atlassian.servicedesk.internal.web.ExternalCustomerLockoutFilter.doFilter(ExternalCustomerLockoutFilter.java:55)
      	... 8 filtered
      	at com.atlassian.jira.plugin.mobile.web.filter.MobileAppRequestFilter.doFilter(MobileAppRequestFilter.java:31)
      	... 4 filtered
      	at com.atlassian.jira.plugin.mobile.login.MobileLoginSuccessFilter.doFilter(MobileLoginSuccessFilter.java:54)
      	... 8 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 57 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.lambda$doFilter$0(JiraSecurityFilter.java:66)
      	... 1 filtered
      	at com.atlassian.jira.security.JiraSecurityFilter.doFilter(JiraSecurityFilter.java:64)
      	... 16 filtered
      	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:37)
      	... 19 filtered
      	at com.atlassian.jira.servermetrics.CorrelationIdPopulatorFilter.doFilter(CorrelationIdPopulatorFilter.java:30)
      	... 5 filtered
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.lambda$invokeFilterChain$0(CustomerContextSettingFilter.java:188)
      	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.rteInvoke(ReentrantThreadLocalBasedCodeContext.java:136)
      	at com.atlassian.servicedesk.internal.api.util.context.ReentrantThreadLocalBasedCodeContext.runOutOfContext(ReentrantThreadLocalBasedCodeContext.java:89)
      	at com.atlassian.servicedesk.internal.utils.context.CustomerContextServiceImpl.runOutOfCustomerContext(CustomerContextServiceImpl.java:47)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.outOfCustomerContext(CustomerContextSettingFilter.java:179)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilterImpl(CustomerContextSettingFilter.java:131)
      	at com.atlassian.servicedesk.internal.web.CustomerContextSettingFilter.doFilter(CustomerContextSettingFilter.java:120)
      	... 4 filtered
      	at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
      	... 8 filtered
      	at com.atlassian.web.servlet.plugin.request.RedirectInterceptingFilter.doFilter(RedirectInterceptingFilter.java:21)
      	... 4 filtered
      	at com.atlassian.web.servlet.plugin.LocationCleanerFilter.doFilter(LocationCleanerFilter.java:36)
      	... 26 filtered
      	at com.atlassian.jira.servermetrics.MetricsCollectorFilter.doFilter(MetricsCollectorFilter.java:25)
      	... 25 filtered
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)

      Workaround

      1. Type the entire label string (i.e. "<mylabel") into a different text editor;
      2. Copy from the text editor and paste it in the label field;
      3. Verify this does not trigger a NPE and the label is correctly inserted (or found)

      Attachments

        Activity

          People

            Unassigned Unassigned
            resteves Rodrigo Heinzen
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: