My project has been building fine with the deploy key until I needed to add a submodule. Then it failed to clone submodules.
conq: repository access denied. deployment key is not associated with the requested repository.
fatal: Could not read from remote repository.
I followed the docs and added a user-key. After that it was unable to even pull the repository that I was building.
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
git command i returned 128:
I’m using BitBucket and I also don’t see any SSH keys added from CircleCI in BB.
I ended up manually generating a keypair and adding the pubkey to my BB account and the privkey to circleci > project settings > ssh permissions for the host bitbucket.org
I was having the same issue. It looks like Circle CI creates an ssh key but doesn’t submit it to Bitbucket.
I found a workaround although it feels very hacky. Open up the Chrome developer tools, and make sure you have “Log XMLHttpRequests” enabled. Then create a new user key. This will make a POST request to the Circle CI api. In the response to this API request there is a public ssh key. Copy this key and add it to your Bitbucket account as a new SSH key.
Thank you for your report, this is currently a known issue until Bitbucket is able to provide us an API to create user keys. Here is a workaround in the interim.
From https://circleci.com/bb/<Your-Organization-ID>/<Your-Project-ID>/edit#checkout:
Open Inspect Element in your browser’s developer tools.
Click Create User Key
Find the new public key generated in the Network tab.
Go to your Bitbucket account and add it manually.
Let us know if this work around solves your problem, and feel free to reach out to support@circleci.com
The first part shows me adding a deploy key that gets automatically added to Bitbucket.
For the user key, that you’ll need if you want to check out other private projects that are dependencies of the initial project, you’ll need to use the trick shown to copy the public key we generate from the console and then paste it into your Bitbucket user settings.
This is required because Bitbucket doesn’t have an API that allows us to add user keys.
We’re working on a way to make it so that this hack is not necessary!