Gerrit fails to start if init with port # 80. port 8080 works fine.

4,966 views
Skip to first unread message

bomjose

unread,
Oct 19, 2011, 2:46:03 PM10/19/11
to Repo and Gerrit Discussion
When i initialize gerrit with "Listen on Port : 80" then it fails in
with error
Starting Gerrit Code Review: FAILED
error: cannot start Gerrit: exit status 1

But with port number 8080 it is working fine. Can someone please
advise why it is failing on port 80. See below logs from error.log. it
shows failure when port 80 is used and show success when 8080 is used
second time.


[2011-10-19 11:26:25,386] INFO
com.google.gerrit.server.git.PushReplication : Empty /home/gerrit2/
review_site/etc/replication.config; not replicating
[2011-10-19 11:26:28,181] WARN com.google.gerrit.sshd.SshDaemon :
Disabling cipher aes192-cbc: Illegal key size; try installing
unlimited cryptography extension
[2011-10-19 11:26:28,182] WARN com.google.gerrit.sshd.SshDaemon :
Disabling cipher aes256-cbc: Illegal key size; try installing
unlimited cryptography extension
[2011-10-19 11:26:28,202] WARN com.google.gerrit.httpd.GitWebConfig :
gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2011-10-19 11:26:28,708] INFO
com.google.gerrit.server.cache.CachePool : Enabling disk cache /home/
gerrit2/review_site/cache
[2011-10-19 11:26:28,844] INFO com.google.gerrit.sshd.SshDaemon :
Started Gerrit SSHD on *:29418
[2011-10-19 11:26:28,845] INFO org.eclipse.jetty.util.log :
jetty-7.2.1.v20101111
[2011-10-19 11:26:29,239] WARN org.eclipse.jetty.util.log : FAILED
SelectChann...@0.0.0.0:80: java.net.SocketException:
Permission denied
[2011-10-19 11:26:29,239] WARN org.eclipse.jetty.util.log : FAILED
org.eclipse.jetty.server.Server@58c3d9ac: java.net.SocketException:
Permission denied
[2011-10-19 11:26:29,239] ERROR com.google.gerrit.pgm.Daemon : Unable
to start daemon
java.lang.IllegalStateException: Cannot start HTTP daemon
at com.google.gerrit.pgm.http.jetty.JettyServer
$Lifecycle.start(JettyServer.java:85)
at
com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:
61)
at com.google.gerrit.pgm.Daemon.run(Daemon.java:140)
at
com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:
76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:
155)
at
com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:
89)
at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:
47)
at Main.main(Main.java:25)
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind(Native Method)
at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:
126)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at
org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:
196)
at
org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:
362)
at
org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:
274)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
55)
at org.eclipse.jetty.server.Server.doStart(Server.java:254)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:
55)
at com.google.gerrit.pgm.http.jetty.JettyServer
$Lifecycle.start(JettyServer.java:83)
... 11 more
[2011-10-19 11:28:27,696] INFO
com.google.gerrit.server.git.PushReplication : Empty /home/gerrit2/
review_site/etc/replication.config; not replicating
[2011-10-19 11:28:35,470] WARN com.google.gerrit.sshd.SshDaemon :
Disabling cipher aes192-cbc: Illegal key size; try installing
unlimited cryptography extension
[2011-10-19 11:28:35,470] WARN com.google.gerrit.sshd.SshDaemon :
Disabling cipher aes256-cbc: Illegal key size; try installing
unlimited cryptography extension
[2011-10-19 11:28:35,490] WARN com.google.gerrit.httpd.GitWebConfig :
gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2011-10-19 11:28:35,985] INFO
com.google.gerrit.server.cache.CachePool : Enabling disk cache /home/
gerrit2/review_site/cache
[2011-10-19 11:28:36,122] INFO com.google.gerrit.sshd.SshDaemon :
Started Gerrit SSHD on *:29418
[2011-10-19 11:28:36,123] INFO org.eclipse.jetty.util.log :
jetty-7.2.1.v20101111
[2011-10-19 11:28:36,516] INFO org.eclipse.jetty.util.log : Started
SelectChann...@0.0.0.0:8080
[2011-10-19 11:28:36,518] INFO com.google.gerrit.pgm.Daemon : Gerrit
Code Review 2.2.1 ready

Olivier Croquette

unread,
Oct 19, 2011, 2:57:49 PM10/19/11
to bomjose, Repo and Gerrit Discussion

On 19 oct. 2011, at 20:46, bomjose wrote:

> When i initialize gerrit with "Listen on Port : 80" then it fails in
> with error

Port 80 requires root rights.

Deniz Türkoglu

unread,
Oct 19, 2011, 3:07:35 PM10/19/11
to Olivier Croquette, bomjose, Repo and Gerrit Discussion
Have a look at authbind

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

bomjose

unread,
Oct 20, 2011, 8:31:07 PM10/20/11
to Repo and Gerrit Discussion
when i initialized Gerrit as root then it is working fine and letting
me use port 80.
While initializing use

*** Container Process
***

Run as [root]:

and it worked. fine.

Thank you.

On Oct 19, 12:07 pm, Deniz Türkoglu <de...@spotify.com> wrote:
> On Wednesday, October 19, 2011, Olivier Croquette <ocroque...@free.fr>

Matthias Sohn

unread,
Oct 21, 2011, 3:19:30 AM10/21/11
to bomjose, Repo and Gerrit Discussion
2011/10/21 bomjose <pra...@sta.samsung.com>

when i initialized Gerrit as root then it is working fine and letting
me use port 80.
While initializing use

*** Container Process
***

Run as                         [root]:

and it worked. fine.

but this is not recommended as then the application has full root privileges
which I would consider a security problem
 
--
Matthias

Migratefish

unread,
May 29, 2012, 10:00:30 PM5/29/12
to repo-d...@googlegroups.com
   Anyone once met such a problem: When I want to install gerrit in server, I use following command:

[ro...@db-testing-dtsfs07.db01.baidu.com gerrit2]# sudo /usr/java/jdk1.6.0_22/bin/java -jar /home/gerrit2/software/gerrit-2.2.2.1.war init --batch -d /home/gerrit2/work_site

Generating SSH host key ... rsa(simple)... done

Initialized /home/gerrit2/work_site

Executing /home/gerrit2/work_site/bin/gerrit.sh start

Starting Gerrit Code Review: FAILED

error: cannot start Gerrit: exit status 1.

Some boys said if gerrit would be installed on port 8080, it should use sudo rights to do.  Here I do install it by root. Why such problem still exists? Would it be caused by installed inX86_64 Red hat. The following is error logs. Thank you very much.

[2012-05-29 20:17:34,985] INFO  com.google.gerrit.server.git.PushReplication : Empty /home/gerrit2/work_site/etc/replication.config; not replicating
[2012-05-29 20:17:35,902] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Illegal key size; try installing unlimited cryptography extension
[2012-05-29 20:17:35,903] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Illegal key size; try installing unlimited cryptography extension
[2012-05-29 20:17:35,928] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2012-05-29 20:17:36,663] INFO  com.google.gerrit.server.cache.CachePool : Enabling disk cache /home/gerrit2/work_site/cache
[2012-05-29 20:17:36,833] ERROR org.apache.minled to create a new instance of org.apache.mina.transport.socket.nio.NioProcessor:nulla.core.service.SimpleIoProcessorPool : Failed to create a new instance of org.apache.mina.transport.socket.nio.NioProcessor:null
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.apache.mina.core.service.SimpleIoProcessorPool.<init>(SimpleIoProcessorPool.java:180)
        at org.apache.mina.core.service.SimpleIoProcessorPool.<init>(SimpleIoProcessorPool.java:112)
        at org.apache.mina.core.polling.AbstractPollingIoAcceptor.<init>(AbstractPollingIoAcceptor.java:105)
        at org.apache.mina.transport.socket.nio.NioSocketAcceptor.<init>(NioSocketAcceptor.java:66)
        at org.apache.sshd.SshServer.createAcceptor(SshServer.java:369)
        at com.google.gerrit.sshd.SshDaemon.start(SshDaemon.java:222)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:61)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:141)


        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:76)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:165)


        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:89)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:47)
        at Main.main(Main.java:25)

Caused by: java.lang.InternalError: unable to get address of epoll functions, pre-2.6 kernel?
        at sun.nio.ch.EPollArrayWrapper.init(Native Method)
        at sun.nio.ch.EPollArrayWrapper.<clinit>(EPollArrayWrapper.java:272)
        at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:52)
        at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:18)
        at java.nio.channels.Selector.open(Selector.java:209)
        at org.apache.mina.transport.socket.nio.NioProcessor.<init>(NioProcessor.java:57)
        ... 21 more
[2012-05-29 20:17:36,835] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.NullPointerException
        at org.apache.mina.core.service.SimpleIoProcessorPool.dispose(SimpleIoProcessorPool.java:289)
        at org.apache.mina.core.service.SimpleIoProcessorPool.<init>(SimpleIoProcessorPool.java:229)
        at org.apache.mina.core.service.SimpleIoProcessorPool.<init>(SimpleIoProcessorPool.java:112)
        at org.apache.mina.core.polling.AbstractPollingIoAcceptor.<init>(AbstractPollingIoAcceptor.java:105)
        at org.apache.mina.transport.socket.nio.NioSocketAcceptor.<init>(NioSocketAcceptor.java:66)
        at org.apache.sshd.SshServer.createAcceptor(SshServer.java:369)
        at com.google.gerrit.sshd.SshDaemon.start(SshDaemon.java:222)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:61)
        at com.google.gerrit.pgm.Daemon.run(Daemon.java:141)


        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:76)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)

        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:165)


        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:89)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:47)
        at Main.main(Main.java:25)

  



在 2011年10月20日星期四UTC+8上午2时46分03秒,bomjose写道:
在 2011年10月20日星期四UTC+8上午2时46分03秒,bomjose写道:
在 2011年10月20日星期四UTC+8上午2时46分03秒,bomjose写道:
在 2011年10月20日星期四UTC+8上午2时46分03秒,bomjose写道:

Shawn Pearce

unread,
May 29, 2012, 10:11:20 PM5/29/12
to Migratefish, repo-d...@googlegroups.com
On Tue, May 29, 2012 at 7:00 PM, Migratefish <migrate...@gmail.com> wrote:
>    Anyone once met such a problem: When I want to install gerrit in server,
> I use following command:
...
> Caused by: java.lang.InternalError: unable to get address of epoll
> functions, pre-2.6 kernel?

What version of the Linux kernel are you running? It seems the JVM you
are using is not happy with the operating system kernel.

Migratefish

unread,
May 29, 2012, 10:59:30 PM5/29/12
to repo-d...@googlegroups.com, Migratefish
Thanks Shawn, the system and cpu information is following :
[ro...@db-testing-dtsfs07.db01.baidu.com work_site]# uname -a
Linux db-testing-dtsfs07.db01.baidu.com 2.6.9_5-4-0-5-fs12 #2 SMP Mon Dec 22 08:37:04 CST 2008 x86_64 x86_64 x86_64 GNU/Linux

This server install Gij,I don't want to crush with it. so I use sudo /usr/java/ jdk1.6.0_22/bin/java -jar /home/gerrit2/software/gerrit-2.2.2.1.war init --batch -d  /home/gerrit2/work_site ... I want to install JDK 1.6 to try again.


在 2012年5月30日星期三UTC+8上午10时11分20秒,Shawn Pearce写道:

Migratefish

unread,
May 30, 2012, 2:01:25 AM5/30/12
to repo-d...@googlegroups.com, Migratefish
Hi, I know why such problem appears.  Because my server's network to internet is disconnected. So when install gerrit , it needs to download Bouncy Csstle Crypto, So it could be installed successfully. Thanks again.  By the way, dose there exist any way to install gerrit without internet?

在 2012年5月30日星期三UTC+8上午10时11分20秒,Shawn Pearce写道:

Lloyd Chang

unread,
May 30, 2012, 3:32:30 PM5/30/12
to Migratefish, Shawn Pearce, repo-d...@googlegroups.com
PS: I meant to write Shawn (and not Sean; sorry about that)...

On Wed, May 30, 2012 at 12:30 PM, Lloyd Chang <lloyd...@gmail.com> wrote:
Hi Migratefish and Sean,

Migratefish, if you're install offline / without the Internet, you'd want to cache Maven repositories locally first. Maven repository for Gerrit Code Review's at http://code.google.com/p/gerrit-maven-repository/source/checkout

It doesn't seem to have BouncyCastle, so you'd have to download it from http://repo2.maven.org/maven2/org/bouncycastle/

If you'd like an introduction about Maven Repositories and caching, see http://maven.apache.org/guides/introduction/introduction-to-repositories.html

Sean may be able to better explain the relationship between your installation experience with Gerrit and BouncyCastle, and expectations you should have in using Maven repository for Gerrit.

I hope above information helps!

Cheers,
Lloyd

--

Lloyd Chang

unread,
May 30, 2012, 3:30:55 PM5/30/12
to Migratefish, Shawn Pearce, repo-d...@googlegroups.com
Hi Migratefish and Sean,

Migratefish, if you're install offline / without the Internet, you'd want to cache Maven repositories locally first. Maven repository for Gerrit Code Review's at http://code.google.com/p/gerrit-maven-repository/source/checkout

It doesn't seem to have BouncyCastle, so you'd have to download it from http://repo2.maven.org/maven2/org/bouncycastle/

If you'd like an introduction about Maven Repositories and caching, see http://maven.apache.org/guides/introduction/introduction-to-repositories.html

Sean may be able to better explain the relationship between your installation experience with Gerrit and BouncyCastle, and expectations you should have in using Maven repository for Gerrit.

I hope above information helps!

Cheers,
Lloyd

On Tue, May 29, 2012 at 11:01 PM, Migratefish <migrate...@gmail.com> wrote:
--

Thomas Broyer

unread,
May 31, 2012, 3:43:07 AM5/31/12
to repo-d...@googlegroups.com, Migratefish

On Wednesday, May 30, 2012 8:01:25 AM UTC+2, Migratefish wrote:
Hi, I know why such problem appears.  Because my server's network to internet is disconnected. So when install gerrit , it needs to download Bouncy Csstle Crypto, So it could be installed successfully. Thanks again.  By the way, dose there exist any way to install gerrit without internet?

If the JARs (bouncycastle, and possibly the mysql jdbc driver) are already in the $site_path/lib, then Gerrit shouldn't download them, and therefore shouldn't need Internet access.

Migratefish

unread,
Jun 1, 2012, 4:00:17 AM6/1/12
to repo-d...@googlegroups.com, Migratefish
Hi ,Thanks. You are right. It could be installed without internet.  The real reason for failure is our linux is too old to support
sun.nio.ch.ePollSelectorProvider  . So when using command java, you should add   -Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider  as parameter.  By the way, you should replace the line   RUN_ARGS="-jar $GERRIT_WAR daemon -d $GERRIT_SITE" in $site_path/bin/gerrit.sh from
RUN_ARGS="-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.PollSelectorProvider -jar $GERRIT_WAR daemon -d $GERRIT_SITE" .

   Thanks all our you again.
 
在 2012年5月31日星期四UTC+8下午3时43分07秒,Thomas Broyer写道:

Dave Castagna (Motorola Mobility)

unread,
Apr 8, 2014, 9:48:49 AM4/8/14
to repo-d...@googlegroups.com
I was having this same issue with a test server.

Turns out we did this:

1) Gerrit is started/stopped as root already.  But in the gerrit.config we have:

container.user = {a non-root account name}
 
     which is the local account we use for Gerrit operations - note it is not "root".

2) In gerrit.config we also have:

httpd.listenUrl = http://*:8081/

     You can use 8080 if you want - or any other port higher than 1024.

3) In:

/etc/httpd/conf/extra/httpd-vhosts.conf

    we have a "<VirtualHost *:80>" block which contains these items (among other things):

ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://127.0.0.1:8081/ nocanon


This seems to take care of the problem.

The httpd and GerritCodeReview processes can now start as different users.

SelectChannelCon nector@ 0.0. 0.0:80: java.net.SocketException:
SelectCh annelConnector@ 0.0. 0.0:8080
Reply all
Reply to author
Forward
0 new messages