0

We had a consultant configure our CI, but since he left we get the following error whenever trying to deploy:

Warning: Permanently added 'heroku.com,40.19.75.141' (RSA) to the list of known hosts.

!  Your account pedro@someemail.com does not have access to mysascards-staging.
!  
!  SSH Key Fingerprint: 41:fc:8a:39:fb:ed:eb:a6:69:a5:1b:ff:35:84:41:2f

fatal: Could not read from remote repository.

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

If I add "pedro@someemail.com" to heroku, the deployment works fine.

How do I remove the dependency on this account from our codeship configuration?

Allan Bowe
  • 12,306
  • 19
  • 75
  • 124

2 Answers2

1

In order for you to deploy your app using Codeship, you need to provide the Heroku API key from your Heroku account.

You can access your Heroku API key here - https://dashboard.heroku.com/account.

Once you have your API key, you can change the deployment configuration with the following steps:

  1. Navigate to your project
  2. Click Project Settings
  3. Click Deploy
  4. Copy/Paste the API key to Heroku API Key

Make sure the Heroku user's API key has access to the application mysascards-staging

If the project has been transferred (as it appears yours has), the SSH Key that was assigned to the project most likely needs to be recreated.

You can recreate the SSH key by submitting a help ticket, and the add the key to both Heroku and the SCM.

Let me know if this helps!

Kelly J Andrews
  • 5,083
  • 1
  • 19
  • 32
  • Thanks for prompt response. So I had already put my Heroku API key into Codeship, but how do I ensure that key is in the `mysascards-staging` application? – Allan Bowe Aug 15 '17 at 13:46
  • Your user has an API key which gives access to various projects. If your user on Heroku has access to that application, then the API key will work for that application. – Kelly J Andrews Aug 15 '17 at 13:49
  • That's the thing.. It doesn't. My user (email) is listed on the 'access' tab as 'owner', I also own both the heroku account and the codeship account. The only 'complication' is that the codeship account was originally owned by the pedro address above. The domain was transferred to me. – Allan Bowe Aug 15 '17 at 13:51
  • In codeship, on the 'general' tab, you can select the account used for authentication to bitbucket. No such dropdown exists for the 'deploy' tab, for heroku.. – Allan Bowe Aug 15 '17 at 13:53
  • It may also be the SSH key here as well. https://documentation.codeship.com/basic/continuous-deployment/deployment-to-heroku/#add-ssh-key-to-heroku – Kelly J Andrews Aug 15 '17 at 14:02
  • If replacing the ssh key doesn't work, submit a helpdesk ticket and we can look further. – Kelly J Andrews Aug 15 '17 at 14:03
  • @AllanBowe - I just confirmed with out customer success team that most likely you need a new SSH key created for the project. Submit a ticket to https://helpdesk.codeship.com/hc/en-us and they will get you fixed up. – Kelly J Andrews Aug 15 '17 at 14:41
  • 1
    yes - I just came to that conclusion after adding the key! `This key is already in use by another account. Each account must have a unique key.` Thanks - I got in touch: https://helpdesk.codeship.com/hc/en-us/requests/15098 – Allan Bowe Aug 15 '17 at 15:22
0

To clarify the answer above - it was necessary to generate a new SSH key on codeship as the account had changed ownership.

This key then needed to be added to both the remote GIT repo (bitbucket in my case) and in Heroku. In both cases, this was possible directly on the site (no command line needed).

Allan Bowe
  • 12,306
  • 19
  • 75
  • 124