Gerrit 2 installation: Register new user

428 views
Skip to first unread message

Dmitry

unread,
Oct 29, 2009, 10:27:21 AM10/29/09
to Repo and Gerrit Discussion
Hi,
I'm trying to install gerrit 2 according to the instructions in
installation guide.
On some stage I need to register using the Web interface.
Unfortunately, this dialog is very small, I can see only header ("Code
Review - Register New Account) and cannot do registration.
Is to possible to fix this?

Shawn Pearce

unread,
Oct 29, 2009, 12:22:05 PM10/29/09
to repo-d...@googlegroups.com
On Thu, Oct 29, 2009 at 07:27, Dmitry <divi...@gmail.com> wrote:
> On some stage I need to register using the Web interface.
> Unfortunately, this dialog is very small, I can see only header ("Code
> Review - Register New Account) and cannot do registration.
> Is to possible to fix this?

Known bug http://code.google.com/p/gerrit/issues/detail?id=294

As a work around, use Sign-In. It'll accomplish the same thing, the
"Register" link is just there to help new users figure out they should
click something. Register and Sign-In are just two different labels
on the same internal code.

Dmitry

unread,
Oct 30, 2009, 12:08:52 PM10/30/09
to Repo and Gerrit Discussion
I had tried. With the OpenId (default).
Unsuccessfully.
I had found that the problem is the Gerrit behind the proxy.
I had swithed to use Jetty's authentication (Gerrit = HTTP, Jetty =
Basic).
After few hours learning Jetty docs and experimenting with test.war I
have the following: jetty reports
Problem accessing /login/mine. Reason: !role.

My configuration is slightly changed from default:

gerrit.xml:
I had added
<Set name="overrideDescriptor"><SystemProperty name="jetty.home"
default="."/>/contexts/gerrit.d/override-web.xml</Set>

<Get name="securityHandler">
<Set name="loginService">
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">GerritCodeReview</Set>
<Set name="config"><SystemProperty name="jetty.home"
default="."/>/etc/gerrit.properties</Set>
</New>
</Set>
</Get>

gerrit.d/override-web.xml contains:
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee/web-
app_2_5.xsd"
version="2.5">

<security-constraint>
<web-resource-collection>
<web-resource-name>A Protected Page</web-resource-name>
<url-pattern>/login/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>*</role-name>
<!--
<role-name>tester</role-name>
<role-name>admin</role-name>
<role-name>user</role-name> -->
</auth-constraint>
</security-constraint>

<login-config>
<auth-method>BASIC</auth-method>
<realm-name>GerritCodeReview</realm-name>
</login-config>

</web-app>

gerrit.properties contains:
dsmirnov: mypass,admin

So, when I log in as dsmirnov, I see this error.
Meantime, if I uncomment any of the roles, I will get another error
(in logs):
java.lang.IllegalArgumentException: Attempt to use undeclared role:
tester, known roles: []

And the question is khow to fix this?

Dmitry

On Oct 29, 7:22 pm, Shawn Pearce <s...@google.com> wrote:
> On Thu, Oct 29, 2009 at 07:27, Dmitry <divis1...@gmail.com> wrote:
> > On some stage I need to register using the Web interface.
> > Unfortunately, this dialog is very small, I can see only header ("Code
> > Review - Register New Account) and cannot do registration.
> > Is to possible to fix this?
>
> Known bughttp://code.google.com/p/gerrit/issues/detail?id=294

Dmitry

unread,
Nov 2, 2009, 11:28:22 AM11/2/09
to Repo and Gerrit Discussion
I had found a solution:

I added the follwing lines to the gerrit.d/override-web.xml:

<security-role>
<role-name>admin</role-name>
</security-role>

After that I was able to uncomment roles.
<security-constraint>
....
</security-constraint>

The next problem is the
fatal: '/NAND_Image': not a Gerrit project

I'm suspecting the Windows path to the gerrit base:
[gerrit]
basePath = D:\\GitRepository\

Am I right? If yes, how to fix it? If no, how can I log the error or
get some additional info about this problem?

Dmitry

Shawn Pearce

unread,
Nov 2, 2009, 11:32:33 AM11/2/09
to repo-d...@googlegroups.com
On Mon, Nov 2, 2009 at 08:28, Dmitry <divi...@gmail.com> wrote:
> The next problem is the
> fatal: '/NAND_Image': not a Gerrit project
>
> I'm suspecting the Windows path to the gerrit base:
> [gerrit]
>        basePath = D:\\GitRepository\
>
> Am I right? If yes, how to fix it? If no, how can I log the error or
> get some additional info about this problem?

You are probably correct. The configuration file parser eats one
level of \ so you may need one more \ at the end of the string. Or,
use / instead. Win32 accepts / just fine.

The other things to check are:

- Does NAND_Image exist in the project table? (Note its case
sensitive in the database, even if the filesystem isn't case
sensitive.)
- Do you have READ +1 permission on that project?
- Does D:/GitRepository/NAND_Image.git exist?
- Is it a valid Git repository?

Dmitry

unread,
Nov 2, 2009, 12:05:05 PM11/2/09
to Repo and Gerrit Discussion
Sorry, I made a mistake. There was trailing \\. I just copied it
incorrectly.

regarding the other things:
1.
sh-3.2$ ssh -p 29418 dsmirnov-nb gerrit ls-projects
Enter passphrase for key '/home/dsmirnov/.ssh/id_rsa':
NAND_Image.git
2. I'm not sure. The docs do not say explicitly I need to configure it
somehow (at least for manual project setup I had used). On the project
Access Rights (WEB page) I see
Read Access Administrators +1: Read access
Read Access Anonymous Users +1: Read access
I suppose this is enough since I see myself in the Administrators
group
3. Yes, D:/GitRepository/NAND_Image.git exists
4. Yes, it is a valid repository. I had created it some time ago and
it contains some staff. It is a bare repository created from my
development tree.



On Nov 2, 7:32 pm, Shawn Pearce <s...@google.com> wrote:

Shawn Pearce

unread,
Nov 2, 2009, 12:45:20 PM11/2/09
to repo-d...@googlegroups.com
On Mon, Nov 2, 2009 at 09:05, Dmitry <divi...@gmail.com> wrote:
> sh-3.2$ ssh -p 29418 dsmirnov-nb gerrit ls-projects
> Enter passphrase for key '/home/dsmirnov/.ssh/id_rsa':
> NAND_Image.git

Your database is incorrectly specified. Don't include the ".git"
suffix in the projects table in the database. You'll need to edit the
record to remove the ".git" suffix to fix the problem.

Basically we are dropping ".git" from the client request, and
searching the database, and not finding a match, because the database
expects the ".git" to be present.

Dmitry

unread,
Nov 5, 2009, 5:20:38 AM11/5/09
to Repo and Gerrit Discussion
Oh, yes, this works pretty good.

On Nov 2, 8:45 pm, Shawn Pearce <s...@google.com> wrote:
Reply all
Reply to author
Forward
0 new messages