Repository update fails (2019 week 13)

#1

Observed Behavior:
When editing related tasks of a commit and pressing “Save Related Tasks” button, Phabricator calls phabricator/bin/repository' update -- 'R6' in the background. Then the UI stalls.

If I manually invoke the commandwith --verbose I get the following:

Updating the working copy for repository "R6".
Remote "origin" exists, but is pointed at the wrong URI, "Push  URL:". Resetting origin URI to ".
[2019-03-30 11:31:34] EXCEPTION: (CommandException) Command failed with error #128!
COMMAND
git ls-remote '********'

STDOUT
(empty)

STDERR
fatal: no path specified; see 'git help pull' for valid url syntax
 at [<phutil>/src/future/exec/ExecFuture.php:380]
arcanist(head=master, ref.master=9830c9316d38), phabricator(head=master, ref.master=02f94cd7d288), phutil(head=master, ref.master=524fcf465108)
  #0 ExecFuture::resolvex() called at [<phabricator>/src/applications/repository/storage/PhabricatorRepository.php:497]
  #1 PhabricatorRepository::execxRemoteCommand(string, PhutilOpaqueEnvelope) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:399]
  #2 PhabricatorRepositoryPullEngine::loadGitRemoteRefs(PhabricatorRepository) called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:343]
  #3 PhabricatorRepositoryPullEngine::executeGitUpdate() called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:126]
  #4 PhabricatorRepositoryPullEngine::pullRepositoryWithLock() called at [<phabricator>/src/applications/repository/engine/PhabricatorRepositoryPullEngine.php:40]
  #5 PhabricatorRepositoryPullEngine::pullRepository() called at [<phabricator>/src/applications/repository/management/PhabricatorRepositoryManagementUpdateWorkflow.php:59]
  #6 PhabricatorRepositoryManagementUpdateWorkflow::execute(PhutilArgumentParser) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:457]
  #7 PhutilArgumentParser::parseWorkflowsFull(array) called at [<phutil>/src/parser/argument/PhutilArgumentParser.php:349]
  #8 PhutilArgumentParser::parseWorkflows(array) called at [<phabricator>/scripts/repository/manage_repositories.php:22]

--trace gives me the following additional information:

>>> [2] (+0) <connect> phabricator_repository
<<< [2] (+0) <connect> 952 us
>>> [3] (+2) <query> SELECT `r`.* FROM `repository` `r` WHERE ((r.id IN (6))) ORDER BY `r`.`id` DESC 
<<< [3] (+2) <query> 443 us
>>> [4] (+4) <query> SELECT * FROM `repository_uri` WHERE (repositoryPHID IN ('PHID-REPO-a4ly2srvv7hvz4itl5t7')) ORDER BY `id` DESC 
<<< [4] (+4) <query> 375 us
>>> [5] (+8) <lock> ph:phabric-6rILUDHKjHKu:repo.pu-frJm1SragNzU
>>> [6] (+8) <connect> phabricator_repository
<<< [6] (+8) <connect> 249 us
>>> [7] (+8) <query> SET wait_timeout = 2147483
<<< [7] (+8) <query> 90 us
>>> [8] (+8) <query> SELECT GET_LOCK('ph:phabric-6rILUDHKjHKu:repo.pu-frJm1SragNzU', 0)
<<< [8] (+8) <query> 123 us
Updating the working copy for repository "R6".
>>> [9] (+12) <exec> $ git remote show -n origin
<<< [9] (+18) <exec> 6,602 us
Remote "origin" exists, but is pointed at the wrong URI, "Push  URL:". Resetting origin URI to ".
>>> [10] (+19) <exec> $ git remote set-url origin '********'
<<< [10] (+26) <exec> 6,260 us
>>> [11] (+26) <exec> $ git rev-parse --show-toplevel
<<< [11] (+31) <exec> 4,821 us
>>> [12] (+31) <exec> $ git ls-remote '********'
<<< [12] (+37) <exec> 5,440 us
>>> [13] (+37) <connect> phabricator_repository
<<< [13] (+38) <connect> 666 us
>>> [14] (+38) <query> INSERT INTO `repository_statusmessage` (repositoryID, statusType, statusCode, parameters, epoch, messageCount) VALUES (6, 'init', 'error', '{\"message\":\"Pull of \'R6\' failed: Command failed with error #128!\\nCOMMAND\\ngit ls-remote \'********\'\\n\\nSTDOUT\\n(empty)\\n\\nSTDERR\\nfatal: no path specified; see \'git help pull\' for valid url syntax\\n\"}', 1553942705, 1) ON DUPLICATE KEY UPDATE messageCount = IF( statusCo
<<< [14] (+114) <query> 76,239 us
>>> [15] (+115) <query> SELECT RELEASE_LOCK('ph:phabric-6rILUDHKjHKu:repo.pu-frJm1SragNzU')
<<< [15] (+115) <query> 262 us
<<< [5] (+115) <lock> 107,455 us
>>> [16] (+115) <query> INSERT INTO `repository_statusmessage` (repositoryID, statusType, statusCode, parameters, epoch, messageCount) VALUES (6, 'fetch', 'error', '{\"message\":\"Error updating working copy: Command failed with error #128!\\nCOMMAND\\ngit ls-remote \'********\'\\n\\nSTDOUT\\n(empty)\\n\\nSTDERR\\nfatal: no path specified; see \'git help pull\' for valid url syntax\\n\"}', 1553942705, 1) ON DUPLICATE KEY UPDATE messageCount = IF( s
<<< [16] (+148) <query> 32,424 us

In the R6 directory if I issue git remote show -n origin I get the following:

* remote origin
  Fetch URL: 
  Push  URL: 
  HEAD branch: (not queried)
  Local ref configured for 'git push' (status not queried):
    (matching) pushes to (matching)

Expected Behavior:
Phabricator should correctly update the repository or properly report an error if it’s not possible to handle.

I have never touched the bare repo on the file system with git commands, all actions I made were through Phabricator.

Phabricator Version:

  • phabricator: 02f94cd7d2885de502d03934af3a0c24453e8e58 (Fri, Mar 29)
  • arcanist: 9830c9316d38988b2dc283ac1a124b73bc8e6c5f (Thu, Mar 7)
  • phutil: 524fcf465108216bf2fa6126473873ab8e42360a (Tue, Mar 26)

Reproduction Steps:
Steps the upstream can follow on a clean install to see the same issue

0 Likes

#2

When editing related tasks of a commit and pressing “Save Related Tasks” button, Phabricator calls phabricator/bin/repository' update -- 'R6' in the background.

I’m sure this part isn’t true. bin/repository update happens in daemon threads, unrelated to front-end actions and unrelated to editing commits from the front-end.

Remote "origin" exists, but is pointed at the wrong URI, "Push URL:". Resetting origin URI to ".

It might be possible to reach this state by somehow saving an empty Observe type URI? That should fail validations.

Phabricator should correctly update the repository or properly report an error if it’s not possible to handle.

The error is expected to be shown in the the repository page as a warning, and in the repository management page with details, under Status.

Steps the upstream can follow on a clean install to see the same issue

We need those in order to do anything useful.

0 Likes

#3

Hmm, I had a little time playing around setting commits to different tasks, and you’re right, now it seems to work. I don’t know why was it the case that the web UI button remained disabled.

Thank you for the hint, I took a look at the repo config screen. It reads the following:

As you can see it says it’s active then a line under that it’s still inactive. On the right hand side I can “Deactivate Repository”.

In the URI section it says “Phabricator will observe a remote repository.” I remember that I created a new repository within Phabricator (to be a hosted type).

I don’t know how a remote URL looks like but mine is totally similar to other, hosted, repositories, like:

ssh://phabricator-git@my-domain.com:2222/diffusion/6/my-repo.git	 Read/Write	 Visible

I remember that I created this repo to be the parent of many git submodules.

If you wish to chase down this issue, I’d gladly provide more debug information. If you don’t, then I’ll try to convert it to a proper hosted repository according to the user guide.

0 Likes