-
Bug
-
Resolution: Fixed
-
Low
-
6.1.1, 6.2.1
-
Severity 3 - Minor
-
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
- Plan Configuration > Repositories > Add a GitHub Repository
- Don't enter any credentials
- 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
Workflow | Original: Bamboo Workflow 2016 v1 - Restricted [ 2463089 ] | New: JAC Bug Workflow v3 [ 3382288 ] |
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Symptom Severity | Original: Minor [ 14432 ] | New: Severity 3 - Minor [ 15832 ] |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Fix Version/s | New: 6.4.0 [ 77308 ] |
Affects Version/s | Original: 6.2.2 [ 75059 ] |
Remote Link |
New:
This issue links to "+core+ New and Tasty › C License Check › bugfix- |
Remote Link |
New:
This issue links to "+core+ New and Tasty › A Core Builds › bugfix- |
Status | Original: Open [ 1 ] | New: In Progress [ 3 ] |
Assignee | New: Marcin Gardias [ mgardias ] |
Labels | Original: bamboo-bugfix-kanban | New: bamboo-bugfix-kanban-candidate |