Gerrit Error - Fatal:Couldn't find remote ref refs/meta/config

1,024 views
Skip to first unread message

Mohan

unread,
Aug 16, 2019, 11:31:53 AM8/16/19
to Repo and Gerrit Discussion
I m using Gerrit-2.14 and in one of our gerrit project/repository's project access list removed by someone due to this,In Gerrit project's UI under General section Edit.config upon click it shows

"Code review Error
Branch refs/meta/config does not exist".

On terminal tried the following,

mkdir tmp
cd tmp
git int
git remote add origin ssh://user@gerrit-server:29498/test_repo
git fetch origin refs/meta/config:refs/remotes/origin/meta/config

It shows below error
Couldn't find remote ref refs/meta/config

So now how to identify that who had removed the access list and how to restore the access list. Plz assist would be great helpful.

Richard Christie

unread,
Aug 22, 2019, 4:07:26 AM8/22/19
to Repo and Gerrit Discussion
Assuming gerrit's jgit/repository cache isn't corrupted (you've tried restarting gerrit?) then not sure removal is even possible to do through gerrit itself.

It smells like someone nuked the ref using command-line git, or perhaps restored the repo from a backup and did something like copying all heads and tags, but not all refs?

You will probably need to get access to the repository on disk server-side and then hope that there's something in the git reflog [1] about who removed the ref (assuming someone did). If there's info there, you'll be able to restore it with a git update-ref refs/meta/config <old-hash>.

Unfortunately update-ref in delete mode also removes the ref-log by default, so if someone did that, there'll be no audit. It would also be indistinguishable from someone copying in from backup and forgetting the ref.

You could also check whether any 'refs/changes/*' refs are present in the repo.

[1] Found as <repo.git>logs/refs/meta/config
Reply all
Reply to author
Forward
0 new messages