My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2311: can not reindex
2 people starred this issue and may be notified of changes. Back to list
Status:  Invalid
Owner:  ----
Closed:  Jul 2014


Sign in to add a comment
 
Project Member Reported by bruce.zu@sonymobile.com, Dec 5, 2013
************************************************************
***** 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:
$ git log --oneline 
acc959d Buck: add build for gerrit-plugin-gwtui
a92ba47 Fix configuration for plugin and extension API artifact deployment

What steps will reproduce the problem?
1. java -jar gerrit/buck-out/gen/gerrit.war  init -d test-site2 //fine
2. start automatically //fine
3. do reindex failed as below: 
$ java -jar gerrit/buck-out/gen/gerrit.war  reindex -d test-site2 
[2013-12-06 15:44:22,939] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 885m
[2013-12-06 15:44:23,095] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/CORPUSERS/28850272/bruce/gerrit/test-site2/cache
Reindexing changes: done    
Reindexed 0 changes in 0.0s (0.0/s)
[2013-12-06 15:44:23,260] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/home/CORPUSERS/28850272/bruce/gerrit/test-site2/cache/diff
org.h2.jdbc.JdbcSQLException: Error opening database: "Sleep interrupted" [8000-173]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
	at org.h2.message.DbException.get(DbException.java:160)
	at org.h2.store.FileLock.getExceptionFatal(FileLock.java:437)
	at org.h2.store.FileLock.sleep(FileLock.java:432)
	at org.h2.store.FileLock.lockFile(FileLock.java:345)
	at org.h2.store.FileLock.lock(FileLock.java:129)
	at org.h2.engine.Database.open(Database.java:568)
	at org.h2.engine.Database.openDatabase(Database.java:226)
	at org.h2.engine.Database.<init>(Database.java:221)
	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:313)
	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:668)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.acquire(H2CacheImpl.java:636)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:382)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:354)
	at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:164)
	at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:109)
	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:744)
Caused by: java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at org.h2.store.FileLock.sleep(FileLock.java:430)
	... 23 more
[2013-12-06 15:44:23,262] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 1 disk cache updates
28850272@cnbjlx11408:~/bruce/gerrit$ 
What is the expected output? What do you see instead?


Please provide any additional information below.

Dec 6, 2013
Project Member #1 edwin.ke...@gmail.com
I guess you can workaround this by deleting the cache of your site (/home/CORPUSERS/28850272/bruce/gerrit/test-site2/cache).
Dec 6, 2013
Project Member #2 bruce.zu@sonymobile.com
Thanks giving suggestion!

deleting the cache cannot fixed it. 
" Error opening database: "Sleep interrupted" [8000-173]"still there


Dec 6, 2013
Project Member #3 bruce.zu@sonymobile.com
check the index and find 
$ tree
.
├── changes_0004
│   ├── closed
│   │   ├── segments_5
│   │   └── segments.gen
│   └── open
│       ├── segments_5
│       └── segments.gen
└── gerrit_index.config

3 directories, 5 files
$ cat gerrit_index.config 
[index "4"]
	ready = true
28850272@cnbjlx11408:~/bruce/gerrit/2013/index$ 

Dec 6, 2013
Project Member #4 david.pu...@sonymobile.com
If this is just a test site, you can fix it by deleting the entire index folder.
Dec 6, 2013
#5 dborowitz@google.com
I think that warning is spurious. I haven't investigated too deeply but I think H2 does something like start a thread that sleeps for 250ms as the first thing it does. So if you open and then close the db within 250ms, as will happen when you have 0 changes to index, it interrupts that thread and gives you this error.

If you see:
  Reindexed X changes in A.Bs (C.D/s)
then it should have completed successfully.

Have you tried running the daemon after this? Does it show the index is corrupt or incomplete in some way?
Dec 8, 2013
Project Member #6 bruce.zu@sonymobile.com
I create a completely new gerrit.war with gerrit version 2.8-10-geadd369
then do init as below and want test  reindex again 
but I find  the INIT does not create All_Project now 

$ java -jar  gerrit/buck-out/gen/gerrit.war init -d ./2014

*** Gerrit Code Review 2.8-10-geadd369
*** 


*** Git Repositories
*** 

Location of Git repositories   [git]: 

*** SQL Database
*** 

Database server type           [h2]: ?
       Supported options are:
         h2
         jdbc
         mysql
         oracle
         postgresql
Database server type           [h2]: postgresql
Server hostname                [localhost]: 
Server port                    [(postgresql default)]: 
Database name                  [reviewdb]: test
Database username              [28850272]: postgres
postgres's password            : 
              confirm password : 

*** User Authentication
*** 

Authentication method          [OPENID/?]: ?
       Supported options are:
         openid
         openid_sso
         http
         http_ldap
         client_ssl_cert_ldap
         ldap
         ldap_bind
         custom_extension
         development_become_any_account
Authentication method          [OPENID/?]: development_become_any_account

*** Email Delivery
*** 

SMTP server hostname           [localhost]: 
SMTP server port               [(default)]: 
SMTP encryption                [NONE/?]: 
SMTP username                  : 

*** Container Process
*** 

Run as                         [28850272]: 
Java runtime                   [/usr/lib/jvm/jdk1.7.0/jre]: 
Upgrade /home/CORPUSERS/28850272/bruce/gerrit/./2014/bin/gerrit.war [Y/n]? 
Copying gerrit.war to /home/CORPUSERS/28850272/bruce/gerrit/./2014/bin/gerrit.war

*** SSH Daemon
*** 

Listen on address              [*]: 
Listen on port                 [29418]: 

Gerrit Code Review is not shipped with Bouncy Castle Crypto v144
  If available, Gerrit can take advantage of features
  in the library, but will also function without it.
Download and install it now [Y/n]? 
Downloading http://www.bouncycastle.org/download/bcprov-jdk16-144.jar ...

 OK
Checksum bcprov-jdk16-144.jar OK
Generating SSH host key ... rsa... dsa... done

*** HTTP Daemon
*** 

Behind reverse proxy           [y/N]? Use SSL (https://             [y/N]? Listen on address              [*]: 
Listen on port                 [8080]: 
Canonical URL                  [http://cnbjlx11408.corpusers.net:8080/]: 

*** Plugins
*** 

No plugins found.
Initialized /home/CORPUSERS/28850272/bruce/gerrit/2014
$ ls 2014/git/
$ 

Dec 9, 2013
Project Member #7 bruce.zu@sonymobile.com
it is turned out that just as Dave said, this issue of "org.h2.jdbc.JdbcSQLException: Error opening database: "Sleep interrupted" [8000-173]" will happen when there is not any change in DB, I create a commit locally and push it for review, then enable index (LUCENE) do init and reindex again.  all is fine. 

the other issue of cannot create All_Project: find I will run into it if I init a new site but still using an old DB (h2 or postgresql).   
Dec 9, 2013
Project Member #8 bruce.zu@sonymobile.com
"Sleep interrupted" should be wrapped and report user with some words like "there is no any change in DB, and need not reindex" 

 
Dec 9, 2013
Project Member #9 david.pu...@sonymobile.com
> Error opening database: "Sleep interrupted" [8000-173]" will happen when there is not any change in DB

I just tested the reindex with a completely new site, with no changes in the database, and did not see this error.

> Reindexing changes: done    
> Reindexed 0 changes in 0.0s (0.0/s)


Dec 9, 2013
Project Member #10 bruce.zu@sonymobile.com
I test again as below,  and found when the war is dirty the issue will appear and can be fixed by push a change for review. as below


  

xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war init  -d ../zuyun

*** Gerrit Code Review 2.8-689-gd7f80ca-dirty
*** 

Create '/home/xing-yi/gerrit-code/google/zuyun' [Y/n]? 

*** Git Repositories
*** 

Location of Git repositories   [git]: 

*** SQL Database
*** 

Database server type           [h2]: ?
       Supported options are:
         h2
         jdbc
         mysql
         oracle
         postgresql
Database server type           [h2]:  postgresql
Server hostname                [localhost]: 
Server port                    [(postgresql default)]: 
Database name                  [reviewdb]: zuyun
Database username              [xing-yi]: postgres
postgres's password            : 
              confirm password : 

*** Index
*** 

Type                           [LUCENE/?]: 

*** User Authentication
*** 

Authentication method          [OPENID/?]: ?
       Supported options are:
         openid
         openid_sso
         http
         http_ldap
         client_ssl_cert_ldap
         ldap
         ldap_bind
         custom_extension
         development_become_any_account
Authentication method          [OPENID/?]: development_become_any_account

*** Email Delivery
*** 

SMTP server hostname           [localhost]: 
SMTP server port               [(default)]: 
SMTP encryption                [NONE/?]: 
SMTP username                  : 

*** Container Process
*** 

Run as                         [xing-yi]: 
Java runtime                   [/usr/lib/jvm/jdk1.7.0_21/jre]: 
Copy gerrit.war to /home/xing-yi/gerrit-code/google/gerrit/../zuyun/bin/gerrit.war [Y/n]? 
Copying gerrit.war to /home/xing-yi/gerrit-code/google/gerrit/../zuyun/bin/gerrit.war

*** SSH Daemon
*** 

Listen on address              [*]: 
Listen on port                 [29418]: 

Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v149
  If available, Gerrit can take advantage of features
  in the library, but will also function without it.
Download and install it now [Y/n]? 
Downloading http://www.bouncycastle.org/download/bcpkix-jdk15on-149.jar ...
 OK
Checksum bcpkix-jdk15on-149.jar OK

Gerrit Code Review is not shipped with Bouncy Castle Crypto Provider v149
** This library is required by Bouncy Castle Crypto SSL v149. **
Download and install it now [Y/n]? Downloading http://www.bouncycastle.org/download/bcprov-jdk15on-149.jar ...
 OK
Checksum bcprov-jdk15on-149.jar OK
Generating SSH host key ... rsa... dsa... done

*** HTTP Daemon
*** 

Behind reverse proxy           [y/N]? Use SSL (https://             [y/N]? 
Listen on address              [*]: 
Listen on port                 [8080]: 
Canonical URL                  [http://localhost:8080/ 

*** Plugins
*** 

No plugins found.
Initialized /home/xing-yi/gerrit-code/google/zuyun
Executing /home/xing-yi/gerrit-code/google/gerrit/../zuyun/bin/gerrit.sh start
Starting Gerrit Code Review: OK
Waiting for server on localhost:8080 ... OK
Opening http://localhost:8080/#/admin/projects/ ...OK
xing-yi@V:~/gerrit-code/google/gerrit$ ../zuyun/bin/gerrit.sh stop
Stopping Gerrit Code Review: OK
xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war reindex  -d ../zuyun
[2013-12-09 22:58:47,713] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 22:58:47,947] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
Reindexing changes: done    
Reindexed 0 changes in 0.0s (0.0/s)
[2013-12-09 22:58:48,339] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/home/xing-yi/gerrit-code/google/zuyun/cache/diff
org.h2.jdbc.JdbcSQLException: Error opening database: "Sleep interrupted" [8000-173]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
	at org.h2.message.DbException.get(DbException.java:160)
	at org.h2.store.FileLock.getExceptionFatal(FileLock.java:437)
	at org.h2.store.FileLock.sleep(FileLock.java:432)
	at org.h2.store.FileLock.lockFile(FileLock.java:345)
	at org.h2.store.FileLock.lock(FileLock.java:129)
	at org.h2.engine.Database.open(Database.java:568)
	at org.h2.engine.Database.openDatabase(Database.java:226)
	at org.h2.engine.Database.<init>(Database.java:221)
	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:313)
	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:668)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.acquire(H2CacheImpl.java:636)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:382)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:354)
	at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:164)
	at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:109)
	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:722)
Caused by: java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at org.h2.store.FileLock.sleep(FileLock.java:430)
	... 23 more
[2013-12-09 22:58:48,347] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 1 disk cache updates
xing-yi@V:~/gerrit-code/google/gerrit$ ../zuyun/bin/gerrit.sh start
Starting Gerrit Code Review: OK
xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war daemon --console-log  -d ../zuyun
[2013-12-09 23:00:04,653] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
[2013-12-09 23:00:05,659] WARN  com.google.gerrit.server.documentation.QueryDocumentationExecutor : No index available
[2013-12-09 23:00:08,196] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:00:08,197] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:00:08,239] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2013-12-09 23:00:08,985] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 23:00:09,033] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/xing-yi/gerrit-code/google/gerrit/../zuyun/plugins
[2013-12-09 23:00:10,306] 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@/home/xing-yi/gerrit-code/google/zuyun/index/changes_0005/open/write.lock
  at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:162)
  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.$Proxy95.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:285)
	at com.google.gerrit.pgm.Daemon.run(Daemon.java:197)
	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:601)
	at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:172)
	at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:96)
	at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:53)
	at Main.main(Main.java:25)
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/home/xing-yi/gerrit-code/google/zuyun/index/changes_0005/open/write.lock
	at org.apache.lucene.store.Lock.obtain(Lock.java:84)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:672)
	at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:62)
	at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:56)
	at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:185)
	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:525)
	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
xing-yi@V:~/gerrit-code/google/gerrit$ ps -ef|grep gerrit
xing-yi  13360     1 26 22:59 ?        00:00:16 GerritCodeReview -jar /home/xing-yi/gerrit-code/google/zuyun/bin/gerrit.war daemon -d /home/xing-yi/gerrit-code/google/zuyun --run-id=1386601163.13334
xing-yi  13467 10811  0 23:00 pts/1    00:00:00 grep --color=auto gerrit
xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war version
gerrit version 2.8-689-gd7f80ca-dirty
//register the first account (admin)
//create the thirst project with an initial commit
xing-yi@V:~/gerrit-code/google/local$ git clone ssh://bruce.zu@localhost:29418/path/to/zu
Cloning into 'zu'...
The authenticity of host '[localhost]:29418 ([127.0.0.1]:29418)' can't be established.
RSA key fingerprint is 43:5f:84:3e:c9:de:cc:d7:34:50:60:96:63:0a:1a:f4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[localhost]:29418' (RSA) to the list of known hosts.
remote: Counting objects: 2, done
remote: Finding sources: 100% (2/2)
remote: Total 2 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (2/2), done.
xing-yi@V:~/gerrit-code/google/local$ cd zu/
xing-yi@V:~/gerrit-code/google/local/zu$ echo the-first-commit > test.txt 
xing-yi@V:~/gerrit-code/google/local/zu$ git add . ; git commit -m "the fist commit"
[master 9756d09] the fist commit
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
xing-yi@V:~/gerrit-code/google/local/zu$ git push origin HEAD:refs/for/master
Counting objects: 4, done.
Writing objects: 100% (3/3), 265 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done    
remote: ERROR: missing Change-Id in commit message footer
remote: Suggestion for commit message:
remote: the fist commit
remote: 
remote: Change-Id: I9756d093d2aefbabd86fce09e389a18fb7437913
remote: 
remote: Hint: To automatically insert Change-Id, install the hook:
remote:   gitdir=$(git rev-parse --git-dir); scp -p -P 29418 bruce.zu@localhost:hooks/commit-msg ${gitdir}/hooks/
remote: 
remote: 
To ssh://bruce.zu@localhost:29418/path/to/zu
 ! [remote rejected] HEAD -> refs/for/master (missing Change-Id in commit message footer)
error: failed to push some refs to 'ssh://bruce.zu@localhost:29418/path/to/zu'
xing-yi@V:~/gerrit-code/google/local/zu$ gitdir=$(git rev-parse --git-dir); scp -p -P 29418 bruce.zu@localhost:hooks/commit-msg ${gitdir}/hooks/
commit-msg                                                                                            100% 4382     4.3KB/s   00:00    
xing-yi@V:~/gerrit-code/google/local/zu$ remote: 
remote:: command not found
xing-yi@V:~/gerrit-code/google/local/zu$ git commit --amend 
[master 50730d3] the fist commit
 1 file changed, 1 insertion(+)
 create mode 100644 test.txt
xing-yi@V:~/gerrit-code/google/local/zu$ git push origin HEAD:refs/for/masterCounting objects: 4, done.
Writing objects: 100% (3/3), 309 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: Processing changes: new: 1, refs: 1, done    
remote: 
remote: New Changes:
remote:   http://localhost:8080/1
remote: 
To ssh://bruce.zu@localhost:29418/path/to/zu
 * [new branch]      HEAD -> refs/for/master
xing-yi@V:~/gerrit-code/google$ ps -ef|grep gerrit
xing-yi  13360     1  2 22:59 ?        00:00:22 GerritCodeReview -jar /home/xing-yi/gerrit-code/google/zuyun/bin/gerrit.war daemon -d /home/xing-yi/gerrit-code/google/zuyun --run-id=1386601163.13334
xing-yi  13681 10811  0 23:12 pts/1    00:00:00 grep --color=auto gerrit
xing-yi@V:~/gerrit-code/google$ kill 13360
xing-yi@V:~/gerrit-code/google$ ps -ef|grep gerrit
xing-yi  13696 10811  0 23:12 pts/1    00:00:00 grep --color=auto gerrit
xing-yi@V:~/gerrit-code/google$ java -jar  gerrit/buck-out/gen/gerrit.war reindex -d ./zuyun
[2013-12-09 23:15:34,483] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 23:15:34,725] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
Collecting projects:    1
Reindexing changes: projects: 100% (1/1), 100% (1/1), done    
Reindexed 1 changes in 0.5s (2.1/s)
[2013-12-09 23:15:35,722] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 1 disk cache updates
xing-yi@V:~/gerrit-code/google$ java -jar  gerrit/buck-out/gen/gerrit.war daemon --console-log  -d ./zuyun
[2013-12-09 23:16:19,643] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
[2013-12-09 23:16:20,688] WARN  com.google.gerrit.server.documentation.QueryDocumentationExecutor : No index available
[2013-12-09 23:16:23,173] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:16:23,173] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:16:23,209] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2013-12-09 23:16:23,948] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 23:16:23,995] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/xing-yi/gerrit-code/google/./zuyun/plugins
[2013-12-09 23:16:24,456] INFO  com.google.gerrit.sshd.SshDaemon : Started Gerrit SSHD-CORE-0.9.0.201311081 on *:29418
[2013-12-09 23:16:24,462] INFO  org.eclipse.jetty.server.Server : jetty-9.0.6.v20130930
[2013-12-09 23:16:25,709] INFO  org.eclipse.jetty.server.handler.ContextHandler : Started o.e.j.s.ServletContextHandler@29a90c7e{/,file:/home/xing-yi/.gerritcodereview/tmp/gerrit_1481432198411915676_app/gerrit_war/,AVAILABLE}
[2013-12-09 23:16:25,715] INFO  org.eclipse.jetty.server.ServerConnector : Started ServerConnector@1796ba3f{HTTP/1.1}{0.0.0.0:8080}
[2013-12-09 23:16:25,725] INFO  com.google.gerrit.pgm.Daemon : Gerrit Code Review 2.8-689-gd7f80ca-dirty ready

// review and get the first change merged . no problem is found 

Dec 9, 2013
#11 dborowitz@google.com
Based on what I said previously, note that the "sleep interrupted" error is nondeterministic. It is _not_ the case that it happens iff there are no changes to index. It happens if there are no changes in the db you are _more likely_ to get this error.

Also, obviously you should not have to push a change for review before running reindex. Bruce, are you finding that it doesn't work unless you push a change for review? Note by "doesn't work" I mean "reindex fails or generate a corrupt index." If you get the "sleep interrupted" error and everything else appears to work, I do not count that as "not working."

I agree we should wrap it but the way this thread is started doesn't make it easy. Maybe we should just Thread.sleep(250) before exiting.
Dec 9, 2013
Project Member #12 bruce.zu@sonymobile.com
past a part from above as the answer to "are you finding that it doesn't work unless you push a change for review?" : run reindex, find this issue, run daemon and find Error, but I can review and merge that change from UI smoothly. I do not know this belongs to  "doesn't work" or not. for reference only. 


xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war reindex  -d ../zuyun
[2013-12-09 22:58:47,713] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 22:58:47,947] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
Reindexing changes: done    
Reindexed 0 changes in 0.0s (0.0/s)
[2013-12-09 22:58:48,339] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/home/xing-yi/gerrit-code/google/zuyun/cache/diff
org.h2.jdbc.JdbcSQLException: Error opening database: "Sleep interrupted" [8000-173]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
	at org.h2.message.DbException.get(DbException.java:160)
	at org.h2.store.FileLock.getExceptionFatal(FileLock.java:437)
	at org.h2.store.FileLock.sleep(FileLock.java:432)
	at org.h2.store.FileLock.lockFile(FileLock.java:345)
	at org.h2.store.FileLock.lock(FileLock.java:129)
	at org.h2.engine.Database.open(Database.java:568)
	at org.h2.engine.Database.openDatabase(Database.java:226)
	at org.h2.engine.Database.<init>(Database.java:221)
	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:313)
	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:668)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.acquire(H2CacheImpl.java:636)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:382)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:354)
	at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:164)
	at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:109)
	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:722)
Caused by: java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at org.h2.store.FileLock.sleep(FileLock.java:430)
	... 23 more
[2013-12-09 22:58:48,347] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 1 disk cache updates
xing-yi@V:~/gerrit-code/google/gerrit$ ../zuyun/bin/gerrit.sh start
Starting Gerrit Code Review: OK
xing-yi@V:~/gerrit-code/google/gerrit$ java -jar buck-out/gen/gerrit.war daemon --console-log  -d ../zuyun
[2013-12-09 23:00:04,653] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/xing-yi/gerrit-code/google/zuyun/cache
[2013-12-09 23:00:05,659] WARN  com.google.gerrit.server.documentation.QueryDocumentationExecutor : No index available
[2013-12-09 23:00:08,196] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes192-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:00:08,197] WARN  com.google.gerrit.sshd.SshDaemon : Disabling cipher aes256-cbc: Illegal key size; try installing unlimited cryptography extension
[2013-12-09 23:00:08,239] WARN  com.google.gerrit.httpd.GitWebConfig : gitweb not installed (no /usr/lib/cgi-bin/gitweb.cgi found)
[2013-12-09 23:00:08,985] INFO  com.google.gerrit.server.git.LocalDiskRepositoryManager : Defaulting core.streamFileThreshold to 215m
[2013-12-09 23:00:09,033] INFO  com.google.gerrit.server.plugins.PluginLoader : Loading plugins from /home/xing-yi/gerrit-code/google/gerrit/../zuyun/plugins
[2013-12-09 23:00:10,306] 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@/home/xing-yi/gerrit-code/google/zuyun/index/changes_0005/open/write.lock
  at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:162)
  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.$Proxy95.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:285)
	at com.google.gerrit.pgm.Daemon.run(Daemon.java:197)
	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:601)
	at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:172)
	at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:96)
	at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:53)
	at Main.main(Main.java:25)
Caused by: org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/home/xing-yi/gerrit-code/google/zuyun/index/changes_0005/open/write.lock
	at org.apache.lucene.store.Lock.obtain(Lock.java:84)
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:672)
	at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:62)
	at com.google.gerrit.lucene.SubIndex.<init>(SubIndex.java:56)
	at com.google.gerrit.lucene.LuceneChangeIndex.<init>(LuceneChangeIndex.java:185)
	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:525)
	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
Dec 9, 2013
Project Member #13 bruce.zu@sonymobile.com
add more for reference:  that dirty war is created only without run "git submodule update  --init --recursive" 
Dec 9, 2013
Project Member #14 bruce.zu@sonymobile.com
still there are other reason to trigger this issue: 

$ java -jar gerrit/buck-out/gen/gerrit.war reindex  -d master-site
[2013-12-10 10:54:55,548] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Enabling disk cache /home/CORPUSERS/28850272/bruce/gerrit/master-site/cache
Reindexing changes: done    
Reindexed 0 changes in 0.0s (0.0/s)
[2013-12-10 10:54:55,723] WARN  com.google.gerrit.server.cache.h2.H2CacheImpl : Cannot build BloomFilter for jdbc:h2:file:/home/CORPUSERS/28850272/bruce/gerrit/master-site/cache/diff
org.h2.jdbc.JdbcSQLException: Error opening database: "Sleep interrupted" [8000-173]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:331)
	at org.h2.message.DbException.get(DbException.java:160)
	at org.h2.store.FileLock.getExceptionFatal(FileLock.java:437)
	at org.h2.store.FileLock.sleep(FileLock.java:432)
	at org.h2.store.FileLock.lockFile(FileLock.java:335)
	at org.h2.store.FileLock.lock(FileLock.java:129)
	at org.h2.engine.Database.open(Database.java:568)
	at org.h2.engine.Database.openDatabase(Database.java:226)
	at org.h2.engine.Database.<init>(Database.java:221)
	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:313)
	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:668)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.acquire(H2CacheImpl.java:636)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.buildBloomFilter(H2CacheImpl.java:382)
	at com.google.gerrit.server.cache.h2.H2CacheImpl$SqlStore.open(H2CacheImpl.java:354)
	at com.google.gerrit.server.cache.h2.H2CacheImpl.start(H2CacheImpl.java:164)
	at com.google.gerrit.server.cache.h2.H2CacheFactory$1.run(H2CacheFactory.java:109)
	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:744)
Caused by: java.lang.InterruptedException: sleep interrupted
	at java.lang.Thread.sleep(Native Method)
	at org.h2.store.FileLock.sleep(FileLock.java:430)
	... 23 more
[2013-12-10 10:54:55,726] INFO  com.google.gerrit.server.cache.h2.H2CacheFactory : Finishing 1 disk cache updates
28850272@cnbjlx11408:~/bruce/gerrit$ java -jar master-site/bin/gerrit.war  version
gerrit version 2.8-704-g36d839d
28850272@cnbjlx11408:~/bruce/gerrit$ 

Dec 10, 2013
Project Member #15 bruce.zu@sonymobile.com
update to latest version on master branch  ahead of https://gerrit-review.googlesource.com/#/c/52450/
all is fine now 
Dec 10, 2013
Project Member #16 bruce.zu@sonymobile.com
wrong paste. it should be https://gerrit-review.googlesource.com/#/c/52812/
Jul 17, 2014
Project Member #17 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Invalid
Sign in to add a comment

Powered by Google Project Hosting