git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johan Herland <johan@herland.net>
To: git@vger.kernel.org
Subject: Problems with stale .keep files on git server
Date: Thu, 31 Mar 2011 12:46:25 +0200	[thread overview]
Message-ID: <201103311246.25645.johan@herland.net> (raw)

Hi,

I have a problem in a server repo where it seems that some previous
"git push" command by some user has left a stale .keep file in the
repo.git/objects/pack/ directory.

Now, when trying to clone the repo on the server, the clone fails with:

$ git clone --bare /path/to/repo.git myclone.git
Cloning into bare repository myclone.git...
fatal: failed to copy file to 'myclone.git/objects/pack/pack-6195737bf980830662f9a44eced023ca4ebe083a.keep': Permission denied

(This is a local clone across filesystems, which I assume simply
copies the objects/ directory from the source repo)

Looking at the .keep file that it's trying to copy from the source
repo, it is owned by the same user as the corresponding .pack and
.idx files, but while the .pack and .idx files have 0440 permissions,
the .keep file has 0600 permission (which explains the "Permission
denied" error). The .keep file itself contains the following text:

  receive-pack 6932 on gitmain

(where gitmain is the hostname of this server)

The timestamp on the .keep file is over a month old, and there is
currently no process with ID 6932 running on this server.

AFAICS, this indicates that someone pushed this pack over a month ago,
and for some reason it failed/aborted, and left the .keep file lying
around. From browsing the source, I see that the .keep file is created
by receive-pack protect the pack from a concurrent "git gc" while it is
being created. However, I have yet to find under which conditions
receive-pack will die without removing the .keep file.

Some questions:

1. Why does the .keep file have 0600 permissions (preventing a local
   clone by any other user)

2. Under which conditions will receive-pack leave stale .keep files
   in the filesystem? Is this a bug?

3. Do I need to scan for and remove stale .keep files in a cron job
   in order to keep repos healthy and clonable?


Thanks,

...Johan

-- 
Johan Herland, <johan@herland.net>
www.herland.net

             reply	other threads:[~2011-03-31 10:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-31 10:46 Johan Herland [this message]
2011-03-31 19:04 ` Problems with stale .keep files on git server Jeff King
2011-04-01  1:29   ` [PATCH 1/2] index-pack: Create .keep files with same permissions and .pack/.idx Johan Herland
2011-04-01 21:39     ` Junio C Hamano
2011-04-01 21:41       ` Jeff King
2011-04-01 21:49       ` Shawn Pearce
2011-04-01 22:21         ` Junio C Hamano
2011-04-01 23:27           ` Johan Herland
2011-04-02  4:21             ` Junio C Hamano
2011-04-03  1:01               ` Johan Herland
2011-04-01 23:37         ` Johan Herland
2011-04-01  1:34   ` [RFC/PATCH 2/2] repack: Remove stale .keep files before repacking Johan Herland
2011-04-01  1:41     ` Jeff King
2011-04-01  8:12       ` Johan Herland

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201103311246.25645.johan@herland.net \
    --to=johan@herland.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).