Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-8339

Bitbucket Server Analytics events fail with a NullPointerException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 4.5.1
    • 4.2.0
    • Analytics
    • None

      Summary

      When Bitbucket Server 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:

      2016-01-22 14:07:36,044 ERROR [localScheduler_Worker-1]  c.a.scheduler.core.JobLauncher Scheduled job with ID 'PluginScheduler:com.atlassian.analytics.client.upload.Remot
      eFilterRead:job' failed
      com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException
              at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149) ~[atlassian-util-concurrent-3.0.0.jar:na]
              at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112) ~[atlassian-util-concurrent-3.0.0.jar:na]
              at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:87) ~[atlassian-util-concurrent-3.0.0.jar:na]
              at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher.readRemoteInstructions(BcryptAnalyticsEmailHasher.java:123) ~[na:na]
              at com.atlassian.analytics.client.upload.RemoteFilterRead.execute(RemoteFilterRead.java:61) ~[na:na]
              at com.atlassian.scheduler.compat.local.LocalOnlyPluginJob.execute(LocalOnlyPluginJob.java:30) ~[na:na]
              at com.atlassian.stash.internal.sal.scheduling.PluginSchedulerAdapter$JobDescriptor.runJob(PluginSchedulerAdapter.java:128) ~[bitbucket-platform-4.2.0.jar:na]
              at com.atlassian.stash.internal.sal.scheduling.PluginSchedulerAdapter.runJob(PluginSchedulerAdapter.java:85) ~[bitbucket-platform-4.2.0.jar:na]
              at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:153) [atlassian-scheduler-core-1.6.0.jar:na]
              at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:118) [atlassian-scheduler-core-1.6.0.jar:na]
              at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:97) [atlassian-scheduler-core-1.6.0.jar:na]
              at com.atlassian.scheduler.quartz2.Quartz2Job.execute(Quartz2Job.java:32) [atlassian-scheduler-quartz2-1.6.0.jar:na]
              at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-2.2.1.jar:na]
              at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:na]
      Caused by: java.lang.NullPointerException: null
              at java.io.Reader.<init>(Unknown Source) ~[na:1.8.0_51]
              at java.io.InputStreamReader.<init>(Unknown Source) ~[na:1.8.0_51]
              at org.apache.commons.io.IOUtils.copy(IOUtils.java:1906) ~[commons-io-2.4.jar:2.4]
              at org.apache.commons.io.IOUtils.toString(IOUtils.java:778) ~[commons-io-2.4.jar:2.4]
              at org.apache.commons.io.IOUtils.toString(IOUtils.java:759) ~[commons-io-2.4.jar:2.4]
              at com.atlassian.analytics.client.hash.reader.RemoteHashingInstructionsReader.readInstructions(RemoteHashingInstructionsReader.java:27) ~[na:na]
              at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher$HashingInstructionsResettableLazyReference.create(BcryptAnalyticsEmailHasher.java:154) ~[na:na]
              at com.atlassian.analytics.client.hash.BcryptAnalyticsEmailHasher$HashingInstructionsResettableLazyReference.create(BcryptAnalyticsEmailHasher.java:144) ~[na:na]
              at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:140) ~[atlassian-util-concurrent-3.0.0.jar:na]
              at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321) ~[atlassian-util-concurrent-3.0.0.jar:na]
              at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143) ~[atlassian-util-concurrent-3.0.0.jar:na]
              ... 13 common frames omitted
      

      Workaround

      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 Bitbucket Server operates outside of sending analytics.

      • Atlassian Stash Analytics Whitelist Plugin
      • Analytics Client Plugin and
      • Analytics Whitelist Plugin

      Notes:

      • Only reported happens after an upgrade to Bitbucket Server 4.2.0

              jthomas@atlassian.com Justin Thomas
              pkoczan Peter Koczan (Inactive)
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: