Issue 2651: gerrit 2.8.5 fails to start
Status:  Submitted
Owner: ----
Closed:  May 2014
Reported by diwakerg...@gmail.com, May 9, 2014
************************************************************
***** 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:

What steps will reproduce the problem?
1. Upgrade from 2.8.4 to 2.8.5
2. Start gerrit

What is the expected output? What do you see instead?

Expect to see gerrit start up. Instead, it fails with:

[2014-05-09 19:48:49,975] ERROR com.google.gerrit.pgm.Daemon : Unable to start daemon
java.lang.NoClassDefFoundError: org/bouncycastle/openssl/PEMParser
        at com.google.gerrit.sshd.HostKeyProvider.get(HostKeyProvider.java:75)
        at com.google.gerrit.sshd.HostKeyProvider.get(HostKeyProvider.java:31)
        at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:86)
        at com.google.inject.internal.BoundProviderFactory.provision(BoundProviderFactory.java:73)
        at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:66)
        at com.google.inject.internal.BoundProviderFactory.get(BoundProviderFactory.java:63)
        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)

Happy to provide a longer stack trace if that helps.

Please provide any additional information below.

Ubuntu 12.04 LTS. JDK 7u51.
May 12, 2014
#1 dan...@gmail.com
I hit this issue as well. I run Gerrit in Tomcat on Fedora 19. On my system Gerrit is using the system bouncycastle library rather than the one it fetches from the Internet (probably I am missing or have removed some classpath manipulation somewhere). There seems to be a few issues at play:

* Fedora 19 currently ships bouncycastle 1.46, but that's too old for Gerrit's sshd now. So I rebuilt bouncycastle-1.50 based on the rawhide package and installed that.

* There is now a separate jar bcpkix.jar in addition to bcprov.jar. There is a corresponding new Fedora package, bouncycastle-pkix-1.50 so I built that based on rawhide and installed it too.

* The system bcpkix.jar still does not end up on the classpath. I couldn't find where bcprov.jar was being added to Tomcat's classpath, but bcpkix.jar needs to be added as well. I added it to common.loader in /etc/tomcat/catalina.properties, it might be a hack but it worked for me.

Another solution would probably be to just make sure that Gerrit's own copy of the bouncycastle libraries are on the classpath instead.
May 12, 2014
Project Member #2 david.pu...@sonymobile.com
In 2.8.5 the bouncycastle version was updated.

When you upgraded from 2.8.4 to 2.8.5 did it prompt you to download the updated bouncycastle SSL and Provider libraries?  I.e.:

  Gerrit Code Review is not shipped with Bouncy Castle Crypto SSL v149
  **  This library is required for your configuration. **
  Download and install it now [Y/n]?

and

 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]?


Status: AwaitingInformation
May 12, 2014
#3 dan...@gmail.com
In my case, the upgrade process *did* prompt me to download them and I did say yes. The problem is that the directory it places the files (lib/ subdir in the Gerrit site directory) is not on the classpath. I'm guessing OP has the same problem.
May 12, 2014
#4 diwakerg...@gmail.com
Actually I was not asked any questions during the upgrade. Note that the release notes did not say anything about a schema upgrade, so I "upgraded" simply by dropping the new war on top of the old and restarting gerrit (as opposed to the usual '-d init <...>').
May 12, 2014
#5 diwakerg...@gmail.com
Confirmed that running with 'init -d' asked me for the download and subsequently gerrit came up fine. Feel free to close/fix as a documentation bug.
May 13, 2014
Project Member #6 david.pu...@sonymobile.com
Updated the release notes.

https://gerrit-review.googlesource.com/#/c/57127/

Status: ChangeUnderReview
May 20, 2014
Project Member #7 david.pu...@sonymobile.com
(No comment was entered for this change.)
Status: Submitted