Last modified: 2014-11-17 21:36:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T64844, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 62844 - Unable to push changes to gerrit when using Vagrant
Unable to push changes to gerrit when using Vagrant
Status: REOPENED
Product: MediaWiki-Vagrant
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Unprioritized normal
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-03-19 18:39 UTC by Helder
Modified: 2014-11-17 21:36 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Helder 2014-03-19 18:39:41 UTC
After making some changes to
/vagrant/mediawiki/extensions/CodeEditor/modules/jquery.codeEditor.js
I tried to run
> git review -R
but I got this:
> Problems encountered installing commit-msg hook
> The following command failed with exit code 1
>     "scp  gerrit.wikimedia.org:hooks/commit-msg .git/hooks/commit-msg"
> -----------------------
> .git/hooks/commit-msg: No such file or directory
> -----------------------
This happened before, a few weeks ago, when I tried to make changes to mediawiki core.

If I download the code in other directory, completelly unrelated to vagrant, I'm able to follow the steps from
https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch
normally:
https://gerrit.wikimedia.org/r/#/c/119527/

Am I missing something or is this a bug?
Comment 1 Helder 2014-08-08 19:13:29 UTC
I'm still unable to use git review -R (after installing vagrant on Linux Mint 17).
This time the error message is a little different:

me@here ~/mw-vagrant/mediawiki/extensions/Gadgets $ git review -R
Traceback (most recent call last):
  File "/usr/local/bin/git-review", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 1202, in main
    set_hooks_commit_msg(remote, hook_file)
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 264, in set_hooks_commit_msg
    res = run_http_exc(CannotInstallHook, hook_url, stream=True)
  File "/usr/local/lib/python2.7/dist-packages/git_review/cmd.py", line 175, in run_http_exc
    raise klazz(255, str(err), ('GET', url), env)
git_review.cmd.CannotInstallHook: Problems encountered installing commit-msg hook
The following command failed with exit code 255
    "GET https://gerrit.wikimedia.org/tools/hooks/commit-msg"
-----------------------
Problems encountered installing commit-msg hook
The following command failed with exit code 104
    "GET https://gerrit.wikimedia.org/tools/hooks/commit-msg"
-----------------------
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /tools/hooks/commit-msg was not found on this server.</p>
</body></html>

-----------------------
-----------------------
Comment 2 Eran Roz 2014-08-19 18:50:37 UTC
With no Vagrant, after pip install -U git-review, I'm getting the same error.
Comment 3 Marcin Cieślak 2014-10-04 11:17:02 UTC
Can you check your

git remote -v

If it only lists HTTP remotes ("https://gerrit.wikimedia.org/r/p/mediawiki/core.git"), than the gerrit repo got checked out using HTTP and not SSH as it should be.

One way to fix this is to have a new checkout as described in

https://www.mediawiki.org/wiki/Gerrit/Tutorial#How_to_submit_a_patch

and have

git clone ssh://USERNAME@gerrit.wikimedia.org:29418/mediawiki/core.git

done again

or fix it using this (assuming your HTTP remote is called "origin"):

git remote add gerrit ssh://USERNAME@gerrit.wikimedia.org:29418/mediawiki/core.git
git remote update
(it it fails at this point, check your SSH key setup, including your SSH agent)

and then

git remote rm origin

now

git-review -s

should "just work"
Comment 4 Marcin Cieślak 2014-10-04 11:42:24 UTC
If you have any commit outstanding, you need probably to "git commit --amend" again to make sure your Change-Id gets generated and included in the commit message.

You can check the last commit message with "git show HEAD".
Comment 5 Marcin Cieślak 2014-10-04 11:53:03 UTC
Also, please see https://www.mediawiki.org/wiki/Talk:MediaWiki-Vagrant#SSH_for_default_clone_link.3F for discussion whether default HTTP clone is to blame.
Comment 6 Helder 2014-10-04 12:22:48 UTC
(In reply to Marcin Cieślak from comment #3)
> Can you check your
> 
> git remote -v
> 
> If it only lists HTTP remotes
> ("https://gerrit.wikimedia.org/r/p/mediawiki/core.git"), than the gerrit
> repo got checked out using HTTP and not SSH as it should be.

Yes. This is what I got:
origin	https://gerrit.wikimedia.org/r/p/mediawiki/core.git (fetch)
origin	https://gerrit.wikimedia.org/r/p/mediawiki/core.git (push)
Comment 7 Marcin Cieślak 2014-10-04 20:53:01 UTC
Is this because of initial MediaWiki checkout as described on

https://www.mediawiki.org/wiki/MediaWiki-Vagrant

$ git clone https://gerrit.wikimedia.org/r/mediawiki/vagrant
$ cd vagrant
$ git submodule update --init --recursive
$ ./setup.sh  # or setup.bat on Windows
$ vagrant up

Maybe if the initial checkout would have been done with

$ git clone ssh://<username>@gerrit.wikimedia.org/:29418/mediawiki/core.git

it would work?

(not using vagrant here)
Comment 8 Bryan Davis 2014-10-04 20:55:35 UTC
I just left a longish comment on this topic on the talk page <https://www.mediawiki.org/wiki/Talk:MediaWiki-Vagrant#Using_ssh_git_origin_URLs>

TL;DR is that out of the box the git origin URLs are not configured for ssh access to gerrit.
Comment 9 Bryan Davis 2014-11-17 21:36:09 UTC
Bulk unassigning bugs from Ori.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links