Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Push to Network Drive: Cannot pread pack file

Tags:

I'm trying to push locally to a shared repo on a network drive. I'm getting the following error:

:~/git push origin master
Counting objects ... done
Writing objects ...
Total ....

but then:

fatal: cannot pread pack file: No Permission
error: unpack failed: index-pack abnormal exit
To /networkshare/repo.git
! [remote rejected] master -> master (n/a unpack error)

The rights on the remote directory are like this:

:~/ls -all
drwxr-xr-x ndbd MyGroup  Date  Repo.Git

any clue?

like image 638
ndbd Avatar asked Apr 12 '16 12:04

ndbd


1 Answers

This error message comes form builtin/index-pack.c#unpack_data.
It calls wrapper.c#xpread which wraps pread (man page)

If successful, the number of bytes actually read is returned.
Upon read-ing end-of-file, zero is returned.
Otherwise, a -1 is returned and the global variable errno is set to indicate the error.

The permissions state that only ndbd user has the right to write to that mounted folder. But read should work.
You need to check the permissions of the git packfiles created by the git push operation on the network drive to see if the same rights apply.

They are in /networkshare/repo.git/objects, /networkshare/repo.git/objects/info/packs and /networkshare/repo.git/objects/pack/pack-*.idx

like image 115
VonC Avatar answered Sep 28 '22 02:09

VonC