failed to initialize gerrit 2.12.2

1,047 views
Skip to first unread message

Jiri Tomek

unread,
May 31, 2016, 2:50:56 AM5/31/16
to Repo and Gerrit Discussion
Hi,

I just stopped Gerrit running version 2.12-711-g6e1b2aa, created new mysql database and want to initialize stable version 2.12.2 but the initialization fails with the error below. Could anyone give me a hint what could be wrong? I'll appreciate any help.


Exception in thread "main" com.google.gwtorm.server.OrmException: Cannot initialize schema
    at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:102)
    at com.google.gerrit.pgm.init.BaseInit$SiteRun.upgradeSchema(BaseInit.java:341)
    at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:127)
    at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
    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:159)
    at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:100)
    at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:56)
    at Main.main(Main.java:25)
Caused by: java.io.IOException: Cannot update refs/meta/config in /srv/gerrit/repositories/All-Projects.git: LOCK_FAILURE
    at com.google.gerrit.server.git.VersionedMetaData$1.updateRef(VersionedMetaData.java:396)
    at com.google.gerrit.server.git.VersionedMetaData$1.createRef(VersionedMetaData.java:311)
    at com.google.gerrit.server.git.VersionedMetaData.commitToNewRef(VersionedMetaData.java:193)
    at com.google.gerrit.server.schema.AllProjectsCreator.initAllProjects(AllProjectsCreator.java:178)
    at com.google.gerrit.server.schema.AllProjectsCreator.create(AllProjectsCreator.java:100)
    at com.google.gerrit.server.schema.SchemaCreator.create(SchemaCreator.java:89)
    at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:100)
    ... 11 more



Best regards,
Jiri

David Pursehouse

unread,
May 31, 2016, 2:57:11 AM5/31/16
to Jiri Tomek, Repo and Gerrit Discussion
On Tue, May 31, 2016 at 3:50 PM Jiri Tomek <jiri...@gmail.com> wrote:
Hi,

I just stopped Gerrit running version 2.12-711-g6e1b2aa, created new mysql database

You mean you've created a completely new database and intend to re-initialize the site from new?
 
and want to initialize stable version 2.12.2 but the initialization fails with the error below. Could anyone give me a hint what could be wrong? I'll appreciate any help.

I suspect it's trying to create the initial config but fails because All-Projects already exists and contains the settings from the previous installation.

 



Exception in thread "main" com.google.gwtorm.server.OrmException: Cannot initialize schema
    at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:102)
    at com.google.gerrit.pgm.init.BaseInit$SiteRun.upgradeSchema(BaseInit.java:341)
    at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:127)
    at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
    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:159)
    at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:100)
    at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:56)
    at Main.main(Main.java:25)
Caused by: java.io.IOException: Cannot update refs/meta/config in /srv/gerrit/repositories/All-Projects.git: LOCK_FAILURE
    at com.google.gerrit.server.git.VersionedMetaData$1.updateRef(VersionedMetaData.java:396)
    at com.google.gerrit.server.git.VersionedMetaData$1.createRef(VersionedMetaData.java:311)
    at com.google.gerrit.server.git.VersionedMetaData.commitToNewRef(VersionedMetaData.java:193)
    at com.google.gerrit.server.schema.AllProjectsCreator.initAllProjects(AllProjectsCreator.java:178)
    at com.google.gerrit.server.schema.AllProjectsCreator.create(AllProjectsCreator.java:100)
    at com.google.gerrit.server.schema.SchemaCreator.create(SchemaCreator.java:89)
    at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:100)
    ... 11 more



Best regards,
Jiri

--
--
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.

Jiri Tomek

unread,
May 31, 2016, 3:02:24 AM5/31/16
to Repo and Gerrit Discussion, jiri...@gmail.com
yes that is what I want to do, create a fresh instance. So I need to get rid of the All-Projects? How should I do that?

Matthias Sohn

unread,
May 31, 2016, 3:09:34 AM5/31/16
to Jiri Tomek, Repo and Gerrit Discussion
you are trying to downgrade from some master version to v2.12.2 and schema version changed
from 115 to 116 between these two versions.

AFAIK downgrade across different schema versions isn't supported

-Matthias 

David Pursehouse

unread,
May 31, 2016, 3:09:54 AM5/31/16
to Jiri Tomek, Repo and Gerrit Discussion
On Tue, May 31, 2016 at 4:02 PM Jiri Tomek <jiri...@gmail.com> wrote:
yes that is what I want to do, create a fresh instance. So I need to get rid of the All-Projects? How should I do that?

Just delete it from the git/ folder of the site.

Ideally though, you'd create the new site in a completely new directory.  There may be other stuff still in the old one that will cause glitches.

Jiri Tomek

unread,
May 31, 2016, 3:57:15 AM5/31/16
to Repo and Gerrit Discussion, jiri...@gmail.com
OK, I created new site_data dir and copied from the old one etc/gerrit.config and secure.config, then I run init, successfully finished it, then when stated daemon I had to reindex. Then started daemon again and wanted to sign in using web interface but it failed with

Authentication unavailable at this time.

and there was another error in the log:

[HTTP-63] ERROR com.google.gerrit.httpd.auth.ldap.LdapLoginServlet : LDAP authentication failed
java.util.NoSuchElementException
        at java.util.ArrayList$Itr.next(ArrayList.java:834)
        at com.google.gerrit.server.account.AccountManager.create(AccountManager.java:253)
        at com.google.gerrit.server.account.AccountManager.authenticate(AccountManager.java:114)
        at com.google.gerrit.httpd.auth.ldap.LdapLoginServlet.doPost(LdapLoginServlet.java:125)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:287)
        at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:277)
        at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:182)
        at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:85)
        at com.google.gerrit.httpd.GetUserFilter.doFilter(GetUserFilter.java:82)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.java:73)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RunAsFilter.doFilter(RunAsFilter.java:117)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy$1.doFilter(AllRequestFilter.java:136)
        at com.google.gerrit.httpd.AllRequestFilter$FilterProxy.doFilter(AllRequestFilter.java:138)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.gerrit.httpd.RequestContextFilter.doFilter(RequestContextFilter.java:75)
        at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:82)
        at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:119)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:133)
        at com.google.inject.servlet.GuiceFilter$1.call(GuiceFilter.java:130)
        at com.google.inject.servlet.GuiceFilter$Context.call(GuiceFilter.java:203)
        at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:130)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
        at org.eclipse.jetty.server.Server.handle(Server.java:499)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
        at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
        at java.lang.Thread.run(Thread.java:745)


 

Jiri Tomek

unread,
May 31, 2016, 4:21:05 AM5/31/16
to Repo and Gerrit Discussion, jiri...@gmail.com
I just tried it once more and I was able to log in
Reply all
Reply to author
Forward
0 new messages