Page MenuHomePhabricator

Unable to setup a clone of private git repo hosted on GitHub
Closed, DuplicatePublic

Description

We are trying to setup an external private repo hosted on GitHub by using the HTTPS protocoll and a Password within Passphrase with the right credentials:

[2014-08-21 13:24:06] EXCEPTION: (PhutilProxyException) Error while updating the "rCALLSIGN" repository. {>} (CommandException) Command failed with error #255!
COMMAND
'<phabricator>/bin/repository' update  -- 'CALLSIGN'

STDOUT
(empty)

STDERR
[2014-08-21 13:24:06] EXCEPTION: (Exception) git fetch failed with error #128:
stdout:

stderr:fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

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

 at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:313]
  #0 PhabricatorRepositoryPullEngine::executeGitUpdate() called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:91]
  #1 PhabricatorRepositoryPullEngine::pullRepository() called at [<phabricator>/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php:60]
  #2 PhabricatorRepositoryManagementUpdateWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:394]
  #3 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:290]
  #4 PhutilArgumentPars... (98 more bytes) ... at [<phutil>/src/future/exec/ExecFuture.php:397]
  #0 phlog(PhutilProxyException) called at [<phabricator>/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:335]
  #1 PhabricatorRepositoryPullLocalDaemon::resolveUpdateFuture(PhabricatorRepository, ExecFuture, integer) called at [<phabricator>/src/applications/repository/daemon/PhabricatorRepositoryPullLocalDaemon.php:198]
  #2 PhabricatorRepositoryPullLocalDaemon::run() called at [<phutil>/src/daemon/PhutilDaemon.php:84]
  #3 PhutilDaemon::execute() called at [<phutil>/scripts/daemon/exec/exec_daemon.php:111]

Event Timeline

witrin updated the task description. (Show Details)Aug 21 2014, 11:33 AM
witrin added a project: Diffusion.
witrin updated the task description. (Show Details)
witrin updated the task description. (Show Details)
witrin created this task.
witrin raised the priority of this task from to Normal.
witrin updated the task description. (Show Details)Aug 21 2014, 11:39 AM

Does git --version show 1.7.1?

witrin added a subscriber: witrin.Aug 21 2014, 11:59 AM

Ah sorry I forgot to mention:

$ git --version
git version 1.8.5.5

Can you show me the output of this?

$ cd /var/repo/CALLSIGN
/var/repo/CALLSIGN $ git remote show origin

...where /var/repo/CALLSIGN is the "Local Path" of the repository, visible from Diffusion > (The Repository) > Edit Repository > Local Path.

I expect the output to look like this:

$ git remote show origin
* remote origin
  Fetch URL: https://github.com/facebook/phabricator.git
  Push  URL: https://github.com/facebook/phabricator.git
  HEAD branch: master
  Local ref configured for 'git push':
    master pushes to master (up to date)

Hm that's weird:

$ cd /<pahbricator>/repositories/<CALLSIGN>/
$ git remote show origin
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

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

The repository exist, I've checked it manually with the same address, user and password.

I also have edited the Default Branch to develop and the Track Only to master, develop before activating.

Is it because develop is not the default on GitHub?

Did Phabricator clone this repository, or did you do it yourself?

(That git version is from the server, not your client or anything, right? 1.7.1 has a bug which causes a behavior very similar to this.)

I'd expect you to get an origin remote no matter what branches are present in the repository.

You can try repairing it manually, with:

$ git remote add origin protocol://github.com/path/to/repo.git

..and then run:

phabricator/ $ ./bin/repository update CALLSIGN --trace

...to see if that worked.

witrin added a comment.EditedAug 21 2014, 12:26 PM

The whole local directory of the repository was created by Phabricator. I just have used the UI. The shown git --version was from a terminal to the server.

$ cd /<pahbricator>/repositories/<CALLSIGN>/
$ git remote add origin https://github.com/<user>/<repo>.git
$ cd /<pahbricator>
$ ./bin/repository update <CALLSIGN> --trace
>>> [2] <connect> phabricator_repository
<<< [2] <connect> 2,067 us
>>> [3] <query> SELECT * FROM `repository` r  WHERE (r.callsign IN ('<CALLSIGN>')) ORDER BY r.id DESC 
<<< [3] <query> 527 us
>>> [4] <connect> phabricator_repository
<<< [4] <connect> 720 us
>>> [5] <query> INSERT INTO `repository_statusmessage`
          (repositoryID, statusType, statusCode, parameters, epoch)
          VALUES (10, 'init', 'working', '{\"message\":\"Updating the working copy for repository \'<CALLSIGN>\'.\"}', 1408623696)
          ON DUPLICATE KEY UPDATE
            statusCode = VALUES(statusCode),
            parameters = VALUES(parameters),
            epoch = VALUES(epoch)
<<< [5] <query> 908 us
>>> [6] <exec> $ git rev-parse --show-toplevel
<<< [6] <exec> 15,104 us
>>> [7] <exec> $ git fetch origin '+refs/heads/*:refs/heads/*' --prune

Is that still running, or did it suddenly exit there?

I've activated again and now it seems to be okay (Fully Imported).

Is this a bug?

Can you try this?

Create a script in phabricator/ called test_version.php, with this content:

<?php

require_once 'scripts/__init_script__.php';
var_dump(execx('git --version'));

Then run it like this:

$ sudo -u daemon-user php -f test_version.php

...where daemon-user is whatever user you start the daemons as.

Sure:

array(2) {
  [0]=>
  string(20) "git version 1.8.5.5
"
  [1]=>
  string(0) ""
}
witrin added a comment.EditedAug 21 2014, 12:44 PM

Is that still running, or did it suddenly exit there?

Sorry it was still running. I just forgot to enter the credentials there. But I think it doesn't matter anymore. After adding the origin manually it was working; like I wrote I've used the UI instead after that...

Alright, I have no idea what's going on. This behavior is consistent with T4946, which is specific to Git 1.7.1, but you clearly don't have Git 1.7.1.

The fix for T4946 will probably fix this too. I'm just going to merge this into that, but let me know if you're still seeing problems with this after that gets fixed.

epriestley closed this task as a duplicate.Aug 21 2014, 12:48 PM

✘ Merged into T4946.

Thanks a lot for your help!

how to configure git repository in centos 6.6