Score:0

Gerrit replication plugin reload with error "lacks ${name} placeholder in FileBasedConfig"

in flag

The server which I deploied Gerrit's OS is Ubuntu 18.04.05, and my Gitlab server's IP address is 192.168.0.167. I tried using replication plugin to push gerrit project to local Gitlab server. My gerrit_site/etc/replication.config file likes below:

[remote "test_project"]
    url = [email protected]:testuser/test_project.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    push = +refs/changes/*:refs/changes/*
    threads = 3
    project = test_project

And I tried reloading replication plugin by below command:

ssh -l gerrit_admin -p 29418 127.0.0.1 gerrit plugin reload replication

And I got below error:

fatal: Unable to provision, see the following errors:

1) [Guice/ErrorInjectingConstructor]: ConfigInvalidException: remote.test_project.url "[email protected]:testuser/test_project.git" lacks ${name} placeholder in FileBasedConfig[/home/gerrit/gerrit_site/etc/replication.config]
  at DestinationsCollection.<init>(DestinationsCollection.java:72)
  at DestinationsCollection.class(DestinationsCollection.java:50)
  while locating DestinationsCollection
  while locating ReplicationDestinations

Learn more:
  https://github.com/google/guice/wiki/ERROR_INJECTING_CONSTRUCTOR

1 error

======================
Full classname legend:
======================
ConfigInvalidException:  "org.eclipse.jgit.errors.ConfigInvalidException"
DestinationsCollection:  "com.googlesource.gerrit.plugins.replication.DestinationsCollection"
ReplicationDestinations: "com.googlesource.gerrit.plugins.replication.ReplicationDestinations"
========================
End of classname legend:
========================

I wonder if I forgot any configurations? Or have any misunderstanding with official document?
I remember when I install plugin OAuth, I need to add a [plugin "gerrit-oauth"] section in gerrit_site/etc/gerrit.config. But the replication's document has no mention about this. Dose replication's document think I have already done it by default? If so, how should I modify gerrit_site/etc/gerrit.config?

Score:0
cz flag

I have same issues rencently. You can check your replication.config, probably replication.config have duplicate remote name items, like below, these two items have same name.

Solution: rename the duplicate items to an unique name.

[remote "test_project"]
    url = [email protected]:testuser/test_project.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    push = +refs/changes/*:refs/changes/*
    threads = 3
    project = test_project

[remote "test_project"]
    url = [email protected]:testuser/another.git
    push = +refs/heads/*:refs/heads/*
    push = +refs/tags/*:refs/tags/*
    push = +refs/changes/*:refs/changes/*
    threads = 3
    project = test_project
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.