We are using CircleCI for our open source project. From last few days the build is failing for one of the repository. It is not able to checkout the code and error says Permission denied (publickey). fatal: Could not read from remote repository.
If this keeps happening you can try resetting webhooks, checkout keys, and deploy keys associated with the project. That will help us make sure you’re working from a clean slate.
Try the steps in the Support Center article below. Once that’s done, refollow the project on CircleCI, which should allow builds to start again.
After some digging, we can see that there is a lot of git-related auth in the environment variables. Most of the time, those aren’t necessary at all because CircleCI handles the auth for you when we create the key and add it to GitHub. It’s hard to say, but there’s a chance one of the tokens in the envar is expired.
Thanks @thekatertot, just to clarify I was using the git related auth in environment variables because of other reason I was trying to send an email about the status of the job.
Now I have removed all the variables except sonar_token which is required for quality analysis, still getting same error.
After removing environment variables, again just did stop building the project and followed the project again. It started working!
Thanks a lot @thekatertot