Issue 1653: Installation of gerrit was unsuccessful
Status:  New
Owner: ----
Reported by chapp...@gmail.com, Nov 10, 2012
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version:

gerrit-full-2.5.war

Environment:

Ubuntu 12.04.1 LTS 64-bit

What steps will reproduce the problem?
1. Freshly install Ubuntu 12.04.1 LTS 64-bit
2. Install openjdk-6-sdk and openjdk-6-jre
3. Install mysql-server and git
4. Proceed with installing gerrit as detailed in http://gerrit-documentation.googlecode.com/svn/Documentation/2.5/install.html

What is the expected output? What do you see instead?

When I perform the steps to initialize the site:

    $ java -jar gerrit-2.5.war init -d ~/install/2.5

I go through the wizard and I select openid auth and run the site as https. Initialization tells me it was successful but I do not see gerrit being started once initialization completes as indicated in the installation guide:

    Initialized /home/gerrit2/review_site
    Executing /home/gerrit2/review_site/bin/gerrit.sh start
    Starting Gerrit Code Review: OK
    Waiting for server to start ... OK
    Opening browser ...

All I get is the firt line telling me it was initialized:

    Initialized /home/gerrit/install/2.5

So I then go and manually start it:

    $ ~/install/2.5/bin/gerrit.sh start

It then starts successfully with no indication that anything is wrong. At this point I double checked the ~/install/2.5/logs/* files and they are clean. I then go to the webui and follow the steps to register the first user. Apparently this is supposed to make that user the administrator by default. However, this did not happen. I went to mysql and checked the database tables. My user was created with account id 1 but there was no corresponding entry in the group members table. So I thought, fair enough, and inserted an entry for my user to map it to the administrator group id 1. I then restarted gerrit and reopened the site page. My user still did not have any administration privileges. So I am sitting at this point with a gerrit install that is unusable. 

I tried a new installation from scratch again with the same issue. The initial user does not have admin privileges and I can't seem to force it by manually manipulating the database.
Nov 10, 2012
#1 chapp...@gmail.com
Looks like my system_config table was not updated correctly. Still not sure why t

mysql> select * from system_config;
+----------------------+----------------------------+----------------+------------------+--------------------+---------------------+-------------------+----------------+----------------------+------------------------+-----------+
| site_path            | register_email_private_key | admin_group_id | admin_group_uuid | anonymous_group_id | registered_group_id | wild_project_name | owner_group_id | batch_users_group_id | batch_users_group_uuid | singleton |
+----------------------+----------------------------+----------------+------------------+--------------------+---------------------+-------------------+----------------+----------------------+------------------------+-----------+
| /home/gerrit/install | NULL                       |           NULL | NULL             |               NULL |                NULL | NULL              |           NULL |                 NULL | NULL                   | X         |
+----------------------+----------------------------+----------------+------------------+--------------------+---------------------+-------------------+----------------+----------------------+------------------------+-----------+

Nov 10, 2012
#2 chapp...@gmail.com
I think I know what might have transpired here. It looks like I may have initially run:

    $ java -jar gerrit-2.5.war init --batch -d ~/install/2.5

which completely bypassed the initial configuration the first time. Then I ran:

    $ java -jar gerrit-2.5.war init -d ~/install/2.5

and configured. In both cases, it exited after printing this message.

    Initialized /home/gerrit/install/2.5

I then had all of the issues with no administrator account. So I went back, deleted the ~/install directory and ran:

    $ java -jar gerrit-2.5.war init -d ~/install/2.5

This time after configuration it did output the following:

    Initialized /home/gerrit/install/2.5
    Executing /home/gerrit/install/2.5/bin/gerrit.sh start
    Starting Gerrit Code Review: OK
    Waiting for server to start ... OK
    Opening browser ...

So I now have a working install but still a bit of a schmeggle getting there :). 
Feb 1, 2013
#3 ad...@carnivalize.it
I'm in kind of the same situation here, on a Debian VM, I've tried several initialization, but each time, I got an admin account (in the admin group) that can't verify anything...

gerrit2@gitMachina:~$ java -jar gerrit-full-2.5.1.war init --batch -d ~/gerrit2
Generating SSH host key ... rsa(simple)... done
Initialized /home/gerrit2/gerrit2
Executing /home/gerrit2/gerrit2/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Oct 29, 2013
#4 rco...@gmail.com
I'm in the same boat.  I've re-run the installation twice, using LDAP as the auth type.  In both cases, I had no admin entry in the system_config table, nor did I have an account entry for my user.  I had to set the uuid and ids manually in system_conf and added my entry to the accounts table.  At this point, I can log in as administrator but can't do anything administrative, like edit project access.

The first time I ever installed gerrit, I used OpenID.  That time everything seemed to work correctly, as far as my user getting admin rights.  But then I tried changing the config to use LDAP and from then on, nothing but trouble.  I have to say, installign Gerrit is the most pain I've ever experienced.
Jun 8, 2014
#5 MDengF...@gmail.com
I hit the same issue in Version  v2.9rc2.
I chose "http" auth type. There is no error in installation. 
But when I logged the first user "root" into gerrit with browser. The account was dispalyed one member of administrator group (attached file 1). But the account id was 1 instead of 1000000 (attached file 2).
I checked the database table "system_config" ,I got the same result of #1.
I have no idea what's wrong. I can't find "admin" menu when logged in with "root" account.  Anyone can help me ?
issue1.png
57.4 KB   View   Download
issue2.png
52.2 KB   View   Download
Jun 9, 2014
Project Member #6 edwin.ke...@gmail.com
> I have no idea what's wrong. I can't find "admin" menu when logged in with "root" 
> account.  Anyone can help me ?
With Gerrit 2.9 there is no "Admin" menu anymore.
From your screenshot I can see that the "Plugins" is visible to you. This menu is only visible to administrators. So everything seems to be fine.
Jul 29, 2015
#7 lwalenty...@gmail.com
the same situation in gerrit-2.11.2 Column admin_group_id in system_config table is NULL
Oct 30, 2015
#8 bcodd...@gmail.com
Ran into this on gerrit-2.11.4.  The problem was my All-Projects.git repo was not getting initialized by the first user login due to some setup error.  That repository needs an initial commit containing /groups and /project.config files with the correct UUIDs set for Administrators on refs/meta/config.

The easiest fix for me was to initialize a dummy site w/ standalone daemon, then clone that dummy site's All-Projects.git repo, modify /groups, and push to the broken site's All-Project.git repo.