Recently I was working on getting one of our clients set up with Git to track the clients entire WP install so that updates can easily be rolled back if anything breaks. After initializing an empty repo on BitBucket and the client’s BlueHost account, and adding SSH keys to give permissions for the connection, I tried to push the whole site. I then got an error I had never seen before:

fatal: unable to create thread: Resource temporarily unavailable
error: remote unpack failed: eof before pack header was fully read
To bitbucket.org:fountaincityinc/verdenergia.git
 ! [remote rejected] live -> live (unpacker error)
error: failed to push some refs to 'bitbucket.org:fountaincityinc/verdenergia.git'

Thinking this might have something to do with permissions, I went through and discovered the site had improper site permissions for files and folders. For the most part, folders should be set to 755 and files to 644. Here’s the quick CLI commands to fix that:

#Set all directories recursively to 755:
find . -type d -exec chmod 0755 {} +

#Set all files recursively to 644:
find . -type f -exec chmod 0644 {} +

alas, still didn’t work. Thankfully StackOverflow came to the rescue.

Some people suggested that:

“unable to create thread: Resource temporarily unavailable” means an issue with the remote server (like no more memory available).

but that doesn’t seem right since BitBucket I’m sure has tons of memory.

someone else suggested that:

I’ve also stumbled upon this error. To make it simpler, this error occurs because you want to copy a 100mb file into a hdd with free space of 50mb (or less). To fix this, SSH into the server and run the following commands:

git config --global pack.windowMemory "100m"
git config --global pack.packSizeLimit "100m"

With BlueHost, multi-threading does not work very well there because their shared hosting has limited cpu resources mostly 1 cpu so . This error is due to limited cpu resources. Use this command first for those instances, and then try adding the pack.windowMemory and pack.packSizeLimit

git config --global pack.threads "1"

This is limiting git to create only one thread. Now it works!

Leave a Reply

Your email address will not be published. Required fields are marked *

Post comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.