Discussion:
Cloning replicated repo results in warning: remote HEAD refers to nonexistent ref, unable to checkout.
Aric Gardner
2014-09-24 19:01:14 UTC
Permalink
Hey Guys and Gals, seems like allowing refs/* isnt working. or something.
I'm not really sure. This same setup worked on a different gerrit server
(running 2.8.1 and without remoteNameStyle = dash)

Gerrit version 2.8
Replication plugin extracted from gerrit.war and installed over ssh

Expected outcome: replication works
Actual outcome: replication completes successfully but when I clone the
replicated repo I receive the warning: remote HEAD refers to nonexistent
ref, unable to checkout.

Installation method ->

a) Relevant configs:

/var/lib/gerrit/etc/replication.config
[remote "aricg-compliance"]
url = ***@aricgardner.com:somerepo/${name}.git
push = +refs/head/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 30
threads = 3
remoteNameStyle = dash
authGroup = GitHub Replication

/var/lib/gerrit/.ssh/config
Host aricgardner.com
User gerrit
IdentityFile /var/lib/gerrit/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile /dev/null

note: sshing as the gerrit user to the remote server works.

b) Gerrit authorization:

Group Name: GitHub Replication
GitHub Replication denied read to refs/* in all projects
GitHub Replication allowed read to refs/* in in Project compliance/tests

c) enable plugin and start replication:

unzip gerrit.war
cp WEB-INF/plugins/replication.jar /tmp/
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin install -n
replication -</tmp/replication.jar
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin ls
Name Version Status File
-------------------------------------------------------------------------------
replication v2.8 ENABLED replication.jar

ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin reload
replication

ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org replication start --wait
--all
Replicate compliance/tests to aricgardner.com, Succeeded!
----------------------------------------------
Replication completed successfully!

Actuall results ->

When I clone the replicated repository
$ git clone ***@aricgardner.com:somerepo/compliance-tests.git
Cloning into 'compliance-tests'...
remote: Counting objects: 508, done.
remote: Compressing objects: 100% (210/210), done.
remote: Total 508 (delta 184), reused 508 (delta 184)
Receiving objects: 100% (508/508), 274.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (184/184), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.

what the cloned repo looks like ->
$ cd compliance-tests/
agardner at hyperion/tmp/compliance-tests
$ git branch -r
agardner at hyperion/tmp/compliance-tests
$ find .
./.git
./.git/packed-refs
./.git/config
./.git/objects
./.git/objects/info
./.git/objects/pack
./.git/objects/pack/pack-af85e0c494dab42beb252c6f15ada3e6967cc62a.idx
./.git/objects/pack/pack-af85e0c494dab42beb252c6f15ada3e6967cc62a.pack
./.git/HEAD
./.git/hooks
./.git/hooks/pre-push.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/update.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/pre-commit.sample
./.git/hooks/commit-msg.sample
./.git/hooks/post-update.sample
./.git/hooks/applypatch-msg.sample
./.git/hooks/pre-applypatch.sample
./.git/info
./.git/info/exclude
./.git/description
./.git/branches
./.git/refs
./.git/refs/tags
./.git/refs/heads

when I clone the main gerrit repo:
git clone https://git.somerepo.org/gerrit/compliance/tests && cd test
$ git branch -r
origin/HEAD -> origin/master
origin/RB14.02
origin/RB14.06
origin/master

Any insight would be greatly appreciated

-Aric
--
--
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.
Aric Gardner
2014-09-25 14:17:14 UTC
Permalink
It was a typo.

push = +refs/head/*:refs/heads/* should have been push =
+refs/heads/*:refs/heads/*

-Aric
Post by Aric Gardner
Hey Guys and Gals, seems like allowing refs/* isnt working. or something.
I'm not really sure. This same setup worked on a different gerrit server
(running 2.8.1 and without remoteNameStyle = dash)
Gerrit version 2.8
Replication plugin extracted from gerrit.war and installed over ssh
Expected outcome: replication works
Actual outcome: replication completes successfully but when I clone the
replicated repo I receive the warning: remote HEAD refers to nonexistent
ref, unable to checkout.
Installation method ->
/var/lib/gerrit/etc/replication.config
[remote "aricg-compliance"]
push = +refs/head/*:refs/heads/*
push = +refs/tags/*:refs/tags/*
timeout = 30
threads = 3
remoteNameStyle = dash
authGroup = GitHub Replication
/var/lib/gerrit/.ssh/config
Host aricgardner.com
User gerrit
IdentityFile /var/lib/gerrit/.ssh/id_rsa
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
note: sshing as the gerrit user to the remote server works.
Group Name: GitHub Replication
GitHub Replication denied read to refs/* in all projects
GitHub Replication allowed read to refs/* in in Project compliance/tests
unzip gerrit.war
cp WEB-INF/plugins/replication.jar /tmp/
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin install -n
replication -</tmp/replication.jar
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin ls
Name Version Status File
-------------------------------------------------------------------------------
replication v2.8 ENABLED replication.jar
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org gerrit plugin reload
replication
ssh -p 29418 pdx-wl-gerrit-1.web.someserver.org replication start --wait
--all
Replicate compliance/tests to aricgardner.com, Succeeded!
----------------------------------------------
Replication completed successfully!
Actuall results ->
When I clone the replicated repository
Cloning into 'compliance-tests'...
remote: Counting objects: 508, done.
remote: Compressing objects: 100% (210/210), done.
remote: Total 508 (delta 184), reused 508 (delta 184)
Receiving objects: 100% (508/508), 274.04 KiB | 0 bytes/s, done.
Resolving deltas: 100% (184/184), done.
Checking connectivity... done.
warning: remote HEAD refers to nonexistent ref, unable to checkout.
what the cloned repo looks like ->
$ cd compliance-tests/
agardner at hyperion/tmp/compliance-tests
$ git branch -r
agardner at hyperion/tmp/compliance-tests
$ find .
./.git
./.git/packed-refs
./.git/config
./.git/objects
./.git/objects/info
./.git/objects/pack
./.git/objects/pack/pack-af85e0c494dab42beb252c6f15ada3e6967cc62a.idx
./.git/objects/pack/pack-af85e0c494dab42beb252c6f15ada3e6967cc62a.pack
./.git/HEAD
./.git/hooks
./.git/hooks/pre-push.sample
./.git/hooks/prepare-commit-msg.sample
./.git/hooks/update.sample
./.git/hooks/pre-rebase.sample
./.git/hooks/pre-commit.sample
./.git/hooks/commit-msg.sample
./.git/hooks/post-update.sample
./.git/hooks/applypatch-msg.sample
./.git/hooks/pre-applypatch.sample
./.git/info
./.git/info/exclude
./.git/description
./.git/branches
./.git/refs
./.git/refs/tags
./.git/refs/heads
git clone https://git.somerepo.org/gerrit/compliance/tests && cd test
$ git branch -r
origin/HEAD -> origin/master
origin/RB14.02
origin/RB14.06
origin/master
Any insight would be greatly appreciated
-Aric
--
--
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.
Loading...