threads / discuss / 13981

error: cannot lock ref 'refs/remotes/origin/*'

Subject: error: cannot lock ref 'refs/remotes/origin/*'

## tl;dr

9 messages between Jun 16, 2008 and Jun 17, 2008.

replies: 8people: 4as markdown or json

Nicolas Bock· Jun 16, 2008, 16:53 UTC · lore
Hello list,
when running "git gc" I get the following error message as of late:

$ git gc error: cannot lock ref 'refs/remotes/origin/*' error: failed to run reflog

When I rsync the directory tree to another machine, I can run "git gc" without any error messages. What exactly does this error mean? Why would locking fail?

Thanks already,
nick
Nicolas Bock· Jun 17, 2008, 01:47 UTC · re: Nicolas Bock · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

I realized that I recently upgraded from version 1.5.3.7 to 1.5.4.5. I double checked and downgraded again, and yes, I don't have any problems running "git gc" with the older version, but I get the below error message with the newer version of git.

nick
On Mon, 2008-06-16 at 10:53 -0600, Nicolas Bock wrote:
Show 20 quoted lines
> Hello list,
> 
> when running "git gc" I get the following error message as of late:
> 
> $ git gc
> error: cannot lock ref 'refs/remotes/origin/*'
> error: failed to run reflog
> 
> When I rsync the directory tree to another machine, I can run "git gc"
> without any error messages. What exactly does this error mean? Why would
> locking fail?
> 
> Thanks already,
> 
> nick
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johannes Schindelin· Jun 17, 2008, 10:41 UTC · re: Nicolas Bock · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

Hi,
On Mon, 16 Jun 2008, Nicolas Bock wrote:
> > $ git gc
> > error: cannot lock ref 'refs/remotes/origin/*'
> > error: failed to run reflog

This is a bogus ref name. Hrm. Can you look with "git show-ref" if you have (by some funny accident) an invalid ref there?

Ciao, Dscho

Nicolas Bock· Jun 17, 2008, 14:22 UTC · re: Johannes Schindelin · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

This is what I get:

$ git show-ref a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/* 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master

in what sense is this ref "bogus"? Is it syntactically incorrect?
On Tue, 2008-06-17 at 11:41 +0100, Johannes Schindelin wrote:
Show 18 quoted lines
> Hi,
> 
> On Mon, 16 Jun 2008, Nicolas Bock wrote:
> 
> > > $ git gc
> > > error: cannot lock ref 'refs/remotes/origin/*'
> > > error: failed to run reflog
> 
> This is a bogus ref name.  Hrm.  Can you look with "git show-ref" if you 
> have (by some funny accident) an invalid ref there?
> 
> Ciao,
> Dscho
> 
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Johan Herland· Jun 17, 2008, 14:29 UTC · re: Nicolas Bock · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

On Tuesday 17 June 2008, Nicolas Bock wrote:
Show 10 quoted lines
> This is what I get:
>
> $ git show-ref
> a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master
>
> in what sense is this ref "bogus"? Is it syntactically incorrect?

Yes, According to "man git-check-ref-format", asterisk is NOT allowed in a ref name.

...Johan
-- 
Johan Herland, <johan@herland.net>
www.herland.net
Nicolas Bock· Jun 17, 2008, 15:49 UTC · re: Johan Herland · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

I guess I don't understand refs. I figured that since I have
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
set, I should have a ref refs/remotes/origin/* as well.
On Tue, 2008-06-17 at 16:29 +0200, Johan Herland wrote:
Show 18 quoted lines
> On Tuesday 17 June 2008, Nicolas Bock wrote:
> > This is what I get:
> >
> > $ git show-ref
> > a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> > 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> > 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> > ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
> > 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/remotes/origin/master
> >
> > in what sense is this ref "bogus"? Is it syntactically incorrect?
> 
> Yes, According to "man git-check-ref-format", asterisk is NOT allowed in 
> a ref name.
> 
> 
> ...Johan
> 
Jakub Narebski· Jun 17, 2008, 19:09 UTC · re: Nicolas Bock · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

Nicolas Bock <nbock@lanl.gov> writes:
Show 5 quoted lines
> I guess I don't understand refs. I figured that since I have
> 
> remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> 
> set, I should have a ref refs/remotes/origin/* as well.

The above is _globbing_ refspec, it means that it maps "refs/heads/<name>" branch in remote repository to "refs/remotes/origin/<name>" remote-tracking branch in local repository.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Nicolas Bock· Jun 17, 2008, 21:00 UTC · re: Jakub Narebski · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

Thanks, that explains it..
nick
On Tue, 2008-06-17 at 12:09 -0700, Jakub Narebski wrote:
Show 13 quoted lines
> Nicolas Bock <nbock@lanl.gov> writes:
> 
> > I guess I don't understand refs. I figured that since I have
> > 
> > remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
> > 
> > set, I should have a ref refs/remotes/origin/* as well.
> 
> The above is _globbing_ refspec, it means that it maps 
> "refs/heads/<name>" branch in remote repository to 
> "refs/remotes/origin/<name>" remote-tracking branch in local
> repository.
> 
Johannes Schindelin· Jun 17, 2008, 14:46 UTC · re: Nicolas Bock · lore

Re: error: cannot lock ref 'refs/remotes/origin/*'

Hi,
On Tue, 17 Jun 2008, Nicolas Bock wrote:
Show 7 quoted lines
> This is what I get:
> 
> $ git show-ref
> a4995ae293fd95697a643cd3ea45585ecc38a19d refs/heads/ACT
> 3378ccb42c22740b7fcc240ffa0e4f798b8acf1f refs/heads/master
> 78e33155a0ab4ab0acba4c64758681fe99f1c5ca refs/heads/nick
> ef66b3aa74b8c1edb55161e01a99dee7cf9edaa3 refs/remotes/origin/*
This is the culprit.  It is obviously a wrong name: "*" is not allowed.

Hth, Dscho

← back to recent threads