com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException: Support for SSH access keys has been disabled. Please contact an administrator

Atlassian JIRA | Kah Loun Foong [Atlassian] | 8 months ago
  1. 0

    h3. Summary Creating or saving a Bitbucket Server repository in Bamboo server will have the following error in the UI: {noformat} Could not check if existing access key is valid: null {noformat} h3. Steps to Reproduce # Disable the option "SSH access keys enabled" at {{Bitbucket Server Administration >> Settings >> Server Settings}} # Login to Bamboo server with a user that have Admin permission to the Bitbucket Server repository # Create a Bitbucket Server repository in Bamboo server Linked repositories h3. Expected Results The repository will be created successfully by adding the SSH key into User account h3. Actual Results The below exception is thrown in UI: {noformat} Could not check if existing access key is valid: null {noformat} h3. Notes No error in Bamboo or Bitbucket Server logs Enabling debug logging in Bitbucket Server will have the following stack trace: {noformat} 2016-04-07 13:14:33,669 DEBUG [http-nio-7990-exec-30] admin @1P5W2PDx794x67346x0 172.20.20.37 "POST /rest/keys/1.0/projects/PROJECTNAME/repos/REPONAME/ssh HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 409 com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException: Support for SSH access keys has been disabled. Please contact an administrator at com.atlassian.bitbucket.internal.key.ssh.DefaultSshAccessKeyService.set(DefaultSshAccessKeyService.java:311) ~[bitbucket-ssh-4.5.1.jar:na] at com.atlassian.bitbucket.internal.key.ssh.rest.SshAccessKeyResource.addForRepository(SshAccessKeyResource.java:191) ~[bitbucket-ssh-4.5.1.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89) [atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na] {noformat} h3.Workaround # Create a new user in Bitbucket Server that does not have Admin permission to Bitbucket Server Project or Repository # Create the same user in Bamboo Server (this user will have Admin permission in Bamboo) # Use the new user to create Bitbucket Server repository so that the SSH key is added into Bitbucket Server User Account instead of Bitbucket Server Repository Access Key

    Atlassian JIRA | 8 months ago | Kah Loun Foong [Atlassian]
    com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException: Support for SSH access keys has been disabled. Please contact an administrator
  2. 0

    h3. Summary Creating or saving a Bitbucket Server repository in Bamboo server will have the following error in the UI: {noformat} Could not check if existing access key is valid: null {noformat} h3. Steps to Reproduce # Disable the option "SSH access keys enabled" at {{Bitbucket Server Administration >> Settings >> Server Settings}} # Login to Bamboo server with a user that have Admin permission to the Bitbucket Server repository # Create a Bitbucket Server repository in Bamboo server Linked repositories h3. Expected Results The repository will be created successfully by adding the SSH key into User account h3. Actual Results The below exception is thrown in UI: {noformat} Could not check if existing access key is valid: null {noformat} h3. Notes No error in Bamboo or Bitbucket Server logs Enabling debug logging in Bitbucket Server will have the following stack trace: {noformat} 2016-04-07 13:14:33,669 DEBUG [http-nio-7990-exec-30] admin @1P5W2PDx794x67346x0 172.20.20.37 "POST /rest/keys/1.0/projects/PROJECTNAME/repos/REPONAME/ssh HTTP/1.1" c.a.s.i.r.e.ServiceExceptionMapper Mapping ServiceException to REST response 409 com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException: Support for SSH access keys has been disabled. Please contact an administrator at com.atlassian.bitbucket.internal.key.ssh.DefaultSshAccessKeyService.set(DefaultSshAccessKeyService.java:311) ~[bitbucket-ssh-4.5.1.jar:na] at com.atlassian.bitbucket.internal.key.ssh.rest.SshAccessKeyResource.addForRepository(SshAccessKeyResource.java:191) ~[bitbucket-ssh-4.5.1.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26) [applinks-plugin-5.0.5_1459814966000.jar:na] at com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89) [atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na] {noformat} h3.Workaround # Create a new user in Bitbucket Server that does not have Admin permission to Bitbucket Server Project or Repository # Create the same user in Bamboo Server (this user will have Admin permission in Bamboo) # Use the new user to create Bitbucket Server repository so that the SSH key is added into Bitbucket Server User Account instead of Bitbucket Server Repository Access Key

    Atlassian JIRA | 8 months ago | Kah Loun Foong [Atlassian]
    com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException: Support for SSH access keys has been disabled. Please contact an administrator

    Root Cause Analysis

    1. com.atlassian.bitbucket.ssh.SshKeyAccessDisabledException

      Support for SSH access keys has been disabled. Please contact an administrator

      at com.atlassian.bitbucket.internal.key.ssh.DefaultSshAccessKeyService.set()
    2. com.atlassian.bitbucket
      SshAccessKeyResource.addForRepository
      1. com.atlassian.bitbucket.internal.key.ssh.DefaultSshAccessKeyService.set(DefaultSshAccessKeyService.java:311)[bitbucket-ssh-4.5.1.jar:na]
      2. com.atlassian.bitbucket.internal.key.ssh.rest.SshAccessKeyResource.addForRepository(SshAccessKeyResource.java:191)[bitbucket-ssh-4.5.1.jar:na]
      2 frames
    3. com.atlassian.applinks
      ContextFilter.doFilter
      1. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459814966000.jar:na]
      2. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459814966000.jar:na]
      3. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459814966000.jar:na]
      4. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459814966000.jar:na]
      5. com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:26)[applinks-plugin-5.0.5_1459814966000.jar:na]
      5 frames
    4. com.atlassian.plugin
      ApiScopingFilter.doFilter
      1. com.atlassian.plugin.connect.plugin.auth.scope.ApiScopingFilter.doFilter(ApiScopingFilter.java:89)[atlassian-connect-plugin-1.1.70-bitbucket-01.jar:na]
      1 frame