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

    XMLWordPrintable

Details

    Description

      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
          

      Attachments

        Activity

          People

            mgardias Marcin Gardias
            jowen@atlassian.com Jeremy Owen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: