Can't fetch refs/meta/config

4,319 views
Skip to first unread message

Johan Martinsson

unread,
Nov 5, 2012, 4:47:16 AM11/5/12
to repo-d...@googlegroups.com
Hi,

I'm trying tu update the refs/meta/config on a new project (toto). I cannot see the refs/meta/config branch :

toto> git pull gerrit.private:toto refs/meta/config
fatal: Couldn't find remote ref refs/meta/config

while getting the master is no problem.

toto> git pull gerrit.private:toto master
remote: Counting objects: 3, done
remote: Finding sources: 100% (3/3)
remote: Total 3 (delta 0), reused 3 (delta 0)
Unpacking objects: 100% (3/3), done.
From gerrit.private:toto
 * branch            master     -> FETCH_HEAD

I've tried it both on 2.5-rc0 and rc2


As a side information I also tried to push directly to the refs/meta/config branch, but I get "failed to lock"

toto> git push gerrit.private:toto HEAD:refs/meta/config
Counting objects: 3, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 251 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
remote: Processing changes: refs: 1, done    
To gerrit.private:toto
 ! [remote rejected] HEAD -> refs/meta/config (failed to lock)
error: failed to push some refs to 'gerrit.private:toto'


Lundh, Gustaf

unread,
Nov 5, 2012, 8:31:24 AM11/5/12
to Johan Martinsson, repo-d...@googlegroups.com

Are you sure the project has a refs/meta/config? If all the rights have been inherited from a parent project it may not have one yet.

 

Otherwise, run:

git ls-remote gerrit.private:toto

 

Can you see the refs/meta/config?

 

If not, you can try to clear your caches on the Gerrit server and if that does not help, go over all the access rights and ensure you actually have the rights to see it.

 

Best regards

Gustaf

Lundh, Gustaf

unread,
Nov 5, 2012, 8:39:44 AM11/5/12
to Lundh, Gustaf, Johan Martinsson, repo-d...@googlegroups.com

Sorry..

 

I was a bit quick. I figured new projects would just inherit from the parent All-Project without getting a refs/meta/config.

 

But Gerrit actually sets the “Project.State“ in refs/meta/config:project.config regardless if you specify a parent.

 

Still. I would run git ls-remote and try to verify the access-rights.

Johan Martinsson

unread,
Nov 5, 2012, 8:49:12 AM11/5/12
to repo-d...@googlegroups.com, Lundh, Gustaf, Johan Martinsson
You're spot on. 

The admin user was no longer project owner.

Thanks

Shawn Pearce

unread,
Nov 5, 2012, 10:07:55 AM11/5/12
to Johan Martinsson, repo-discuss, Lundh, Gustaf
On Mon, Nov 5, 2012 at 5:49 AM, Johan Martinsson <martinss...@gmail.com> wrote:
You're spot on. 

The admin user was no longer project owner.

This is a fuzzy area in the way access controls work.

Administrators can always see any access panel in the web UI, but they can't see a branch over Git unless they have Read permission on it. This often blocks access to refs/meta/config. I usually setup a server so that All-Projects contains a refs/meta/config Read permission for the administrators group(s) to always make it available over Git.

Johan Martinsson

unread,
Nov 5, 2012, 11:56:04 AM11/5/12
to repo-d...@googlegroups.com, Johan Martinsson, Lundh, Gustaf
Another strangeness (or I missed something) is that you cannot do command-line ACL out of the box, since there is no push allowed on refs/meta/config:

gerrit create-group someproject-admin --member me
gerrit create-project someproject --owner someproject-admin
mkdir someproject
cd someproject
git init
git fetch gerrit:someproject refs/meta/config
git checkout FETCH_HEAD
git config -f project.config --add access.refs/*.Read "group someproject-admin"
git commit -am'updated config'
git push gerrit:someproject HEAD:refs/meta/config
remote: You are not allowed to perform this operation.
remote: Configuration changes can only be pushed by project owners
remote: who also have 'Push' rights on refs/meta/config

Of course I can create a permissions-only project where the owner has push to refs/meta/config. But I don't see why this is so.

Johan

Nitish Goel

unread,
Aug 18, 2018, 4:19:10 PM8/18/18
to Repo and Gerrit Discussion
Hello,

I have similar error on one of the project
we have multiple projects maintained on gerrit. For one of project when i try to change the access permission, it gives me error


I don't think I have access issue. I have owner and read permission from the parent project.
Reply all
Reply to author
Forward
0 new messages