GitLab docker cannot fork Resource temporarily unavailable
I had the same problem with a vServer which looks pretty much like your machine.
I guess that the problem is a limit on the processes that can run at the same time. Probably you are limited by 400 but you need more to run your compose network.
cat /proc/user_beancounters | grep numproc
The response is formatted like this: held, maxheld, barrier, limit
If you run this command, you should be able to see that you are very close to exceeding the limit (if I'm right with my assumption).
Checkout this link, they talk about Java, but the general problem is the same:
https://debianforum.de/forum/viewtopic.php?t=180774
Cygwin error: -bash: fork: retry: Resource temporarily unavailable
(assuming Cygwin is installed at C:\Cygwin):
- Open Task Manager and close any processes that look to be Cygwin related.
- Open C:\Cygwin\bin in Windows Explorer
- Verify that dash.exe, ash.exe, rebase.exe, and rebaseall exist in this folder
- If any of them are missing, re-run Cygwin setup and select the dash, ash, and rebase packages
- right-click your C:\Cygwin folder, uncheck Read-only (if its checked), and press OK.
- When an error about not being able to switch some files comes up, select "Ignore All". Wait for this process to complete.
- Browse to C:\Cygwin\bin in Windows Explorer
- Right click dash.exe and click "Run as Administrator". A command Prompt should appear with nothing but a
$
- Type
/usr/bin/rebaseall -v
, hit enter, and wait for the process to complete.- If you get errors about Cygwin processes running, try Step 1 again. If that still doesn't work, Restart your computer into safe mode and try these steps again.
- A commenter noted that, depending on your settings, you may have to type
cd /usr/bin && ./rebaseall -v
instead.
- Try opening Cygwin again.
This process worked for me. I hope it works for you guys too.
Source: http://cygwin.wikia.com/wiki/Rebaseall
Bash fork retry: Resource temporarily unavailable
Type in 'jobs' at shell prompt.
How many jobs are left over after you previously ran this script?
I am guessing while testing this you have left over jobs after each run of script and after running your script a few times there are too many jobs.
"fork: Resource temporarily unavailable" means you are hitting up against a system limit. I have seen it when out of memory or you could be out of allowed sub-=processes. Type 'ulimit -a' to check the limits.
Also . . .
There is nothing in your script which limits temp_ip to just 30 entries either?
You maybe could log how big temp_ip is (echo $temp_ip |wc -l).
You could use head -30 or mysql to make sure a max of 30 entries are returned?
function testfunc { echo testfunc; sleep 30; echo testfunc END; }
temp_ip="a b
c d
e f
g h
i j
k l
m n
o p
q r
s t
u v
w x
y z
a b
c d
e f
g h
i j
k l
m n
o p
q r
s t
u v
w x
y z
a b
c d
e f
g h"
Now repeat this . . . a few times and check 'jobs'.
while read ip codesite;do { echo $ip; testfunc $ip & }
done<<<"$temp_ip"
With a process ulimit of 1024 I seem to be able to run this 15 times before trouble starts. I get about 450 jobs in list before trouble.
trouble is like this:
-bash: fork: retry: Resource temporarily unavailable
testfunc
-bash: fork: retry: No child processes
testfunc
-bash: fork: retry: No child processes
testfunc
-bash: fork: retry: No child processes
bash fork error (Resource temporarily unavailable) does not stop, and keeps showing up every time I try to kill/reboot
Given that you can login, you may want to try using exec
to execute all your commands. After executing exec
you will have to log in again, since exec
will kill your shell (by replacing it with the command you run).
exec
won't take up an extra process slot because it will replaces the running shell with the program to run. Thus, it should be able to bypass the ulimit
restriction.
Related Topics
Elf Header or Installation Issue with Bcrypt in Docker Container
Bash "Declare -A" Does Not Work on MACos
How to Send a Sequence of at Commands to a Serial Port in Bash
How to Build a Linux Kernel Module So That It Is Compatible with All Kernel Releases
Error: Could Not Find Tiller' When Running 'Helm Version'
Linux: Writes Are Split into 512K Chunks
Linux Newbie: Linux VS Posix Manual
How to Use Code Completion into Eclipse with Opencv
History Command Works in a Terminal, But Doesn't When Written as a Bash Script
G++ Searches /Lib/../Lib/, Then /Lib/
Difference Between Printf and Echo in Bash
How to Cut an Existing Variable and Assign to a New Variable in Bash
Using Bash Environment Variables from Within a Perl Script
Distinguish .Shstrtab and .Strtab in Elf File