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

JIRA Analytics events fail with a NullPointerException

    XMLWordPrintable

Details

    Description

      Summary

      When JIRA attempts to send certain analytics, it can fail with a NullPointerException.

      Steps to Reproduce

      It's not entirely clear how this is reproduced reliably.

      Expected Results

      The exception is not thrown and the analytics are sent without error.

      Actual Results

      The below exception is thrown:

      2015-11-21 09:11:31,231 analyticsEventProcessor:thread-1 ERROR gl66798-admin     [c.a.a.client.listener.ProductEventListener] Failed to send analytics event com.atlassian.analytics.api.events.MauEvent@19ff054d
      com.atlassian.cache.CacheException: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
      	at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:330)
      	at com.atlassian.analytics.client.serialize.EventSerializer.hashEmailPropertyForMauEvent(EventSerializer.java:111)
      	at com.atlassian.analytics.client.serialize.EventSerializer.toAnalyticsEvent(EventSerializer.java:84)
      	at com.atlassian.analytics.client.listener.ProductEventListener$1.run(ProductEventListener.java:112)
      	at com.atlassian.sal.core.executor.ThreadLocalDelegateRunnable.run(ThreadLocalDelegateRunnable.java:38)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
      	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
      	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
      	at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:87)
      	at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher.hashInternal(BcryptAnalyticsEmailHasher.java:45)
      	at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher.hash(BcryptAnalyticsEmailHasher.java:40)
      	at com.atlassian.analytics.client.serialize.EventSerializer$1.load(EventSerializer.java:58)
      	at com.atlassian.cache.memory.MemoryCacheManager$3$1.load(MemoryCacheManager.java:132)
      	at com.atlassian.cache.memory.BlockingCacheLoader.load(BlockingCacheLoader.java:51)
      	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
      	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
      	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
      	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
      	at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
      	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
      	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
      	at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:324)
      	... 9 more
      Caused by: java.lang.NullPointerException
      	at java.io.Reader.<init>(Reader.java:78)
      	at java.io.InputStreamReader.<init>(InputStreamReader.java:72)
      	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1407)
      	at org.apache.commons.io.IOUtils.copy(IOUtils.java:1433)
      	at org.apache.commons.io.IOUtils.toString(IOUtils.java:585)
      	at com.atlassian.analytics.client.hash.reader.RemoteHashingInstructionsReader.readInstructions(RemoteHashingInstructionsReader.java:27)
      	at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher$HashingInstructionsResettableLazyReference.create(BcryptAnalyticsEmailHasher.java:154)
      	at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher$HashingInstructionsResettableLazyReference.create(BcryptAnalyticsEmailHasher.java:144)
      	at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:140)
      	at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)
      	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
      	... 25 more

      Workaround 1. If there is no "Caused by: java.lang.NullPointerException" in the exception stack

      Please check if there are forward proxy settings in JIRA (setenv.sh) and if they are set correctly. Please reference this article for further details on how to configure outbound proxy for JIRA: https://confluence.atlassian.com/jirakb/how-to-configure-an-outbound-http-and-https-proxy-for-jira-applications-247857187.html

      Workaround 2. Please notice – this applies to JIRA Software only. If there's JIRA Service Desk installed in the same instance as JIRA Software, the steps below will disable the Service Desk application

      Disabling the Analytics and the below add-ons will prevent this exception from being thrown. Please note it's a spurious exception that prevents analytics being thrown however will not affect how JIRA operates outside of sending analytics.

      • Atlassian JIRA - Plugins - Analytics whitelist
      • Analytics Client Plugin and
      • Analytics Whitelist Plugin

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              gtanczyk Grzegorz Tanczyk (Inactive)
              Votes:
              21 Vote for this issue
              Watchers:
              51 Start watching this issue

              Dates

                Created:
                Updated: