0

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 = git@192.168.0.167: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 "git@192.168.0.167: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?

fajin yu
  • 175
  • 2
  • 8

0 Answers0