Re: Gerrit 2.9-rc1 Can't start daemon!

220 views
Skip to first unread message

Shawn Pearce

unread,
Mar 26, 2014, 10:02:45 AM3/26/14
to Saša Živkov, 高志鹏, repo-d...@googlegroups.com
On Wed, Mar 26, 2014 at 4:50 AM, Saša Živkov <ziv...@gmail.com> wrote:
> On Wed, Mar 26, 2014 at 9:22 AM, 高志鹏 <martincz...@gmail.com> wrote:
>>
>> Hi, mate.
>> When I upgrade gerrit version from 2.8.2 to 2.9-rc1 and restart it.
>> Tell me "Starting Gerrit Code Review: FAILED"
>> How can I fix it or downgrade to 2.8.2?
>>
>> Here is error log:
>> [2014-03-26 16:04:23,584] INFO
>> com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache
>> /home/gerrit2/review_site/cache
>> [2014-03-26 16:04:26,458] ERROR com.google.gerrit.pgm.Daemon : Unable to
>> start daemon
>> com.google.inject.CreationException: Guice creation errors:
>>
>> 1) Error injecting constructor, java.lang.IllegalArgumentException
>> at
>> com.google.gerrit.pgm.http.jetty.JettyServer.<init>(JettyServer.java:143)
>> at
>> com.google.gerrit.pgm.http.jetty.JettyModule.configure(JettyModule.java:29)
>> while locating com.google.gerrit.pgm.http.jetty.JettyServer
>>
>> 1 error
>> at
>> com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:448)
>> at
>> com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:184)
>> at
>> com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:110)
>> at
>> com.google.inject.internal.InjectorImpl.createChildInjector(InjectorImpl.java:230)
>> at com.google.gerrit.pgm.Daemon.createHttpdInjector(Daemon.java:434)
>> at com.google.gerrit.pgm.Daemon.initHttpd(Daemon.java:399)
>> at com.google.gerrit.pgm.Daemon.start(Daemon.java:285)
>> at com.google.gerrit.pgm.Daemon.run(Daemon.java:200)
>> at
>> com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:63)
>> 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)
>> Caused by: java.lang.IllegalArgumentException
>> at
>> org.eclipse.jetty.util.BlockingArrayQueue.<init>(BlockingArrayQueue.java:133)
>
>
> Checking the Jetty source code shows that the IllegalArgumentException is
> thrown when
> the capacity is larger maxCapacity:
> public BlockingArrayQueue(int capacity, int growBy, int maxCapacity)
> {
> if (capacity > maxCapacity)
> throw new IllegalArgumentException();
> _elements = new Object[capacity];
> _growCapacity = growBy;
> _maxCapacity = maxCapacity;
> }
>
>
>>
>>
>>
>> at
>> com.google.gerrit.pgm.http.jetty.JettyServer.threadPool(JettyServer.java:328)
>
>
> From gerrit we pass the httpd.minThreads as the capacity and httpd.maxQueued
> as the maxCapacity.
> In your case httpd.minThreads is not defined so the default of 5 is used.
> Since your httpd.maxQueued is 0 you have exactly that error condition.
> So make sure that httpd.minThreads <= httpd.maxQueued.
>
> I am not sure if this is a bug in Gerrit... but if yes then it was
> introduced by 8e78797190ddb9e04f93190bae86fe3956f08b3d
> which is only contained in 2.9-* releases.

This is a bug in the 2.9 branch. Thank you for helping to identify it
before the release.

I uploaded https://gerrit-review.googlesource.com/55561 to fix the bug.

高志鹏

unread,
Mar 26, 2014, 4:22:00 AM3/26/14
to repo-d...@googlegroups.com
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
at com.google.gerrit.pgm.http.jetty.JettyServer.threadPool(JettyServer.java:328)
at com.google.gerrit.pgm.http.jetty.JettyServer.<init>(JettyServer.java:146)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.google.inject.internal.DefaultConstructionProxyFactory$2.newInstance(DefaultConstructionProxyFactory.java:86)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:108)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:88)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:269)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1058)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.Scopes$1$1.get(Scopes.java:65)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:205)
at com.google.inject.internal.InternalInjectorCreator$1.call(InternalInjectorCreator.java:199)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
at com.google.inject.internal.InternalInjectorCreator.loadEagerSingletons(InternalInjectorCreator.java:199)
at com.google.inject.internal.InternalInjectorCreator.injectDynamically(InternalInjectorCreator.java:180)
... 15 more

Gerrit config file:
[gerrit]
basePath = /home/git
canonicalWebUrl = http://xxx.xxx.com
canonicalGitUrl = git://xxx.xxx.com
[database]
type = mysql
hostname = localhost
database = reviewdb
username = gerrit2
url = jdbc:mysql://localhost:3306/reviewdb?characterSetResults=utf8&characterEncoding=utf8&connectionCollation=utf8_general_ci
[auth]
type = OPENID
[sendemail]
smtpServer = xxx.x.xx.com
smtpUser = x...@xxx.com
smtpServierPort = 25
from = x...@xxx.com
[container]
user = gerrit2
javaHome = /usr/lib/jvm/java-7-openjdk-amd64/jre
heapLimit = 8g
[sshd]
listenAddress = *:29418
threads = 100
[httpd]
listenUrl = proxy-http://xxx.xxx.com:8081/
maxThreads = 512
maxQueued = 0
[cache]
directory = cache
[cache "projects"]
memoryLimit = 10m
diskLimit = 10g
[cache "web_sessions"]
memoryLimit = 20m
diskLimit = 10g
[cache "adv_bases"]
memoryLimit = 20m
[cache "diff"]
memoryLimit = 100m
[core]
packedGitOpenFiles = 2048
packedGitLimit = 2g
packedGitWindowSize = 64k
streamFileThreshold = 20g
[gitweb]
cgi = /usr/lib/cgi-bin/gitweb.cgi
[index]
type = LUCENE
[index "changes_open"]
ramBufferSize = 60 m
maxBufferedDocs = 3000
[index "changes_closed"]
ramBufferSize = 20 m
maxBufferedDocs = 500

Saša Živkov

unread,
Mar 26, 2014, 7:50:22 AM3/26/14
to 高志鹏, repo-d...@googlegroups.com
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
On Wed, Mar 26, 2014 at 9:22 AM, 高志鹏 <martincz...@gmail.com> wrote:
Checking the Jetty source code shows that the IllegalArgumentException is thrown when
the capacity is larger maxCapacity:
    public BlockingArrayQueue(int capacity, int growBy, int maxCapacity)
    {
        if (capacity > maxCapacity)
            throw new IllegalArgumentException();
        _elements = new Object[capacity];
        _growCapacity = growBy;
        _maxCapacity = maxCapacity;
    }

 
 
at com.google.gerrit.pgm.http.jetty.JettyServer.threadPool(JettyServer.java:328)

From gerrit we pass the httpd.minThreads as the capacity and httpd.maxQueued as the maxCapacity.
In your case httpd.minThreads is not defined so the default of 5 is used.
Since your httpd.maxQueued is 0 you have exactly that error condition.
So make sure that httpd.minThreads <= httpd.maxQueued.

I am not sure if this is a bug in Gerrit... but if yes then it was introduced by 8e78797190ddb9e04f93190bae86fe3956f08b3d
which is only contained in 2.9-* releases.

Saša

--
--
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 the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages