Search code examples
circlecicircleci-workflows

I am having a permissions error with CircleCI when doing build and test runs (how to fix it)


Is the solution related to not having a public access token for the github repository or not having a deploy key? I am new to using DevOps tools like CircleCi so I need some input please as to what might be the issue and what steps I need to fix it. I already created a deploy key at the beginning when I created an account with Circle CI with a passphrase (it asks you to do so but it does give you an option to add more SSH keys which I thought you don't have to do, which I may be wrong about), do I need to add another.

#!/bin/sh

Using SSH Config Dir '/home/circleci/.ssh'
git version 2.40.0
Cloning git repository
Cloning into '.'...
Load key "/home/circleci/.ssh/id_rsa": error in libcrypto
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

exit status 128

Was expecting my build to work and I have looked online as my setup seems okay for my app.


Solution

  • It all depends if it's a standalone project (new GitHub App integration) or not (legacy GitHub OAuth App integration).

    If it's the new integration, you need to manually create and add an SSH key to your project settings. That SSH key should not have a passphrase.

    If it's the legacy integration, then a deploy SSH key is automatically added when you set up the project. But you can then opt to add a user SSH key, as the preferred one.

    The solution to your issue will depend on which CircleCI-GitHub integration you're "using".