SSH key error when planning with atlantis

198 Views Asked by At

`when I push a plan to bitbucet remote, I get the below error during the plan. I was getting the same error earlier on my local but I updated the bitbucket key in known_hosts and the plan started to work. but I am now getting this error when on atlantis when a plan is running and I'm not sure what else to do.

`* error downloading 'ssh://[email protected]/xxx/iac-aws-terraform-module-vpcxxx: /usr/bin/git exited with 128: Cloning into '/atlantis/repos/xxx.com/path-to-workspace/.terragrunt-cache/dLUb5Ng4VMj0EcW9E8--pMYWir4/-NokUCzB4aGqGJzNw712i8XSkd0'... WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is SHA256:46OSHA1Rmj8E8ERTC6xkNcmGOw9oFxYr0WF6zWW8l1E. Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending RSA key in /root/.ssh/known_hosts:1 RSA host key for bitbucket.org has changed and you have requested strict checking. Host key verification failed. fatal: Could not read from remote repository.

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

time=2023-07-07T23:28:42Z level=error msg=Unable to determine underlying exit code, so Terragrunt will exit with error code 1

Has anyone else encountered this with bitbucket/atlantis please. PS: git push and pull still works on my local.

1

There are 1 best solutions below

0
On

Bitbucket rotated their main SSH key: https://bitbucket.org/blog/ssh-host-key-changes

You need to follow the instructions on that page, or in the error you posted, to remove the old key.