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

Re: fatal: unable to write sha1 file git 1.6.2.1

From
PPeter <vmail@mycircuit.org>
Date
Mar 24, 2009, 21:05 UTC
Message-ID
<49C94B02.5010604@mycircuit.org>
In-Reply-To
<alpine.LFD.2.00.0903241226570.3032@localhost.localdomain>
I consolidate from Nicolas and Linus, thanks for your help:

Currently, Git is unable to deal with files that it cannot load entirely in memory.

What is the size of your largest file?

The biggest is 51 Mb , followed by one that is 23 MB. I was able to add and commit a part of the dir tree where the biggest file was 14 Mb. So there seems to be a threshold between 23 Mb and 14 Mb.

> If that is the only error message you got, then afaik the only way that 
> can happen is if "close(fd)" returns an error.
>   
Yes thats the only message I got.
Show 10 quoted lines
> The only other "unable to write sha1 file" message happens if 
> write_buffer() fails, but if that happens then you should also have gotten 
> a
>
> 	file write error (<error message goes here>)
>
> message in addition to the "unable to write sha1 file".
>
> What OS? What filesystem? Are you perhaps running out of space?
>   

Its Lenny Debian 5.0.0, Diskspace is ample . Filesystem is cifs ( this is a windows 2000 share mounted with samba in a VMware Workstation Debian client ( yes, I know ... )). Memory usage, according to htop, is constant = 140/504 MB during the whole process until git fails.

Show 24 quoted lines
> You could also try to apply this patch to get more information (Junio, 
> maybe worth doing regardless? We should try to avoid ambiguous error 
> messages that don't give full error information)
>
> 		Linus
> ---
>  sha1_file.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/sha1_file.c b/sha1_file.c
> index 4563173..54972f9 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -2287,7 +2287,7 @@ static void close_sha1_file(int fd)
>  		fsync_or_die(fd, "sha1 file");
>  	fchmod(fd, 0444);
>  	if (close(fd) != 0)
> -		die("unable to write sha1 file");
> +		die("error when closing sha1 file (%s)", strerror(errno));
>  }
>  
>  /* Size of directory component, including the ending '/' */
> --
>   

Will try it, thanks Peter

Previous: Linus TorvaldsNext: Linus Torvalds
Message 4 of 13 in “fatal: unable to write sha1 file git 1.6.2.1”
  1. PeterMar 24, 2009
  2. Nicolas PitreMar 24, 2009
  3. Linus TorvaldsMar 24, 2009
  4. PeterMar 24, 2009
  5. Linus TorvaldsMar 24, 2009
  6. PeterMar 24, 2009
  7. Linus TorvaldsMar 25, 2009
  8. Jeff LaytonMar 25, 2009
  9. Jeff LaytonMar 24, 2009
  10. Linus TorvaldsMar 25, 2009
  11. Steven FrenchMar 25, 2009
  12. Jeff LaytonMar 25, 2009
  13. PeterMar 25, 2009

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.