APatchworkBoy

Active Member
Feb 26, 2018
27
7
3
West Yorkshire, UK
cPanel Access Level
Root Administrator
Every now and again when performing a git push from my local machine up to my staging repo on the server, I receive a "fatal: unable to create threaded lstat" error (thrown by this line in Git: git/git)

If I wait a few minutes and try again the push goes through, so it's not catastrophic, merely an irritant.

Any ideas what needs changing server-side?

Have checked
Code:
ulimit -v
output, which responds with 'unlimited' so it's not that...

SO implies it could be a resource limit somewhere, just not entirely sure where, and that it can be dodged by using
Code:
git config core.preloadIndex false
... but I'd rather just fix the resource limit than fudge around it.

Any suggestions?
 

APatchworkBoy

Active Member
Feb 26, 2018
27
7
3
West Yorkshire, UK
cPanel Access Level
Root Administrator
So, I set:
Code:
git config core.preloadIndex false
...and immediately began getting bash: fork: retry: Resource temporarily unavailable errors instead of the previous git error. Setting the above git config value back to true causes the original git error from OP to return.

Code:
ulimit -u
...reveals this user's soft nproc limit is at 35, and hard is unlimited.
/etc/security/limits.conf and /etc/security/limits.d/90-nproc.conf however are both set to override this and set it to a value MUCH higher (2048) - it would appear that this isn't applying, or is being overridden elsewhere (?)
 
Last edited:

APatchworkBoy

Active Member
Feb 26, 2018
27
7
3
West Yorkshire, UK
cPanel Access Level
Root Administrator
Solution: disable Shell Fork Bomb Protection via WHM. Log out, log back in.
Limits are then as per limits.conf / 90-nproc.conf.

With Shell Fork Bomb Protection enabled, nproc soft limit is 35 regardless of what you set in the above conf files, as outlined at Shell Fork Bomb Protection - Version 76 Documentation - cPanel Documentation, so I've set limits manually as follows to replicate the Shell Fork Bomb Protection for all users:

Code:
*          soft    core     200000
*          soft    data     200000
*          soft    rss      200000
*          soft   nofile    100
*          soft    stack    8192
*          soft    nproc    35
...and then overridden nproc and nofile on a per-user basis.
 
Last edited: