Unable to link new Stash repository with Bamboo 5.11.3
jdesulme opened this issue · comments
While trying to add a new repository within Stash I'm continually running into a Could not check if existing access key is valid: null error message. As a test I disabled this plugin and tried to re-add the same repository. Afterwards I saw that it successfully connected the repository and added the SSH keys to the repository itself and not the logged in user's profile.
Based on the error logs from Stash I'm running into the following error message:
2016-05-31 09:31:16,257 DEBUG [http-nio-8443-exec-15] ******** @********** *.*.*.*,*.* "POST /rest/keys/1.0/projects/TEST/repos/build-farm-java-test-project/ssh HTTP/1.1" c.a.s.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 400
com.atlassian.stash.user.PermissionGrantCanceledException: Permission grant canceled
at com.atlassian.stash.internal.user.DefaultPermissionAdminService$19.visitPermissionGranted(DefaultPermissionAdminService.java:1482) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService$19.visitPermissionGranted(DefaultPermissionAdminService.java:1479) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService.visitPermissionAction(DefaultPermissionAdminService.java:1530) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService.maybeCancelRequest(DefaultPermissionAdminService.java:1479) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService.fireRepositoryPermissionRequestedEvent(DefaultPermissionAdminService.java:1438) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService.doSetPermission(DefaultPermissionAdminService.java:678) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.user.DefaultPermissionAdminService.setPermission(DefaultPermissionAdminService.java:628) ~[stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.key.ssh.DefaultSshKeyAccessService$13.doInTransaction(DefaultSshKeyAccessService.java:471) ~[stash-ssh-3.11.3.jar:na]
at com.atlassian.stash.internal.key.ssh.DefaultSshKeyAccessService$13.doInTransaction(DefaultSshKeyAccessService.java:427) ~[stash-ssh-3.11.3.jar:na]
at com.atlassian.sal.core.transaction.HostContextTransactionTemplate$1.doInTransaction(HostContextTransactionTemplate.java:25) ~[sal-core-2.13.4.jar:na]
at com.atlassian.stash.internal.sal.spi.HostContextAccessorImpl.doInTransaction(HostContextAccessorImpl.java:27) ~[stash-platform-3.11.3.jar:na]
at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:21) ~[sal-core-2.13.4.jar:na]
at com.atlassian.activeobjects.internal.SalTransactionManager.inTransaction(SalTransactionManager.java:48) ~[na:na]
at com.atlassian.activeobjects.internal.AbstractLoggingTransactionManager.doInTransaction(AbstractLoggingTransactionManager.java:19) ~[na:na]
at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.executeInTransaction(EntityManagedActiveObjects.java:276) ~[na:na]
at com.atlassian.activeobjects.osgi.TenantAwareActiveObjects.executeInTransaction(TenantAwareActiveObjects.java:383) ~[na:na]
at com.atlassian.stash.internal.key.ssh.DefaultSshKeyAccessService.setAccess(DefaultSshKeyAccessService.java:427) ~[stash-ssh-3.11.3.jar:na]
at com.atlassian.stash.internal.key.ssh.rest.SshKeyAccessResource.addForRepository(SshKeyAccessResource.java:195) ~[stash-ssh-3.11.3.jar:na]
at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:25) [applinks-plugin-4.3.7_1442553798000.jar:na]
at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:88) [StashAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:109) [BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75) [BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:103) [atlassian-trusted-apps-core-4.0.0.jar:na]
at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:79) [atlassian-oauth-service-provider-plugin-1.9.10_1442553798000.jar:na]
at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:36) [analytics-client-3.70.1_1442553800000.jar:na]
at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:32) [analytics-client-3.70.1_1442553800000.jar:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:87) [BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73) [BeforeLoginPluginAuthenticationFilter.class:na]
at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:85) [stash-service-impl-3.11.3.jar:na]
at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38) [ConfigurableWebFilter.class:na]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_60]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_60]
... 334 frames trimmed
The error message is being captured in Bamboo though the StashRepository.java file located at atlassian-bamboo/components/bamboo-plugins2/bamboo-plugin-stash/src/main/java/com/atlassian/bamboo/plugins/stash/StashRepository.java
line 493
Previous Bamboo would setup user keys. To keep compatible with the change to now create keys at the repo level instead of for user.