CircleCI submodule repository access denied. deployment key is not associated with the requested repository

In circleci, I get the following error when checking out a submodule

Submodule ‘submod’ (git@bitbucket.org:xx/submod.git) registered for path ‘submod’ Cloning into ‘/home/circleci/code/submod’… Warning: Permanently added the RSA host key for IP address ‘xxx.xxx.xxx.xx’ to the list of known hosts.

repository access denied. deployment key is not associated with the requested repository. fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. fatal: clone of ‘git@bitbucket.org:xx/submod.git’ into submodule path ‘/home/circleci/code/submod’ failed Failed to clone ‘submod’. Retry scheduled

my config.yml is

version: 2
jobs:
  build:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-25-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      - run: git submodule sync
      - run: git submodule update --init
      - run: echo "A second hello"

Is the SSH key associate with the module repo the same as the repo for the whole project? I don’t know what kind of assistance can be rendered here, since it requires the remote URLs of each repo to be examined.

I added the main project’s ssh key to the submodule and it worked! Thanks.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.