Gerrit Replication - Does not create repositories, NOT_ATTEMPTED

914 views
Skip to first unread message

Pether Pettersson

unread,
Dec 3, 2018, 9:42:35 AM12/3/18
to Repo and Gerrit Discussion
Hi,

I've been trying to setup gerrit replication between two servers. Everything works so far, except that the replication does not create repositories that does not exist, if I have created them manually it will replicate fine.

This is what is shown in the replication log, ABC = the repository:
[2018-12-03 14:26:52,598] [65b7d3e9] Replication to ABC started...
[2018-12-03 14:26:52,606] [65b7d3e9] Push to ABC references: [RemoteRefUpdate[remoteName=refs/heads/master, NOT_ATTEMPTED, (null)...5026203980c91155004f5648ffddd147087e6b28, srcRef=refs/heads/master, message=null]]
[2018-12-03 14:26:57,977] [65b7d3e9] Created remote repository: ABC
[2018-12-03 14:26:57,977] [65b7d3e9] Missing repository created; retry replication to ABC
 
The replication.config currently looks like this:
[remote "local"]
url = ssh://ger...@1.2.3.4:29418/${name}.git

I've tried to manually add the createMissingRepositories property to test, no effect, I have also tried with adding the push lines from the configuration tutorial, no change.
The user is able to create and push to projects, and it works with already created projects. The tested projects have been both empty and with files added.


The posts i have read on this have all died before any solution is posted, so I am trying again.

David Pursehouse

unread,
Dec 4, 2018, 6:34:04 AM12/4/18
to Pether Pettersson, Repo and Gerrit Discussion
On Mon, Dec 3, 2018 at 11:42 PM Pether Pettersson <petterss...@gmail.com> wrote:
Hi,

I've been trying to setup gerrit replication between two servers. Everything works so far, except that the replication does not create repositories that does not exist, if I have created them manually it will replicate fine.

This is what is shown in the replication log, ABC = the repository:
[2018-12-03 14:26:52,598] [65b7d3e9] Replication to ABC started...
[2018-12-03 14:26:52,606] [65b7d3e9] Push to ABC references: [RemoteRefUpdate[remoteName=refs/heads/master, NOT_ATTEMPTED, (null)...5026203980c91155004f5648ffddd147087e6b28, srcRef=refs/heads/master, message=null]]
[2018-12-03 14:26:57,977] [65b7d3e9] Created remote repository: ABC
[2018-12-03 14:26:57,977] [65b7d3e9] Missing repository created; retry replication to ABC
 
The replication.config currently looks like this:
[remote "local"]
url = ssh://ger...@1.2.3.4:29418/${name}.git


For remote repo creation you need to use the adminUrl setting.

 
I've tried to manually add the createMissingRepositories property to test, no effect, I have also tried with adding the push lines from the configuration tutorial, no change.
The user is able to create and push to projects, and it works with already created projects. The tested projects have been both empty and with files added.


The posts i have read on this have all died before any solution is posted, so I am trying again.

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

Pether Pettersson

unread,
Dec 4, 2018, 7:34:48 AM12/4/18
to Repo and Gerrit Discussion
Hi,

adminUrl was the latest thing I tried, though I could not find an example of how it was writted, so I tried the regular ssh address(), the same as the url parameter, both with admin and gerrit user, both are admins on both gerrit servers. Both servers are clean 2.16 installs on rpi's.

On Tuesday, December 4, 2018 at 12:34:04 PM UTC+1, David Pursehouse wrote:
On Mon, Dec 3, 2018 at 11:42 PM Pether Pettersson <petterss...@gmail.com> wrote:
Hi,

I've been trying to setup gerrit replication between two servers. Everything works so far, except that the replication does not create repositories that does not exist, if I have created them manually it will replicate fine.

This is what is shown in the replication log, ABC = the repository:
[2018-12-03 14:26:52,598] [65b7d3e9] Replication to ABC started...
[2018-12-03 14:26:52,606] [65b7d3e9] Push to ABC references: [RemoteRefUpdate[remoteName=refs/heads/master, NOT_ATTEMPTED, (null)...5026203980c91155004f5648ffddd147087e6b28, srcRef=refs/heads/master, message=null]]
[2018-12-03 14:26:57,977] [65b7d3e9] Created remote repository: ABC
[2018-12-03 14:26:57,977] [65b7d3e9] Missing repository created; retry replication to ABC
 
The replication.config currently looks like this:
[remote "local"]
url = ssh://ger...@1.2.3.4:29418/${name}.git


For remote repo creation you need to use the adminUrl setting.

 
I've tried to manually add the createMissingRepositories property to test, no effect, I have also tried with adding the push lines from the configuration tutorial, no change.
The user is able to create and push to projects, and it works with already created projects. The tested projects have been both empty and with files added.


The posts i have read on this have all died before any solution is posted, so I am trying again.

--
--

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+unsubscribe@googlegroups.com.

Martin Fick

unread,
Dec 4, 2018, 11:56:35 AM12/4/18
to repo-d...@googlegroups.com, Pether Pettersson
On Tuesday, December 4, 2018 4:34:48 AM MST Pether Pettersson wrote:
> >> The replication.config currently looks like this:
> >>> [remote "local"]
> >>> url = ssh://ger...@1.2.3.4:29418/${name}.git
>
> adminUrl was the latest thing I tried, though I could not find an example
> of how it was writted, so I tried the regular ssh address(), the same as
> the url parameter, both with admin and gerrit user, both are admins on both
> gerrit servers. Both servers are clean 2.16 installs on rpi's.

The adminUel connection uses normal shell commands via ssh to create repos, so
it needs to point to port 22.

Your regular url should either point to port 22, or to a git daemon port, it
should not point to a gerrit port (29418) since that port should be read only
on a slave,

-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

David Pursehouse

unread,
Dec 4, 2018, 6:33:09 PM12/4/18
to Martin Fick, repo-d...@googlegroups.com, Pether Pettersson
On Wed, Dec 5, 2018 at 1:56 AM Martin Fick <mf...@codeaurora.org> wrote:
On Tuesday, December 4, 2018 4:34:48 AM MST Pether Pettersson wrote:
> >> The replication.config currently looks like this:
> >>> [remote "local"]
> >>> url = ssh://ger...@1.2.3.4:29418/${name}.git
>
> adminUrl was the latest thing I tried, though I could not find an example
> of how it was writted, so I tried the regular ssh address(), the same as
> the url parameter, both with admin and gerrit user, both are admins on both
> gerrit servers. Both servers are clean 2.16 installs on rpi's.

The adminUel connection uses normal shell commands via ssh to create repos, so
it needs to point to port 22.

Your regular url should either point to port 22, or to a git daemon port, it
should not point to a gerrit port (29418) since that port should be read only
on a slave,

Note: since 2.15 it's possible to replicate directly to another gerrit instance using the gerrit+ssh:// scheme.  In this case it uses Gerrit's ssh command to create the project.

 

-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

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

Matthias Sohn

unread,
Dec 4, 2018, 7:11:23 PM12/4/18
to David Pursehouse, Martin Fick, Repo and Gerrit Discussion, petterss...@gmail.com
On Wed, Dec 5, 2018 at 12:33 AM David Pursehouse <david.pu...@gmail.com> wrote:
On Wed, Dec 5, 2018 at 1:56 AM Martin Fick <mf...@codeaurora.org> wrote:
On Tuesday, December 4, 2018 4:34:48 AM MST Pether Pettersson wrote:
> >> The replication.config currently looks like this:
> >>> [remote "local"]
> >>> url = ssh://ger...@1.2.3.4:29418/${name}.git
>
> adminUrl was the latest thing I tried, though I could not find an example
> of how it was writted, so I tried the regular ssh address(), the same as
> the url parameter, both with admin and gerrit user, both are admins on both
> gerrit servers. Both servers are clean 2.16 installs on rpi's.

The adminUel connection uses normal shell commands via ssh to create repos, so
it needs to point to port 22.

Your regular url should either point to port 22, or to a git daemon port, it
should not point to a gerrit port (29418) since that port should be read only
on a slave,

Note: since 2.15 it's possible to replicate directly to another gerrit instance using the gerrit+ssh:// scheme.  In this case it uses Gerrit's ssh command to create the project.


Sasa is working on adding support for gerrit+http and gerrit+https schemes and enabling creation of missing
repositories over http/https. He should be able to push that soon

-Matthias

Pether Pettersson

unread,
Dec 5, 2018, 4:42:32 AM12/5/18
to Repo and Gerrit Discussion
I've been able to get it to work, though the log still contains the NOT_ATTEMPTED the new projects are created on the clone.
The problem was that I was certain that the projects would be created in the git folder specified in gerrit, but the replication actually starts from linux root instead and thus couldn't create new folders and projects due to no access. Adding the full path to the replication.config paths solved the problems. The projects won't show up on web gui, but since it will run as slave I guess it wouldn't matter anyway.

Thanks for the help

ps.
How is the 'gerrit+ssh:// schema' used? Never got it to work.

Matthew Webber

unread,
Dec 5, 2018, 5:55:53 AM12/5/18
to Repo and Gerrit Discussion
... the log still contains the NOT_ATTEMPTED ...

We see that on every replication as well.
I queried it when we started using replication, and as far as I can remember, I was told that was "normal".
Unfortunately I don't have, and can't find, where that was said.
Matthew

Reply all
Reply to author
Forward
0 new messages