Creating a plan in Bamboo fails with Could not check if existing access key is valid: An error occurred while processing the request
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Problem
When creating a new plan in Bamboo and selecting Bitbucket Server as the source repository it fails with below error:
"Could not check if existing access key is valid: An error occurred while processing the request. Check the server logs for more information."
The following appears in Bitbucket Server's atlassian-bitbucket.log
1
2
3
4
5
6
2017-09-08 07:34:16,376 ERROR [http-nio-7990-exec-68] @1WEI6YBx454x4378x0 172.19.0.4 "POST /rest/ssh/1.0/keys HTTP/1.1" c.a.s.i.r.e.DefaultUnhandledExceptionMapperHelper Unhandled exception while processing REST request: "POST /rest/ssh/1.0/keys HTTP/1.1"
java.lang.NullPointerException: username
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:226)
at com.atlassian.bitbucket.user.NoSuchUserException.<init>(NoSuchUserException.java:20)
at com.atlassian.bitbucket.internal.ssh.rest.SshKeysResource.getUser(SshKeysResource.java:207)
at com.atlassian.bitbucket.internal.ssh.rest.SshKeysResource.addSshKey(SshKeysResource.java:131)
Diagnosis
Environment
Bitbucket Server is running behind reverse-proxy such as Nginx
Cause
The reverse proxy is forcing the HTTP Header for Authorization
to an empty value, e.g. ""
1
proxy_set_header Authorization "";
Solution
Resolution
Remove the Nginx configuration that sets the Authorization header for any proxied requests to " "
Was this helpful?