Failed to Startup Gerrit

3,698 views
Skip to first unread message

Steve Tso

unread,
Apr 23, 2015, 12:50:33 AM4/23/15
to repo-d...@googlegroups.com
Hi guys,

I would like to ask for your help in solving the problem after the installation.

I have followed the quick install guide and the following steps are completed.
  1. Gerrit Init. Files are copied and created in site folder.
  2. Schema is created
  3. Index is created with reindex command
When I tried to startup "gerrit.sh start", gerrit cannot be started up.

Message:
Starting Gerrit Code Review: FAILED

In the logs folder, I can find one file (gerrit.pid) only.

I tried to run the gerrit.sh with -x and here is the output.

Hope guys here could help.

Many many thanks in advance.

Regards,
Steve

---

gerrit.sh start (with -x arg in sh)


+ test 0 -gt 0

+ usage

++ basename ./gerrit.sh

+ me=gerrit.sh

+ echo 'Usage: gerrit.sh {start|stop|restart|check|status|run|supervise|threads} [-d site]'

Usage: gerrit.sh {start|stop|restart|check|status|run|supervise|threads} [-d site]

+ exit 1

[gerrit2@chopin bin]$ ./gerrit.sh start

+ test 1 -gt 0

+ ACTION=start

+ 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=/opt/gerrit/review

++ GERRIT_WAR=/opt/gerrit/review/bin

+ test -z ''

+ TMP=/tmp

+ TMPJ=/tmp/j28779

+ GERRIT_INSTALL_TRACE_FILE=etc/gerrit.config

+ type git

+ : OK

+ test -z /opt/gerrit/review

+ test -z /opt/gerrit/review

++ pwd

+ INITIAL_DIR=/opt/gerrit/review/bin

+ cd /opt/gerrit/review

++ pwd

+ GERRIT_SITE=/opt/gerrit/review

+ GERRIT_CONFIG=/opt/gerrit/review/etc/gerrit.config

+ test -f /opt/gerrit/review/etc/gerrit.config

+ test -r /opt/gerrit/review/etc/gerrit.config

+ GERRIT_PID=/opt/gerrit/review/logs/gerrit.pid

+ GERRIT_RUN=/opt/gerrit/review/logs/gerrit.run

+ GERRIT_TMP=/opt/gerrit/review/tmp

+ export GERRIT_TMP

+ JAVA_HOME_OLD=

++ get_config --get container.javaHome

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--get = x--int

++ git config --file /opt/gerrit/review/etc/gerrit.config --get container.javaHome

+ JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre

+ test -z /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre

+ test -z /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre

+ test -z '' -a -n /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre -a -x /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java -a '!' -d /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java

+ JAVA=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java

+ test -z /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java

+ test -z ''

+ JSTACK=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/jstack

++ get_config --get-all container.javaOptions

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--get-all = x--int

++ git config --file /opt/gerrit/review/etc/gerrit.config --get-all container.javaOptions

+ GERRIT_OPTIONS=

+ test -n ''

++ get_config --get container.heapLimit

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--get = x--int

++ git config --file /opt/gerrit/review/etc/gerrit.config --get container.heapLimit

+ GERRIT_MEMORY=

+ test -n ''

++ get_config --int core.packedGitOpenFiles

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--int = x--int

+++ git config --file /opt/gerrit/review/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 /opt/gerrit/review/etc/gerrit.config

++ test x--get = x--int

++ git config --file /opt/gerrit/review/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 /opt/gerrit/review/bin

+ test -z /opt/gerrit/review/bin

+ test -z /opt/gerrit/review/bin -a -n gerrit2

+ test -z /opt/gerrit/review/bin

+ test -z gerrit2

+ RUN_ARGS='-jar /opt/gerrit/review/bin daemon -d /opt/gerrit/review'

++ get_config --bool container.slave

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--bool = x--int

++ git config --file /opt/gerrit/review/etc/gerrit.config --bool container.slave

+ test '' = true

++ get_config --get-all container.daemonOpt

++ test -f /opt/gerrit/review/etc/gerrit.config

++ test x--get-all = x--int

++ git config --file /opt/gerrit/review/etc/gerrit.config --get-all container.daemonOpt

+ DAEMON_OPTS=

+ test -n ''

+ 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 'Starting Gerrit Code Review: '

Starting Gerrit Code Review: + test 1 = 0

+ test -z 503

++ date +%s

+ RUN_ID=1429760065.28779

+ RUN_ARGS='-jar /opt/gerrit/review/bin daemon -d /opt/gerrit/review --run-id=1429760065.28779'

+ test 1 = 1

+ type start-stop-daemon

+ test -f /opt/gerrit/review/logs/gerrit.pid

+ running /opt/gerrit/review/logs/gerrit.pid

+ test -f /opt/gerrit/review/logs/gerrit.pid

++ cat /opt/gerrit/review/logs/gerrit.pid

+ PID=28690

+ ps -p 28690

+ return 1

+ rm -f /opt/gerrit/review/logs/gerrit.pid /opt/gerrit/review/logs/gerrit.run

+ test 503 = 0 -a -n gerrit2

+ PID=28802

+ type disown

+ disown

+ echo 28802

+ /usr/bin/perl -e '$x=$ENV{JAVA};exec $x @ARGV;die $!' -- GerritCodeReview -jar /opt/gerrit/review/bin daemon -d /opt/gerrit/review --run-id=1429760065.28779

+ test 503 = 0

+ TIMEOUT=90

+ sleep 1

+ running /opt/gerrit/review/logs/gerrit.pid

+ test -f /opt/gerrit/review/logs/gerrit.pid

++ cat /opt/gerrit/review/logs/gerrit.pid

+ PID=28802

+ ps -p 28802

+ return 1

+ echo FAILED

FAILED

+ exit 1

Steve Tso

unread,
Apr 23, 2015, 2:42:01 AM4/23/15
to repo-d...@googlegroups.com
I could able to startup he gerrit with the following command:

java -jar /opt/gerrit/review/bin/gerrit.war daemon -d /opt/gerrit/review/ --show-stack-trace

But I unable to start with "gerrit.sh start"

Really dunno why.....

Michał Sochoń

unread,
Apr 24, 2015, 2:36:36 AM4/24/15
to repo-d...@googlegroups.com
Did you create gerrit2 user and did you run
chown -R gerrit2:gerrit2 /opt/gerrit/review
also check out /var/log directroy for errors.

Steve Tso

unread,
Apr 24, 2015, 6:17:22 AM4/24/15
to repo-d...@googlegroups.com
Verified the "review" is installed by gerrit2.gerrit2 already.

I cannot find any logs by gerrit at /var/log

Bassem Rabil

unread,
Apr 24, 2015, 7:35:00 AM4/24/15
to repo-d...@googlegroups.com
The Gerrit logs in your case should be located at: /opt/gerrit/review/logs/. You can check error_log log file, this might give you hints where the application was stuck.

Steve Tso

unread,
Apr 24, 2015, 1:28:08 PM4/24/15
to repo-d...@googlegroups.com
When I start the gerrit with gerrit.sh, the gerrit did not start and there no error log at /opt/gerrit/review/logs/.

Later I tried to start with java command directly, the gerrit can be started properly and logs are found at /opt/gerrit/review/logs/.

I really have no idea why gerrit cannot be started with /opt/gerrit/review/bin/gerrit.sh start -d /opt/gerrit/review/

Michał Sochoń

unread,
Apr 24, 2015, 1:37:34 PM4/24/15
to Steve Tso, repo-d...@googlegroups.com
try
gerrit.sh check
and verify it matches other settings.

Also you may try to use
gerrit.sh run


--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/BgAHf7w12P4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Michal Sochoń
alias _KaszpiR_ kas...@gmail.com
IRC: _KaszpiR_ @ freenode.net

Steve Tso

unread,
Apr 25, 2015, 4:16:33 AM4/25/15
to repo-d...@googlegroups.com, stev...@gmail.com
I think the config should be fine because the gerrit could be started up properly with java command directly. 
(but no with gerrit.sh start. Actually I suspect there is an issue on the perl command, which the java process cannot be started by the perl command)

I will try "gerrit.sh run" on Monday and see what will happen.

Thanks guys!

Steve Tso

unread,
Apr 27, 2015, 2:27:32 AM4/27/15
to repo-d...@googlegroups.com, stev...@gmail.com
Hi guys,

I got a progress! 

Here is the parameters from gerrit.sh check

Checking arguments to Gerrit Code Review:

  GERRIT_SITE     =  /opt/gerrit/review

  GERRIT_CONFIG   =  /opt/gerrit/review/etc/gerrit.config

  GERRIT_PID      =  /opt/gerrit/review/logs/gerrit.pid

  GERRIT_TMP      =  /opt/gerrit/review/tmp

  GERRIT_WAR      =  /opt/gerrit/review/bin

  GERRIT_FDS      =  1024

  GERRIT_USER     =  gerrit2

  JAVA            =  /usr/lib/jvm/java-1.7.0-openjdk-1.7.0.65.x86_64/jre/bin/java

  JAVA_OPTIONS    =  

  RUN_EXEC        =  /usr/bin/perl -e '$x=$ENV{JAVA};exec $x @ARGV;die $!' -- GerritCodeReview

  RUN_ARGS        =  -jar /opt/gerrit/review/bin daemon -d /opt/gerrit/review


When I try to run gerrit.sh run, there is an error:

Running Gerrit Code Review:

Error: Invalid or corrupt jarfile /opt/gerrit/review/bin


Regards,
Steve

Björn Pedersen

unread,
Apr 27, 2015, 4:09:58 AM4/27/15
to repo-d...@googlegroups.com, stev...@gmail.com


Am Montag, 27. April 2015 08:27:32 UTC+2 schrieb Steve Tso:
Hi guys,

I got a progress! 

Here is the parameters from gerrit.sh check
  GERRIT_WAR      =  /opt/gerrit/review/bin

This is definitly wrong, it should be the full path to the war file, e.g. /opt/gerr/review/bin/gerrit.war.

Björn

Steve Tso

unread,
Apr 27, 2015, 5:07:41 AM4/27/15
to repo-d...@googlegroups.com, stev...@gmail.com
Hi Björn,

Thanks!! That's the root cause.

There is a mistake and influenced by a wrong config file at /etc/default/gerritcodereview

I deleted the file /etc/default/gerritcodereview and I could start with gerrit.sh

Thanks.
Steve
Reply all
Reply to author
Forward
0 new messages