Ask Your Question

cannot allocate memory - fork

asked 2013-11-14 17:30:30 -0600

mmrobins gravatar image

Using Puppet 3.1.0 when I run puppet apply I'm getting the following error:

Error: /Stage[main]/Vsftpd/Service[vsftpd]: Could not evaluate: Cannot allocate memory - fork(2)
Error: /Stage[main]/Graphite::Install/Package[whisper]: Could not evaluate: Cannot allocate memory -  /usr/bin/pip freeze 2>&1
Error: /Stage[main]/Myclass/Exec[myexec]/returns: change from notrun to 0 failed: Cannot allocate memory - fork(2)

I can run the commands outside puppet and don't get this problem.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2013-11-14 17:33:28 -0600

mmrobins gravatar image

Right after posting the question I realized I didn't have any swap and my newly created box:

 >free -m
             total       used       free     shared    buffers     cached
Mem:           491        444         46          0         13         88
-/+ buffers/cache:        342        148
Swap:            0          0          0

Here's a guide I used on Digital Ocean to add the swap partion, but it should apply pretty well for Ubuntu systems anywhere. After adding swap my "cannot allocate memory -fork" errors were gone.

edit flag offensive delete link more

answered 2015-06-01 14:54:46 -0600

rglaue gravatar image

If you are experiencing this issue on the puppet master, use puppetserver.

Your puppet agents might be receiving an error message like: "Could not retrieve catalog from remote server: Error 400 on SERVER: Failed when searching for node Cannot allocate memory - fork(2)"

A restart of "puppetmaster" fixes the issue temporarily. The issue is a known memory leak issue with ruby (See also: The recommendation is to use "puppetserver". It is available from the puppetlabs-products repository.

Also see that the Rack and WEBrick daemon options for puppet master are deprecated:

See also Puppet Server:

Puppet Server is an application that runs on the Java Virtual Machine (JVM) and provides the same services as the classic Puppet master application.

edit flag offensive delete link more

answered 2015-07-06 23:07:35 -0600

Ishu gravatar image

Check First the memory by using command "df -H" on your server. If the memory is ok than reboot your system with "sudo su reboot" and it will work fine..

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-11-14 17:30:30 -0600

Seen: 11,364 times

Last updated: Jul 06 '15