New issue
Advanced search Search tips

Issue 10082 link

Starred by 6 users

Issue metadata

Status: Released
Owner: ----
Closed: Jan 7
Cc:



Sign in to add a comment

"no active search index configured ..." when a plugin gets any index injected during startup

Reported by bhanwar.sharma@gmail.com, Nov 22

Issue description

This is an issue for PolyGerrit plugin development and API.

Affected plugin(s):
Replication and event log plugin

The issue documented at https://gerrit-
review.googlesource.com/Documentation/pg-plugin-dev.html?
No

What steps will reproduce the problem?
1.Upgraded gerrit from 2.15.3 to 2.16 version.
2.After upgrading gerrit it shows "Error injecting constructor, com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: no active search index configured for groups" in logs
3.Attached logs file for more details.

What is the expected output?


What do you see instead?


Please provide any additional information below.

 
logs.txt
12.4 KB View Download
Please let me know if you need any other information and if there is any workaround for this problem.
Project Member

Comment 2 by thomasmu...@yahoo.com, Nov 22

Components: -PolyGerrit plugins>events-log plugins>replication
Status: AwaitingInformation (was: New)
Please check the version of the events-log plugin.  From the stack trace it looks like you're using a version that is not built for 2.16.

Did you upgrade the plugin when the gerrit server was updated?

The latest build from the plugin master branch should be compatible:

https://gerrit-ci.gerritforge.com/view/Plugins-master/job/plugin-events-log-bazel-master/

The plugin does not yet have a specific stable-2.16 build.
Thanks for prompt response for event log plugin but i am still getting error with replication plugin:

Below are the logs:
[2018-11-23 16:41:43,294] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin hooks, version v2.16
[2018-11-23 16:41:43,501] [main] WARN  com.google.gerrit.server.plugins.PluginLoader : Cannot load plugin replication
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) Error injecting constructor, com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: no active search index configured for groups
  at com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator.<init>(AutoReloadConfigDecorator.java:46)
  at com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator.class(AutoReloadConfigDecorator.java:30)
  while locating com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator
  while locating com.googlesource.gerrit.plugins.replication.ReplicationConfig
    for the 3rd parameter of com.googlesource.gerrit.plugins.replication.ReplicationQueue.<init>(ReplicationQueue.java:82)
  at com.googlesource.gerrit.plugins.replication.ReplicationModule.configure(ReplicationModule.java:38)
  while locating com.googlesource.gerrit.plugins.replication.ReplicationQueue
  while locating com.google.gerrit.extensions.events.LifecycleListener annotated with @com.google.inject.internal.UniqueAnnotations$Internal(value=193)

1 error
	at com.google.inject.internal.InternalProvisionException.toProvisionException(InternalProvisionException.java:226)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1053)
	at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:93)
	at com.google.gerrit.server.plugins.ServerPlugin.startPlugin(ServerPlugin.java:246)
	at com.google.gerrit.server.plugins.ServerPlugin.start(ServerPlugin.java:175)
	at com.google.gerrit.server.plugins.PluginLoader.runPlugin(PluginLoader.java:495)
	at com.google.gerrit.server.plugins.PluginLoader.rescan(PluginLoader.java:423)
	at com.google.gerrit.server.plugins.PluginLoader.start(PluginLoader.java:328)
	at com.google.gerrit.lifecycle.LifecycleManager.start(LifecycleManager.java:95)
	at com.google.gerrit.pgm.Daemon.start(Daemon.java:364)
	at com.google.gerrit.pgm.Daemon.run(Daemon.java:268)
	at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:61)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:226)
	at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:122)
	at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:66)
	at Main.main(Main.java:28)
Caused by: com.google.common.util.concurrent.UncheckedExecutionException: java.lang.NullPointerException: no active search index configured for groups
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2050)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3952)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3974)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4958)
	at com.google.gerrit.server.account.GroupIncludeCacheImpl.parentGroupsOf(GroupIncludeCacheImpl.java:107)
	at com.googlesource.gerrit.plugins.replication.Destination.addRecursiveParents(Destination.java:197)
	at com.googlesource.gerrit.plugins.replication.Destination.<init>(Destination.java:141)
	at com.googlesource.gerrit.plugins.replication.DestinationFactory.create(DestinationFactory.java:72)
	at com.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig.allDestinations(ReplicationFileBasedConfig.java:134)
	at com.googlesource.gerrit.plugins.replication.ReplicationFileBasedConfig.<init>(ReplicationFileBasedConfig.java:61)
	at com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator.loadConfig(AutoReloadConfigDecorator.java:60)
	at com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator.<init>(AutoReloadConfigDecorator.java:50)
	at com.googlesource.gerrit.plugins.replication.AutoReloadConfigDecorator$$FastClassByGuice$$66dab349.newInstance(<generated>)
	at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:114)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
	at com.google.inject.internal.SingleParameterInjector.inject(SingleParameterInjector.java:42)
	at com.google.inject.internal.SingleParameterInjector.getAll(SingleParameterInjector.java:65)
	at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:113)
	at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:91)
	at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:306)
	at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
	at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:168)
	at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:39)
	at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:62)
	at com.google.inject.internal.InjectorImpl$1.get(InjectorImpl.java:1050)
	... 18 more
Caused by: java.lang.NullPointerException: no active search index configured for groups
	at java.util.Objects.requireNonNull(Objects.java:228)
	at com.google.gerrit.server.index.group.GroupIndexRewriter.rewrite(GroupIndexRewriter.java:40)
	at com.google.gerrit.index.query.QueryProcessor.query(QueryProcessor.java:247)
	at com.google.gerrit.index.query.QueryProcessor.query(QueryProcessor.java:190)
	at com.google.gerrit.index.query.QueryProcessor.query(QueryProcessor.java:173)
	at com.google.gerrit.index.query.InternalQuery.query(InternalQuery.java:81)
	at com.google.gerrit.server.query.group.InternalGroupQuery.bySubgroup(InternalGroupQuery.java:62)
	at com.google.gerrit.server.account.GroupIncludeCacheImpl$ParentGroupsLoader.load(GroupIncludeCacheImpl.java:181)
	at com.google.gerrit.server.account.GroupIncludeCacheImpl$ParentGroupsLoader.load(GroupIncludeCacheImpl.java:167)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3528)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2277)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2154)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2044)
	... 48 more
[2018-11-23 16:41:43,551] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin reviewnotes, version v2.16
[2018-11-23 16:41:43,583] [main] INFO  com.google.gerrit.server.plugins.PluginLoader : Loaded plugin singleusergroup, version v2.16

Did you run the offline reindex for groups? 
Yes, i did
Please let me know if i need to clean up some data or need to execute some more index queries.

Comment 8 Deleted

Please share any solution of this problem as it is a blocker for me or you can share rollback queries so that i can go to previously version.  
Please confirm how you have run the offline reindex.  Also please confirm if the site works properly without the replication plugin.

Components: -plugins>events-log
Summary: "no active search index configured for groups" when loading replication plugin in 2.16 (was: Issue with Gerrit replication and event log plugin in Gerrit 2.16)
Removing events-log from the picture since that seems to be already resolved by upgrading it.

Yes, I have executed offline reindex and site is working fine but unable to push any code in gitlab due to replication plugin issue.
The replication plugin is working OK on my test site.

Please double check that the plugin version is correct.  When you upgraded from the previous version of gerrit, the init program should have prompted to upgrade the plugin.

Also, you said you've run the offline index, but please confirm how you've done that.  I.e. please show the command that was run.

Yes, i have upgraded using init program and i used below mentioned commands for offline  reindex.

java -jar gerrit.war reindex --index groups -d ${site_path}
java -jar gerrit.war reindex --index projects -d ${site_path}

Please let me know if you need any other information or if i need to re execute above mentioned index commands.
 
You could try to run the reindex again for groups.

Other than that I can't think of any other things to check except please double check one more time that the replication was upgraded properly during the upgrade from 2.15 to 2.16.

If then it still doesn't work, can you share the content of your replication.config?  Redact it as necessary to remove sensitive information such as server addresses and project names. This is just to make sure there isn't something related to the configuration that causes this (I only tested with a basic config replicating to a local file system).


After removing "authGroup = Administrators" from replication.config file, it was working fine so let me know what is the issue with this configuration and below is the content in my replication.config file.
[remote "pubmirror"]
  url = git@gitlab.companyname.com:${name}.git
  push = refs/heads/*:refs/heads/*
  push = refs/tags/*:refs/tags/*
  timeout = 300
  threads = 3

Let me know if i need to add/remove any above mentioned configuration.

Status: Accepted (was: AwaitingInformation)
Summary: "no active search index configured for groups" when remote uses authGroup in configuration on 2.16 (was: "no active search index configured for groups" when loading replication plugin in 2.16)
Thanks.  After adding the authGroup setting in my config, I get the same problem.

Labels: Priority-1
Cc: luca.mil...@gmail.com
It's broken due to [1] which changed the order of module registration so that plugins are loaded before the index.  This worked before because the groups include cache (which the plugin uses) previously did not use the index.

Now it does use the index, but when the plugin loads the index is not available yet.

[1] https://gerrit-review.googlesource.com/c/gerrit/+/109493
Note that this only affects the plugin when it gets loaded during server startup.  If it's loaded after gerrit is already running, it is successful.

To make gerrit reload the plugin, you need to bump the timestamp on the replication.jar file because otherwise it will just be ignored (gerrit knows it failed to load and will only reload it when it thinks the file has changed):

  $ touch /path/to/gerrit/plugins/replication.jar

and then either wait for gerrit to periodically reload the plugins, or force a reload with:

  $ ssh -p 29418 user@gerrit plugin reload

Note that the latter requires the setting in the gerrit.config:

  [plugins]
      allowRemoteAdmin = true

Status: ChangeUnderReview (was: Accepted)
https://gerrit-review.googlesource.com/c/plugins/replication/+/205813
Components: -plugins>replication
Summary: "no active search index configured ..." when a plugin gets any index injected during startup (was: "no active search index configured for groups" when remote uses authGroup in configuration on 2.16)
Thanks David for update!!
Project Member

Comment 26 by luca.mil...@gmail.com, Dec 3

Once the relevant changes are merged, we'll release v2.16.1 with them included.
Project Member

Comment 27 by david.os...@gmail.com, Dec 14

Cc: dborowitz@google.com david.os...@gmail.com
 Issue 10172  has been merged into this issue.
Project Member

Comment 28 by david.os...@gmail.com, Dec 14

Cc: -david.os...@gmail.com -dborowitz@google.com -luca.mil...@gmail.com
Project Member

Comment 29 by marco.mm...@gmail.com, Dec 21

Cc: marco.mm...@gmail.com
Project Member

Comment 30 by marco.mm...@gmail.com, Jan 5

3rd (new) change involved- https://gerrit-review.googlesource.com/c/gerrit/+/209192

Project Member

Comment 31 by marco.mm...@gmail.com, Jan 7

Status: Submitted (was: ChangeUnderReview)
Labels: FixedIn-2.15.8
Status: Released (was: Submitted)
Project Member

Comment 34 by jrn@google.com, Jan 11

Labels: FixedIn-2.16.3

Sign in to add a comment