Linux bash gives fork retry no child processes error

Viewed 5123

I'm running a Nodejs app in Linux server (shared hosting server). Terminal gives this error after one day from running app. I run app then after one day by this command:

ps aux

the result is:

user   5435  1.0  0.0   9916  1820 pts/0    S    16:50   0:00 /bin/bash -l
user   5752  0.0  0.0  49844  1684 pts/0    R+   16:50   0:00 ps aux
user  13658  0.0  0.1 1155556 36060 ?       Sl   05:15   0:06 lsnode:/home1/user/node-server/
user  32346  0.0  0.1 1091012 37944 ?       Sl   Jul04   0:05 lsnode:/home1/user/node-server/
user  32346  0.0  0.1 1091012 37944 ?       Sl   Jul04   0:05 daemon pm2 bash/.pm2

I see 2 node apps running and after this i give this from terminal:

bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: retry: No child processes
bash: fork: Resource temporarily unavailable
bash-4.2$

I have no cron inside my app. how can I solve this 2 months problem! please help me...

1 Answers

The error message means that you reached some limit (too many processes) and the bash can no longer create any process.

The error message "No child processes" is probably the result of calling waitpid after a failed fork. The real error should be "Resource temporarily unavailable". (There seems to be a bug in some bash versions that try waitpid without restoring the errno value.)

Without seeing the source code of your application it is impossible to give a more specific answer.

See also https://unix.stackexchange.com/q/205016/330217 or Linux ssh bash fork retry: no child processes

BTW: I don't think the output of ps aux is correct. I would expect to see much more processes.

Related