My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2758: Gerrit Service Does not Start
6 people starred this issue and may be notified of changes. Back to list
Status:  AwaitingInformation
Owner:  ----


Sign in to add a comment
 
Reported by mehog...@gmail.com, Jul 4, 2014
************************************************************
***** 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:

What steps will reproduce the problem?
1. clone master branch for gerrit
2. build gerrit according to (https://gerrit-review.googlesource.com/Documentation/dev-buck.html)
3. setup gerrit over ssh on remote computer following (http://gerrit.googlecode.com/svn/documentation/2.1/install.html). Note in this step there were no warning displayed during setup. The web page did not show as expected because the remote server has x-server installed.
4. Reboot remote server. After setting /etc/default/gerritcodereview and running the gerrit.sh bash script I see Starting Gerrit Code Review: FAILED.

What is the expected output? What do you see instead?
Starting Gerrit Code Review: SUCCESS. is expected what is seen is above in repro steps.


Please provide any additional information below.

running bash -x gerrit.sh provides the following output:

gerrit2@localhost:~$ bash -x gerrit.sh stop
+ test 1 -gt 0
+ ACTION=stop
+ shift
+ test 0 -gt 0
+ test -z ''
+ NO_START=0
+ test -z ''
+ START_STOP_DAEMON=1
+ test -f /etc/default/gerritcodereview
+ . /etc/default/gerritcodereview
++ GERRIT_SITE=/home/gerrit2/Service
+ test -z ''
+ TMP=/tmp
+ TMPJ=/tmp/j6628
+ GERRIT_INSTALL_TRACE_FILE=etc/gerrit.config
+ type git
+ : OK
+ test -z /home/gerrit2/Service
+ test -z /home/gerrit2/Service
++ pwd
+ INITIAL_DIR=/home/gerrit2
+ cd /home/gerrit2/Service
++ pwd
+ GERRIT_SITE=/home/gerrit2/Service
+ GERRIT_CONFIG=/home/gerrit2/Service/etc/gerrit.config
+ test -f /home/gerrit2/Service/etc/gerrit.config
+ test -r /home/gerrit2/Service/etc/gerrit.config
+ GERRIT_PID=/home/gerrit2/Service/logs/gerrit.pid
+ GERRIT_RUN=/home/gerrit2/Service/logs/gerrit.run
+ GERRIT_TMP=/home/gerrit2/Service/tmp
+ export GERRIT_TMP
+ JAVA_HOME_OLD=
++ get_config --get container.javaHome
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--get = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --get container.javaHome
+ JAVA_HOME=/home/gerrit2/Devel/jdk1.7.0_60/jre
+ test -z /home/gerrit2/Devel/jdk1.7.0_60/jre
+ test -z /home/gerrit2/Devel/jdk1.7.0_60/jre
+ test -z '' -a -n /home/gerrit2/Devel/jdk1.7.0_60/jre -a -x /home/gerrit2/Devel/jdk1.7.0_60/jre/bin/java -a '!' -d /home/gerrit2/Devel/jdk1.7.0_60/jre/bin/java
+ JAVA=/home/gerrit2/Devel/jdk1.7.0_60/jre/bin/java
+ test -z /home/gerrit2/Devel/jdk1.7.0_60/jre/bin/java
++ get_config --get-all container.javaOptions
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--get-all = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --get-all container.javaOptions
+ GERRIT_OPTIONS=
+ test -n ''
++ get_config --get container.heapLimit
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--get = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --get container.heapLimit
+ GERRIT_MEMORY=
+ test -n ''
++ get_config --int core.packedGitOpenFiles
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--int = x--int
+++ git config --file /home/gerrit2/Service/etc/gerrit.config --int core.packedGitOpenFiles
++ n=
++ test x0 = x
++ echo ''
+ GERRIT_FDS=
+ test -z ''
+ GERRIT_FDS=128
++ expr 128 + 128
+ GERRIT_FDS=256
+ test 256 -lt 1024
+ GERRIT_FDS=1024
++ get_config --get container.user
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--get = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --get container.user
+ GERRIT_USER=gerrit2
+ ulimit -c 0
+ ulimit -d unlimited
+ ulimit -f unlimited
+ ulimit -m
+ ulimit -m unlimited
+ ulimit -n 1024
+ ulimit -t unlimited
+ ulimit -v unlimited
+ ulimit -x
+ ulimit -x unlimited
+ test -z ''
++ get_config --get container.war
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--get = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --get container.war
+ GERRIT_WAR=
+ test -z ''
+ GERRIT_WAR=/home/gerrit2/Service/bin/gerrit.war
+ test -f /home/gerrit2/Service/bin/gerrit.war
+ test -z /home/gerrit2/Service/bin/gerrit.war -a -n gerrit2
+ test -z /home/gerrit2/Service/bin/gerrit.war
+ test -z gerrit2
+ RUN_ARGS='-jar /home/gerrit2/Service/bin/gerrit.war daemon -d /home/gerrit2/Service'
++ get_config --bool container.slave
++ test -f /home/gerrit2/Service/etc/gerrit.config
++ test x--bool = x--int
++ git config --file /home/gerrit2/Service/etc/gerrit.config --bool container.slave
+ test '' = true
+ test -n ''
+ test -x /usr/bin/perl
+ export JAVA
+ RUN_EXEC=/usr/bin/perl
+ RUN_Arg1=-e
+ RUN_Arg2='$x=$ENV{JAVA};exec $x @ARGV;die $!'
+ RUN_Arg3='-- GerritCodeReview'
+ case "$ACTION" in
+ printf %s 'Stopping Gerrit Code Review: '
Stopping Gerrit Code Review: + test 1 = 1
+ type start-stop-daemon
+ start-stop-daemon -K -p /home/gerrit2/Service/logs/gerrit.pid -s HUP
start-stop-daemon: warning: failed to kill 6488: No such process
1 pids were not killed
No process in pidfile '/home/gerrit2/Service/logs/gerrit.pid' found running; none killed.
+ sleep 1
+ running /home/gerrit2/Service/logs/gerrit.pid
+ test -f /home/gerrit2/Service/logs/gerrit.pid
++ cat /home/gerrit2/Service/logs/gerrit.pid
+ PID=6488
+ ps -p 6488
+ return 1
+ rm -f /home/gerrit2/Service/logs/gerrit.pid /home/gerrit2/Service/logs/gerrit.run
+ echo OK
OK
+ exit 0
gerrit2@localhost:~$ gerrit.sh stop
Stopping Gerrit Code Review: No process in pidfile '/home/gerrit2/Service/logs/gerrit.pid' found running; none killed.
OK


Jul 4, 2014
#1 mehog...@gmail.com
The error logs give the following stacktrace:

com.google.inject.ProvisionException: Guice provision errors:

1) No index versions ready; run Reindex

1 error
    at com.google.gerrit.lucene.LuceneVersionManager.start(LuceneVersionManager.java:118)
    at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
    at com.google.gerrit.pgm.Daemon.start(Daemon.java:290)
    at com.google.gerrit.pgm.Daemon.run(Daemon.java:202)
    at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
    at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
    at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
    at Main.main(Main.java:25)

Looking at the code: 
    FileBasedConfig cfg;
    try {
      cfg = loadGerritIndexConfig(sitePaths);
    } catch (ConfigInvalidException e) {
      throw fail(e);
    } catch (IOException e) {
      throw fail(e);
    }

    if (!sitePaths.index_dir.exists()) {
--> line 118      throw new ProvisionException("No index versions ready; run Reindex");
    } else if (!sitePaths.index_dir.isDirectory()) {
      log.warn("Not a directory: %s", sitePaths.index_dir.getAbsolutePath());
      throw new ProvisionException("No index versions ready; run Reindex");
    }

Jul 4, 2014
#3 mehog...@gmail.com
Running the reindex command as per http://review.cyanogenmod.org/Documentation/pgm-reindex.html gives a different stack trace.

 Error opening database: "Sleep interrupted" [8000-174]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
	at org.h2.message.DbException.get(DbException.java:161)
	at org.h2.store.FileLock.getExceptionFatal(FileLock.java:450)
	at org.h2.store.FileLock.sleep(FileLock.java:445)
	at org.h2.store.FileLock.lockFile(FileLock.java:358)
	at org.h2.store.FileLock.lock(FileLock.java:133)
	at org.h2.engine.Database.open(Database.java:575)
	at org.h2.engine.Database.openDatabase(Database.java:236)
	at org.h2.engine.Database.<init>(Database.java:231)
	at org.h2.engine.Engine.openSession(Engine.java:56)
	at org.h2.engine.Engine.openSession(Engine.java:160)
	at org.h2.engine.Engine.createSessionAndValidate(Engine.java:139)
	at org.h2.engine.Engine.createSession(Engine.java:122)
	at org.h2.engine.Engine.createSession(Engine.java:28)
	at org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:323)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:105)
	at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:90)
	at org.h2.Driver.connect(Driver.java:73)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlHandle.<init>(H2CacheImpl.java:647)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.acquire(H2CacheImpl.java:615)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:362)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:334)
	at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:167)
	at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:113)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at org.h2.store.FileLock.sleep(FileLock.java:443)


I do not have H2 on my system and would prefer to use MySQL.
Jul 9, 2014
Project Member #4 David.Os...@gmail.com
After running reindex command i assume, it worked for you?
Status: AwaitingInformation
Jul 9, 2014
#5 mehog...@gmail.com
No it did not fix the problem. The last post shows the result of the reindex. What ended up fixing it was changing the port gerrit was listening on from 80 to 8080. Once I got it up and running I had issues getting OpenId to work with google+. Switched to httpd auth, and am now getting 500 internal errors from apache using reverse proxy to talk to the gerrit daemon. Are there any useful posts on getting rid of the 500 internal errors? I can post gerrit logs if needed.
Jul 9, 2014
#6 mehog...@gmail.com
Destroying the MySQL database solved the 500 internal errors.
Sign in to add a comment

Powered by Google Project Hosting