Git, error: remote unpack failed: unable to create temporary object directory - By creating new Branch
Andrew Henderson
I'm trying to create a new branch in my repo.
I did this:
git branch eventsgit Checkout eventsThat worked. So I changed some files and did:
git Status
git add --all
git commit -m "Commit"That worked well but I tried to push it and that didn't work:
git push -u origin eventsThis is the error:
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 4 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 716 bytes | 716.00 KiB/s, done.
Total 5 (delta 4), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To ! [remote rejected] events -> events (unpacker error)
error: failed to push some refs to 'http://[email protected]/scm/freeb/freebrep.git'I don't know why it does not work.
I have Admin rights on the Repo. I censored the link to the repo because its an internal Repo with private link.
810 Answers
This error message:
error: remote unpack failed: unable to create temporary object directory
indicates that the Git repository at the server (not your Git) is out of space, or running into similar server problems,1 or installed incorrectly. That is, given:
To:
you will have to log in to the machine that serves HTTP traffic at git.int.censoredlink, walk down to the scm/freeb/freebrep.git directory, and correct the installation there. It's most likely a permissions issue: the receiving Git must be able to create, in the objects area, a directory named incoming-XXXXXX with the Xs replaced by a unique identifier, and then create within that directory a pack subdirectory.
All incoming objects and pack files are placed in these directories, in a sort of quarantine procedure, until the server-side Git hooks are satisfied with the reference name update requests. If the push fails, the quarantine directory is simply removed. If the push succeeds, the quarantined objects and/or pack files are migrated (and thin packs adjusted) into the normal object storage area. Note that the migration can fail even if the quarantine process succeeds; but if it does so, you get a different error reported to the client. (This error must also be corrected on the server.)
Note: it's rather unusual to push to http:// rather than https:// or ssh:// URLs. Inspect your server configuration to see who will own the various files thus created, and what permissions the web server will have.
1If a hard drive fails, Linux will sometimes mark the drive and/or its file systems read only. Or, even if you have disk space, you can run out of inodes. A number of different root causes will all lead to the same observed behavior on your client end. If you are a Linux admin checking on a server, look for system log messages, and consider both df and df -i output.
90% chance it's a permissions issue.
- Login to the remote server.
- Navigate to
/scm/freebwherefreebrep.gitis. - call
chown -R yourusername freebrep.git(where your user name is stsu) - Try again. Now it should allow writing objects.
If you are working as a root user, please first change the user to your git user and then init your git directory:
- if you are root -> $ [root@server ~]#
- change user -> $ su - username
- init a git repo -> [username@server ~] $ git init --bare git-repo.git
- push from client -> Now you can push from the client:
git remote add yourAliasName ssh://username@IP-or-HOST:sshPort/home/username/git-repo.git
Note:
I supposed you have created a public/private key already in your client and passed the public key to the /home/username/.ssh/authorized_keys server file. Otherwise you have to do it before step(4).
I was getting the same error until I removed a .git subdirectory in the remote git repository.
The .git subdir was not writable by the git login account. Initially I had a permissions problem when trying to commit, and I suspect the .git subdir was created then.
I got redirected here because of this error message.
error: remote unpack failed: unable to create temporary object directory
FYI: This can also occur when you are mounting the git directory read only
eg x.x.x.x:/nas/git on /mnt/git type nfs (ro,.....
Recently I did encounter this error. The problem was the user did not have sufficient permission for example git remote add production ssh://username@{your-ip}/var/test/test.git` ensure the username did not have permissions
I faced the same error when i tried pushing to "censored git server". The problem was on the server side. You can wait for some time until the sever gets back online properly or just contact the admin to get it fixed :)
2For me it was a dangling, crashed gitk-session: exclusively blocking file-access on a windoze-machine.
Say on your Mac you're connecting to your own ubuntu server on AWS.
It's likely you will be connecting as user "ubuntu".
If permissions are a non-issue (it's just you), simply log in to your ubuntu server, and just
] chown ubuntu:ubuntuall of the git directory in question. That will work fine.
Problem :- error: remote unpack failed: unable to create temporary object directory To ! [remote rejected] release/project-PROD-year_month_WeekNumber -> release/project-PROD-year_month_WeekNumber (unpacker error) error: failed to push some refs to '
Solution:-open gitbash goto project root directory .
chmod 777 *
then again try to git push
it work for me