SSH keys not valid after upgrading to circle ci v2

Hi

Im trying to convert my build script from v1 to v2, but I keep getting a permission error:

Warning: Permanently added '35.198.xxx.xxx' (ECDSA) to the list of known hosts.

Permission denied (publickey).

fatal: Could not read from remote repository.

Im using dokku, and I these commands to push to dokku. Working fine in v1, but now I get a a permission error… I use same keys, same server and haven’t changed anything in the project. Here are my commands I use in my new config.yml file:

  - run:
      name: Add dokku as remote branch
      command: git remote add dokku dokku@35.198.xxx.xxx:appname
  - run:
      name: Push to dokku production
      command: git push dokku master

I’m not sure what Im doing wrong here? :slight_smile:

/Peter

Have you added your git checkout key in the CircleCI UI? If so, could you try removing and readding the key from the UI, or changing it out for a new (and authorized with GH) key?

It was added yes… As I said… it worked before going to v2.0, so all the keys should already have sat up. But I tried to delete the key and add it again. Still no luck.

I just found the solution though. I needed to add:
- add_ssh_keys
to the jobs steps, just after checkout. That did the trick :slight_smile:

Thanks

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