Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 398206

Summary: Gerrit for CDT does not allow push, "One or more refs/for/ names blocks change upload"
Product: Community Reporter: Martin Oberhuber <mober.at+eclipse>
Component: GerritAssignee: Eclipse Webmaster <webmaster>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: cdtdoug, eostroukhov, malaperle, mober.at+eclipse
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=472381
Whiteboard:
Bug Depends on: 398195    
Bug Blocks:    

Description Martin Oberhuber CLA 2013-01-15 11:26:17 EST
+++ This bug was initially created as a clone of Bug #398195 +++

I cannot push changes to review for CDT, as per See bug 398195 comment 2
Gerrit says:
"One or more refs/for/ names blocks change upload"

In egit I don't even see this error message it just says "push forbidden".

How can this be resolved ?
Comment 1 Eclipse Webmaster CLA 2013-01-15 11:34:07 EST
I took a quick peek and it looks like the push permissions was missing in Gerrit, so I added it.

If that doesn't fix the issue, we may have to dig deeper see bugs: 

388879
373061

-M.
Comment 2 Martin Oberhuber CLA 2013-01-15 13:03:53 EST
Tried again - same problem as before.

I was able to push a change into Gerrit on 8-Jan, which I abandoned today:
https://git.eclipse.org/r/9522

So I would have been surprised if push permissions had somehow magically gone.
Comment 3 Martin Oberhuber CLA 2013-01-15 13:06:18 EST
Looking at gitweb, the "refs/for/master" tag appears to be stuck on the change which I abandoned, and it appears to be stuck on the wrong branch (cdt_8_1).
this looks incorrect:

http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/log/?h=cdt_8_1

But I don't know how that could be fixed ? Or how I could have caused the desaster ?
Comment 4 Eclipse Webmaster CLA 2013-01-15 13:56:35 EST
If I look in the Gerrit logs I find these:

gerrit.server.util.MagicBranch : Repository 'cdt/org.eclipse.cdt' needs the following refs removed to receive changes: [master]

So I decided to try the fix from 377415:

gitroot/cdt/org.eclipse.cdt.git> git for-each-ref refs/for
446545ab16adc8a01ca6d9915e79cd05d944431f commit refs/for/master
gitroot/cdt/org.eclipse.cdt.git>  for n in $(git for-each-ref --format='%(refname)' refs/for); do git update-ref -d $n; done
gitroot/cdt/org.eclipse.cdt.git>  git for-each-ref refs/for
gitroot/cdt/org.eclipse.cdt.git> 

Does that improve things?

-M.
Comment 5 Martin Oberhuber CLA 2013-01-15 14:48:11 EST
Looks like that did the trick - thanks !

As per the original dicussion in bug 372131 comment 7, it looks like I could also simply have done

   git update-ref -d refs/for/master

to delete the incorrect ref. Maybe something for the Gerrit Wiki in case it happens more often...