Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git, error: remote unpack failed: unable to create temporary object directory - By creating new Branch

Tags:

I'm trying to create a new branch in my repo.

I did this:

git branch events 
git Checkout events 

That 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 events 

This 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 http://git.int.censoredlink/scm/freeb/freebrep.git                                                                                         ! [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.

like image 577
Störungs Sucher Avatar asked Jul 24 '18 09:07

Störungs Sucher


2 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: http://git.int.censoredlink/scm/freeb/freebrep.git 

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.

like image 192
torek Avatar answered Sep 20 '22 06:09

torek


If you are working as a root user, please first change the user to your git user and then init your git directory:

  1. if you are root -> $ [root@server ~]#
  2. change user -> $ su - username
  3. init a git repo -> [username@server ~] $ git init --bare git-repo.git
  4. 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).

like image 24
Ghasem Sadeghi Avatar answered Sep 21 '22 06:09

Ghasem Sadeghi