git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git force push fails after a rejected push (unpack failed)?

From
Jeff King <peff@peff.net>
Date
Jul 7, 2015, 14:13 UTC
Message-ID
<20150707141305.GA629@peff.net>
In-Reply-To
<DUB120-W5049F72955243F44BB2511F6920@phx.gbl>
On Tue, Jul 07, 2015 at 03:45:50PM +0200, X H wrote:
> remote: error: unable to write sha1 filename objects/d9/4bfb39cd0be7497e493bd4045111a7b1158134: Permission denied
> remote: fatal: failed to write object
> error: unpack failed: unpack-objects abnormal exit

It looks like the permissions of one or more of the .git/objects/* directories on the server is not right. Just a guess, but this may be because you have multiple accounts pushing to it, and need to set umasks or use git's core.sharedrepository config to set the permissions for each object.

You'll probably have to ssh to the server and "chown" or "chmod" some directories to fix it in the first place, though.

> Is it the intended behaviour? I try to reproduce this and it seems it
> doesn't happen always.

Probably only some object directories have the problem, so it would depend on the set of exact objects you are sending, and possibly even the number of objects (if you send a large number of objects, git will store them as a pack, not as loose objects).

-Peff
Previous: X HNext: Jeff King
Message 2 of 17 in “Git force push fails after a rejected push (unpack failed)?”
  1. X HJul 7, 2015
  2. Jeff KingJul 7, 2015
  3. Jeff KingJul 7, 2015
  4. Eric SunshineJul 7, 2015
  5. Johannes SixtJul 8, 2015
  6. Jeff KingJul 8, 2015
  7. check_and_freshen_file: fix reversed success-checkJeff King, Jul 8, 2015
  8. Junio C HamanoJul 8, 2015
  9. check_and_freshen_file: fix reversed success-checkJeff King, Jul 8, 2015
  10. Johannes SixtJul 8, 2015
  11. Johannes SixtJul 9, 2015
  12. Jeff KingJul 9, 2015
  13. X HJul 11, 2015
  14. Jeff KingJul 13, 2015
  15. X HJul 13, 2015
  16. X HJul 8, 2015
  17. Johannes SixtJul 8, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.