Flag When A Job Fails Due To A Missing Deploy Key
N
Nick Smith
As a security precaution, GitHub automatically deletes SSH keys that haven't been used in a year. On CircleCI this results in the checkout step failing with the following error:
Either git or ssh (required by git to clone through SSH) is not installed in the image. Falling back to CircleCI's native git client but the behavior may be different from official git. If this is an issue, please use an image that has official git and ssh installed.
Cloning git repository - git@github.com:org/repo.git
error cloning repository: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
This error does not tell the user the deploy key has been deleted, which can cause confusion. If the project and/or job was flagged as not having a deploy key that would allow the user to fix the issue without having to investigate.
smith smart
To address the issue with CircleCI failing during the checkout step due to the deletion of SSH keys, it's crucial to understand that GitHub automatically removes SSH keys that haven't been used for a year. This can lead to authentication failures, as indicated by the error message you received.
Suggested Solution
Check SSH Keys:
Verify if the SSH key used for the CircleCI deployment has been deleted from GitHub. If it has, you'll need to generate a new SSH key and add it to your GitHub repository as a deploy key.
Add Deploy Key:
Generate a new SSH key pair using the command:
Copy
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Add the public key (.pub file) to your GitHub repository under Settings > Deploy keys.
Update CircleCI Configuration:
Ensure that the new SSH key is configured correctly in CircleCI. You can add it as an environment variable or directly in the CircleCI project settings.
Job Flagging:
Consider implementing a check in your CircleCI configuration to flag jobs that do not have a valid deploy key. This can help users quickly identify and resolve the issue without extensive troubleshooting.
You try.
--------------------------
crazy chicken 3d