1. Bitbucket Website
  2. Public Issue Tracker
  3. master

Issues

Issue #10274 invalid

I can't pull from aws opsworks by ssh key.

alexis li
created an issue

I think I use the right key. but got error message below. [2014-08-21T02:34:43+00:00] ERROR: Running exception handlers [2014-08-21T02:34:43+00:00] ERROR: Exception handlers complete [2014-08-21T02:34:43+00:00] FATAL: Stacktrace dumped to /var/lib/aws/opsworks/cache.stage2/chef-stacktrace.out [2014-08-21T02:34:43+00:00] ERROR: deploy[/srv/www/rock] (deploy::rails line 65) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '128' ---- Begin output of git ls-remote "git@bitbucket.org:rock/rock.git" testmerge* ---- STDOUT: STDERR: Warning: Permanently added 'bitbucket.org,131.103.20.167' (RSA) to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists. ---- End output of git ls-remote "git@bitbucket.org:rock/rock.git" testmerge ---- Ran git ls-remote "git@bitbucket.org:rock/rock.git" testmerge returned 128 [2014-08-21T02:34:43+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

I submit two kinds of ssh key format below, and it failed both.

-----BEGIN RSA PRIVATE KEY----- ssh-rsa XXX Alexis@alexisdembp -----END RSA PRIVATE KEY-----

Or

-----BEGIN RSA PRIVATE KEY----- XXX -----END RSA PRIVATE KEY-----

Comments (2)

  1. Tim Johns

    Mr. Garcia,

    Other folks including myself would likely benefit from a public solution or at least some basic diagnostic steps. I suspect this is a commonly-encountered problem with a handful of potential root causes. When Ms. Li's issue is resolved please consider posting a generalized response publicly as well. In the interim I will also open a support issue.

    EDITED

    While waiting for my support password reset email, I decided to characterize this better and try a few things, and it "magically" started working for me.

    I originally saw the symptoms in the startup log:

    ---- Begin output of git ls-remote "git@bitbucket.org:redacted/redacted-service.git" HEAD ----
    STDOUT: 
    STDERR: Warning: Permanently added 'bitbucket.org,131.103.20.167' (RSA) to the list of known hosts. 
    Permission denied (publickey). 
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    ---- End output of git ls-remote "git@bitbucket.org:redacted/redacted-service.git" HEAD ----
    

    Suspecting perhaps the first-run addition to the known hosts was the culprit, I re-launched the instance and still got something very similar (same thing, but without the warning):

    ---- Begin output of git ls-remote "git@bitbucket.org:redacted/redacted-service.git" HEAD ----
    STDOUT: 
    STDERR: Permission denied (publickey). 
    fatal: Could not read from remote repository.
    
    Please make sure you have the correct access rights
    and the repository exists.
    ---- End output of git ls-remote "git@bitbucket.org:redacted/redacted-service.git" HEAD ----
    

    I then also tried pre-pending ssh: to the URL, but it still failed.

    Certain that the original URL should work per the docs, I ssh'd over and tried this from the command line, which works fine:

    timjohns@rails-app1:~$ sudo -u deploy git ls-remote "git@bitbucket.org:redactedapp/redacted-service.git"
    2e8cee51fabdf78367a79262f50123fe9b08612d    HEAD
    2e8cee51fabdf78367a79262f50123fe9b08612d    refs/heads/master
    f0dc239b8d19e73a4cef17e656fee53f8b8b710f    refs/heads/normalize_account_information
    timjohns@rails-app1:~$ 
    

    Finally (...and puzzlingly) I tried re-launching it with the original URLs - and it worked... No clue what I did to 'fix' it, but hopefully my experience will help someone seeing something similar.

    Thanks!

    Tim

  2. Log in to comment