Page MenuHomePhabricator

Diffusion: Unable to setup a clone of private git repo hosted on github
Closed, ResolvedPublic

Description

I get the following error when I tried to add repo hosted elsewhere;

Command failed with error #128!
COMMAND
git clone --bare -- 'xxxxx' '/var/repo/ZZ'

STDOUT
Cloning into bare repository '/var/repo/ZZ'...


STDERR
Warning: Permanently added 'github.com,192.30.252.129' (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.
 at [/opt/phab/libphutil/src/future/exec/ExecFuture.php:398]
[16-Mar-2014 08:09:11]   #0 ExecFuture::resolvex() called at [/opt/phab/phabricator/src/applications/repository/storage/PhabricatorRepository.php:253]
[16-Mar-2014 08:09:11]   #1 PhabricatorRepository::execxRemoteCommand(clone --bare -- %P %s, Object PhutilOpaqueEnvelope, /var/repo/ZZ) called at [/opt/phab/phabricator/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:211]
[16-Mar-2014 08:09:11]   #2 PhabricatorRepositoryPullEngine::executeGitCreate() called at [/opt/phab/phabricator/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:78]
[16-Mar-2014 08:09:11]   #3 PhabricatorRepositoryPullEngine::pullRepository() called at [/opt/phab/phabricator/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:127]
[16-Mar-2014 08:09:11]   #4 PhabricatorRepositoryPullLocalDaemon::run() called at [/opt/phab/libphutil/src/daemon/PhutilDaemon.php:85]
[16-Mar-2014 08:09:11]   #5 PhutilDaemon::execute() called at [/opt/phab/libphutil/scripts/daemon/exec/exec_daemon.php:112]

This obviously suggests I have not setup access credentials properly. I generated ssh keys for the phd user on server and added key to my github account. I have added my personal credentials to phabricator, but it does not help. I am able to clone my github repos manually on the server.

The same error occurs with public repositories as well.

I'm not able to figure out where the gap is, will appreciate any pointers.

Event Timeline

vnykmshr assigned this task to epriestley.
vnykmshr raised the priority of this task from to Normal.
vnykmshr updated the task description. (Show Details)
vnykmshr added a project: Diffusion.
vnykmshr added a subscriber: vnykmshr.

When you say "generated ssh keys for the phd user on server", do you mean that you added the private key to Passphrase and configured Diffusion to use the key when connecting? If you just dropped a private key somewhere on disk (like /home/daemon/.ssh/id_rsa), we (probably) won't use it. It should be configured here:

Screen_Shot_2014-03-24_at_8.55.58_AM.png (813×1 px, 99 KB)

Yes, I have added credentials using the screen you suggested. I have my personal key added as well as the phd user's key added. Both public keys are also added on my github account.

Hey I am also stuck at same point do you guys found any solution to the problem.

Hey Guys,

I got the solution for this problem. We need to do it from command line as below:

root@edos-dp-dev-20 /var/www/phabricator # ./bin/repository pull M
Pulling 'M'...
Enter passphrase for key '/tmp/b40shoorty8kw4os/passphrase-ssh-key': 
<git user name>@<git remote url>'s password: 
Done.
root@edos-dp-dev-20 /var/www/phabricator #

Where M is Callsign of repository.

Thank You!!
Manoj Shekhawat

From command line I am able to pull, update, import successfully. But phd demon log are still throwing

COMMAND
'/var/www/phabricator/bin/repository' update  -- 'M'

STDOUT
(empty)

STDERR
[2014-05-13 13:19:16] EXCEPTION: (Exception) git fetch failed with error #128:
stdout:

stderr:Warning: Permanently added '<git URL>,<Git IP>' (RSA) to the list of known hosts.^M
Permission denied, please try again.^M
Permission denied, please try again.^M
Permission denied (publickey,password).^M
fatal: Could not read from remote repository.

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

 at [/var/www/phabricator/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:313]

And I am not able to solve this. Any help will be much appreciated. Thank You!!

While trying to pull the remote repo from command line ./bin/repository pull X, it's asking for passphrase. I do not have passphrase set to any of my keys.

Pull fails if I don't provide a pass phrase.

Enter passphrase for key '/tmp/b40shoorty8kw4os/passphrase-ssh-key':

I am still not able to add a remote repo to diffusion, any pointers?

We don't support keys with passwords. At HEAD, the "Passphrase" application should be able to strip these passwords for you. Otherwise, you can google for how to do it.

Thanks for quick response, but I do not have passphrase set for any keys added to my account. I have generated the keys without opting for a passphrase.

I think you've accidentally added a key with a password somewhere. We don't add passwords to keys, and there's no code anywhere in Phabricator which could do this.

My bad, but the add credentials screen is a bit confusing when it asks for username (required field), I had added some values to the username and password field while importing plain text ssh key.

I have destroyed my previous credentials, re-imported them, with a dummy username, no password of course. Just completed importing a repo from github.

Thanks for heads up!

Cool. Let us know if you run into anything else.

Cool looks good to me as well although I solved it by changing ssh to http protocol :)