# Checkout fails with user-key (bitbucket)

**URL:** <https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735>\
**Category:** Build Environment\
**Tags:** bitbucket\
**Created:** [December 14, 2016, 4:30pm UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735 "2016-12-14T16:30:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![eguven](https://avatars.discourse-cdn.com/v4/letter/e/ac8455/32.png) [@eguven](https://discuss.circleci.com/u/eguven)\
**Post date:** [December 14, 2016, 4:30pm UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/1 "2016-12-14T16:30:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![angl](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@angl](https://discuss.circleci.com/u/angl)\
**Post date:** [January 4, 2017, 10:28am UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/2 "2017-01-04T10:28:54Z")

</div>

I’m hitting the exact same issue. Like eguven mentioned I couldn’t find the key being added anywhere in my BB account.

---

<div class="post-metadata">

**Author:** ![eguven](https://avatars.discourse-cdn.com/v4/letter/e/ac8455/32.png) [@eguven](https://discuss.circleci.com/u/eguven)\
**Post date:** [January 4, 2017, 11:05am UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/3 "2017-01-04T11:05:18Z")

</div>

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](http://bitbucket.org)

It’s a bit inconvenient.

---

<div class="post-metadata">

**Author:** ![andreyfedoseev](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/andreyfedoseev/32/792_2.png) [@andreyfedoseev](https://discuss.circleci.com/u/andreyfedoseev)\
**Post date:** [March 8, 2017, 12:27am UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/4 "2017-03-08T00:27:40Z")

</div>

I’m having the same problem. I’ve added a user-key to my CircleCI project but I don’t see any new public keys added to my BitBucket account.

---

<div class="post-metadata">

**Author:** ![robertdev](https://avatars.discourse-cdn.com/v4/letter/r/54ee81/32.png) [@robertdev](https://discuss.circleci.com/u/robertdev)\
**Post date:** [March 8, 2017, 11:39am UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/5 "2017-03-08T11:39:28Z")

</div>

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.

The build should work now.

---

<div class="post-metadata">

**Author:** ![vitaliytv](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/vitaliytv/32/15386_2.png) [@vitaliytv](https://discuss.circleci.com/u/vitaliytv)\
**Post date:** [March 8, 2017, 5:44pm UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/6 "2017-03-08T17:44:39Z")

</div>

thank you, it’s work

---

<div class="post-metadata">

**Author:** ![zzak](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/zzak/32/4233_2.png) [@zzak](https://discuss.circleci.com/u/zzak)\
**Post date:** [May 15, 2017, 10:56pm UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/7 "2017-05-15T22:56:20Z")

</div>

Hello,

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`:

1. Open Inspect Element in your browser’s developer tools.
2. Click Create User Key
3. Find the new public key generated in the Network tab.
4. 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](mailto:support@circleci.com)

Best,  
@zzak

---

<div class="post-metadata">

**Author:** ![tom](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/tom/32/27680_2.png) [@tom](https://discuss.circleci.com/u/tom)\
**Post date:** [July 13, 2017, 3:30pm UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/8 "2017-07-13T15:30:08Z")

</div>

Here’s a screencast to show how to do this:

[http://recordit.co/fTYmKQeBBO](http://recordit.co/fTYmKQeBBO)

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!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:38am UTC](https://discuss.circleci.com/t/checkout-fails-with-user-key-bitbucket/8735/9 "2018-06-18T11:38:59Z")

</div>


