Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-18765

NullPointerException when testing / saving a GitHub repository and there is any underlying problem

      Summary

      When testing / saving a GitHub repository and there is an underlying issue (for example, you don't enter a username or pass, or XSRF protection causes a 403 Forbidden) that would normally cause a problem to be reported sensibly to the UI, Bamboo will show a NullPointerException + stack trace in the the UI.

      Steps to Reproduce

      1. Plan Configuration > Repositories > Add a GitHub Repository
      2. Don't enter any credentials
      3. Hit Test Connection / Save the repository

      Expected Results

      Bamboo errors gracefully.

      Actual Results

      The below exception is thrown to the UI and atlassian-bamboo.log

      2017-10-18 13:57:26,134 WARN [http-nio-8085-exec-14] [BambooRuntimeExceptionMapper] Unexpected error from REST call
      java.lang.NullPointerException
      	at com.atlassian.bamboo.plugins.github.configurator.GitHubServerConfigurator.validate(GitHubServerConfigurator.java:90)
      	at com.atlassian.bamboo.vcs.configurator.VcsLocationConfigurator.validateForConnectionTesting(VcsLocationConfigurator.java:41)
      	at com.atlassian.bamboo.configuration.repository.VcsConfigurationHelperImpl.validateVcsConfigurationForConnectionTesting(VcsConfigurationHelperImpl.java:113)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at com.atlassian.plugin.util.ContextClassLoaderSettingInvocationHandler.invoke(ContextClassLoaderSettingInvocationHandler.java:26)
      	at com.sun.proxy.$Proxy285.validateVcsConfigurationForConnectionTesting(Unknown Source)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
      	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:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	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:179)
      	at org.eclipse.gemini.blueprint.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:57)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)
      	at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)
      	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
      	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)
      	at com.sun.proxy.$Proxy991.validateVcsConfigurationForConnectionTesting(Unknown Source)
      	at com.atlassian.bamboo.plugins.rest.resource.RepositoryResource.testConnectionToRepository(RepositoryResource.java:190)
      	at com.atlassian.bamboo.plugins.rest.resource.RepositoryResource.lambda$testConnection$0(RepositoryResource.java:138)
      	at com.atlassian.bamboo.variable.CustomVariableContextImpl.withVariableSubstitutor(CustomVariableContextImpl.java:185)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      ...
      

      Workaround

      • Try to solve the underlying cause before saving the repository or testing the connection. This is difficult without knowing the exact nature of the problem. Some tips:
        • Ensure credentials are entered and correct
        • Ensure the Bamboo Server has outbound internet access to contact GitHub
        • If there's a reverse proxy in-front of Bamboo, ensure your reverse proxy settings are configured correct in <bamboo-install>/conf/server.xml. Here's an indicator if this is a problem from the application logs:
          2017-10-17 00:09:23,652 WARN [http-nio-8085-exec-19] [XsrfResourceFilter] Additional XSRF checks failed for request: http://localhost:8085/rest/analytics/1.0/publish/bulk , origin: https://bamboo.atlassian.com , referrer: https://bamboo.atlassian.com/admin/configureLinkedRepositories!doDefault.action , credentials in request: true , allowed via CORS: false
          

            [BAM-18765] NullPointerException when testing / saving a GitHub repository and there is any underlying problem

            Monique Khairuliana (Inactive) made changes -
            Workflow Original: Bamboo Workflow 2016 v1 - Restricted [ 2463089 ] New: JAC Bug Workflow v3 [ 3382288 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Symptom Severity Original: Minor [ 14432 ] New: Severity 3 - Minor [ 15832 ]
            Marcin Gardias made changes -
            Resolution New: Fixed [ 1 ]
            Status Original: In Progress [ 3 ] New: Resolved [ 5 ]
            Marcin Gardias made changes -
            Fix Version/s New: 6.4.0 [ 77308 ]
            Alexey Chystoprudov made changes -
            Affects Version/s Original: 6.2.2 [ 75059 ]
            Marcin Gardias made changes -
            Remote Link New: This issue links to "+core+ New and Tasty › C License Check › bugfix-BAM-18765 (tardigrade-bamboo)" [ 349870 ]
            Marcin Gardias made changes -
            Remote Link New: This issue links to "+core+ New and Tasty › A Core Builds › bugfix-BAM-18765 (tardigrade-bamboo)" [ 349869 ]
            Marcin Gardias made changes -
            Status Original: Open [ 1 ] New: In Progress [ 3 ]
            Marcin Gardias made changes -
            Assignee New: Marcin Gardias [ mgardias ]
            Krystian Brazulewicz made changes -
            Labels Original: bamboo-bugfix-kanban New: bamboo-bugfix-kanban-candidate

              mgardias Marcin Gardias
              jowen@atlassian.com Jeremy Owen
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: