Using user key for git submodule but still getting access denied

The bitbucket repo that I want to test in CircleCI uses a git submodule. Following Welcome to CircleCI Documentation - CircleCI, I understand that I need to add a user key (instead of or in addition to a deploy key???). So on https://circleci.com/bb/TEAM/REPO/edit#checkout, I created a user key. However, while the main repo is checked out fine with the deploy key, the submodule cannot be checked out:

$ git submodule update --init
Cloning into ‘/home/ubuntu/…’…
repository access denied. deployment key is not associated with the requested repository.

I have experimented with various configurations: deploy key as preferred and user key as second, user key as preferred and deploy key as second, only a user key. No configuration works.

While experimenting, I have noticed several things:

So it seems that somehow this user key generation does not work. From the command line, I can check out the main repo and the submodule just fine.

Please help!
PS: excuse the spaces in the links above, as a new user, apparently I’m not allowed to add more than two links

1 Like

I have the same problem very well described by snbuchholz. The workaround I used for this was to generate a new SSH key and adding the private one to CircleCI and the public one to Bitbucket. The point is that you need to copy/paste the private key for each CircleCI project you want access to Bitbucket from, so it’s not as easy as adding a user key.