Details
-
Bug
-
Resolution: Fixed
-
Low
-
5.15.0.1, 5.14.1
-
Severity 3 - Minor
-
Description
Summary
If "Manage trusted keys" option is enabled and Bamboo is configured to use local SSH for Git, it is not possible to create Bitbucket Server repository in Bamboo server
Steps to Reproduce
- Enable "Manage trusted keys" at Administration >> Security >> Security settings
- Add SSH capability at Administration >> Build Resources >> Server capabilities
Capability type: Git Executable: SSH
- Create Bitbucket Server repository in Bamboo
Expected Results
It will show the message to add a SSH key into "Trusted keys", eg:
Could not test connection. Please add key 'localhost/127.0.0.1:7999' 'ssh-rsa AAAAB3Nza...' to the list of trusted keys. See 'Trusted keys' documentation for details.
Actual Results
It just show the following message:
Could not test connection. Please add your repository host SSH key to the list of trusted keys. See 'Trusted keys' documentation for details.
From the log, the SSH key is created by Bamboo and uploaded to Bitbucket Server:
2017-03-02 18:08:03,562 INFO [http-nio-8085-exec-15] [BitbucketServerServerConfigurator] Public key was added to Bitbucket Server (Bamboo user: kahloun.foong, application: Bitbucket [http://localhost:7990], location: repository TST/stash): ssh-rsa AAAAB3NzaC1... http://localhost:8085 2017-03-02 18:08:03,636 INFO [http-nio-8085-exec-15] [BitbucketServerServerConfigurator] Can't authenticate with Bitbucket Server despite successful public key storage: ssh-rsa AAAAB3NzaC1... http://localhost:8085
Even though this SSH key is added into "Trusted keys", clicking the "Save repository" button in the above Step 3 will generate a different SSH key
Notes
Bamboo should show the generated SSH key when using local SSH for Git
Workaround
- Delete the SSH capability at Bamboo Administration >> Build Resources >> Server capabilities >> Git
- Try to add/edit Bitbucket Server repository again at Bamboo Administration >> Build Resources >> Linked repositories
- From the error message that show the SSH key, add the SSH key into Bamboo Administration >> Security >> Trusted keys
- Click on the "Save repository" button again at Bamboo Administration >> Build Resources >> Linked repositories