cannot start gerrit after upgrade to 2.9

1,821 views
Skip to first unread message

kongf...@gmail.com

unread,
Aug 8, 2014, 11:37:11 AM8/8/14
to repo-d...@googlegroups.com
Hi,

I was running 2.6.1, and first upgraded to java 1.7

then ran the following:

java -jar gerrit-2.9.war init -d /opt/gerrit

java -jar gerrit-2.9.war reindex --recheck-mergeable -d /opt/gerrit


I then tried to start gerrit and it fails on the following:


[2014-08-08 11:21:31,977] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
com.google.inject.ProvisionException: Guice provision errors:

1) Error injecting constructor, org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock/opt/gerrit/index/changes_0008/open/write.lock: java.io.FileNotFoundException: /opt/gerrit/index/changes_0008/open/write.lock (Permission denied)
  at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:210)
  while locating com.google.gerrit.lucene.LuceneChangeIndex annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=8)

1 error
        at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1014)
        at com.google.inject.assistedinject.FactoryProvider2.invoke(FactoryProvider2.java:665)
        at com.google.gerrit.lucene.$Proxy98.create(Unknown Source)
        at com.google.gerrit.lucene.LuceneVersionManager.start(LuceneVersionManager.java:149)
        at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:74)
        at com.google.gerrit.pgm.Daemon.start(Daemon.java:288)
        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: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock/opt/gerrit/index/changes_0008/open/write.lock: java.io.FileNotFoundException: /opt/gerrit/index/changes_0008/open/write.lock (Permission denied)
        at org.apache.lucene.store.Lock.obtain(Lock.java:84)
        at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:702)
        at com.google.gerrit.lucene.AutoCommitWriter.<init>(AutoCommitWriter.java:34)
        at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:75)
        at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:60)
        at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:240)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock/opt/gerrit/index/changes_0008/open/write.lock: java.io.FileNotFoundException: /opt/gerrit/index/changes_0008/open/write.lock (Permission denied)
        at org.apache.lucene.store.Lock.obtain(Lock.java:84)
        at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:702)
        at com.google.gerrit.lucene.AutoCommitWriter.<init>(AutoCommitWriter.java:34)
        at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:75)
        at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:60)
        at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:240)
        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.InjectorImpl$3$1.call(InjectorImpl.java:1005)
        at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1051)
        at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:1001)
        ... 15 more
Caused by: java.io.FileNotFoundException: /opt/gerrit/index/changes_0008/open/write.lock (Permission denied)
        at java.io.RandomAccessFile.open(Native Method)
        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:241)
        at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:203)
        at org.apache.lucene.store.Lock.obtain(Lock.java:95)
        ... 31 more
[2014-08-08 11:21:32,234] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/opt/gerrit/cache/diff_intraline
org.h2.jdbc.JdbcSQLException: Database is already closed (to disable automatic closing at VM shutdown, add ";DB_CLOSE_ON_EXIT=FALSE" to the db URL) [90121-174]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
        at org.h2.message.DbException.get(DbException.java:172)
        at org.h2.message.DbException.get(DbException.java:149)
        at org.h2.message.DbException.get(DbException.java:138)
        at org.h2.jdbc.JdbcConnection.checkClosed(JdbcConnection.java:1413)
        at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:980)
        at org.h2.jdbc.JdbcStatement.checkClosed(JdbcStatement.java:954)
        at org.h2.jdbc.JdbcResultSet.checkClosed(JdbcResultSet.java:3102)
        at org.h2.jdbc.JdbcResultSet.checkColumnIndex(JdbcResultSet.java:3086)
        at org.h2.jdbc.JdbcResultSet.get(JdbcResultSet.java:3116)
        at org.h2.jdbc.JdbcResultSet.getObject(JdbcResultSet.java:488)



This is using a mysql db, and I made sure to stop and restart gerrit, and reindex again.


If anyone has any ideas that would be great.


Thanks

Bassem Rabil

unread,
Aug 11, 2014, 9:18:57 AM8/11/14
to repo-d...@googlegroups.com
I think you might need to run re-index first using the command:
java -jar gerrit.war reindex <Gerrit Site>

This has been introduced in Gerrit 2.8, and later there is complementary in Gerrit 2.9 for adding the mergability to index:
java -jar gerrit-2.9.war reindex --recheck-mergeable

I hope this helps.

Regards
Bassem

Stephen Baker

unread,
Sep 26, 2014, 12:21:31 PM9/26/14
to repo-d...@googlegroups.com
I'm also running into this.  A reindex doesn't help.

Was any solution found?

Stephen Baker

unread,
Sep 26, 2014, 12:31:29 PM9/26/14
to repo-d...@googlegroups.com
I found a solution to this problem.

chmod -R gerrit2 path/to/gerrit2/index
chgrp -R gerrit2 path/to/gerrit2/index
Reply all
Reply to author
Forward
0 new messages