{"id":2486,"date":"2020-06-20T13:00:00","date_gmt":"2020-06-20T12:00:00","guid":{"rendered":"https:\/\/chewett.co.uk\/blog\/?p=2486"},"modified":"2020-06-18T18:43:13","modified_gmt":"2020-06-18T17:43:13","slug":"fixing-fork-failed-resource-temporarily-unavailable-on-linux","status":"publish","type":"post","link":"https:\/\/chewett.co.uk\/blog\/2486\/fixing-fork-failed-resource-temporarily-unavailable-on-linux\/","title":{"rendered":"Fixing &#8220;fork failed: Resource temporarily unavailable&#8221; on Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"254\" data-attachment-id=\"2487\" data-permalink=\"https:\/\/chewett.co.uk\/blog\/2486\/fixing-fork-failed-resource-temporarily-unavailable-on-linux\/fixing_ulimit_post_header\/\" data-orig-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?fit=800%2C300&amp;ssl=1\" data-orig-size=\"800,300\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"fixing_ulimit_post_header\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?fit=300%2C113&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?fit=678%2C254&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?resize=678%2C254&#038;ssl=1\" alt=\"\" class=\"wp-image-2487\" srcset=\"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?w=800&amp;ssl=1 800w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?resize=300%2C113&amp;ssl=1 300w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?resize=768%2C288&amp;ssl=1 768w, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_post_header.jpg?resize=50%2C19&amp;ssl=1 50w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/figure>\n\n\n\n<p>This blog post talks about how you can fix the error &#8220;fork failed: Resource temporarily unavailable&#8221; on Linux.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">What this message means<\/h2>\n\n\n\n<p>This message typically means that the operating system has limited your ability to &#8220;fork&#8221;. This typically will stop you creating new threads or processes on Linux.<\/p>\n\n\n\n<p>This issue can occur when the ulimit settings have been set too low. Some server management tools such as CPanel will limit processes and this can stop you logging into your server.<\/p>\n\n\n\n<p>To resolve this you will need to log in with an unlimited account, typically root, to modify some of the settings.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Fixing &#8220;fork failed: Resource temporarily unavailable&#8221;<\/h2>\n\n\n\n<p>To fix this we are going to need to change some of the default ulimit settings.<\/p>\n\n\n\n<p>To do this we need to find and modify any ulimit settings that may be limiting your user. You are looking for lines that look like this or similar:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nulimit -n 100 -u 35\n<\/pre><\/div>\n\n\n<p>This command limits the number of open files descriptors to 100 and the number of processes to 35. If you are seeing &#8220;fork failed&#8221; you will want to increase these numbers.<\/p>\n\n\n\n<p>Here is a list of the following places this might be set, you will want to review all of these files to see where the limit might be set:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/etc\/bashrc\n\/etc\/profile\n<\/pre><\/div>\n\n\n<p>Some people will customise their single server with -n and -u values of 64000 as this means they should not hit any limits.\\<\/p>\n\n\n\n<p>You may want to have a play around with limits, especially if the server is shared as you may not want one using monopolising the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post talks about how you can fix the error &#8220;fork failed: Resource temporarily unavailable&#8221; on Linux.<\/p>\n","protected":false},"author":1,"featured_media":2488,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Today I post a short post about how to fix \"fork failed: Resource temporarily unavailable\" on #Linux","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[381,39,382],"class_list":["post-2486","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-informational","tag-fork","tag-linux","tag-ulimit"],"wppr_data":{"cwp_meta_box_check":"No"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2020\/06\/fixing_ulimit_posticon.jpg?fit=800%2C800&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p2toWX-E6","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":2827,"url":"https:\/\/chewett.co.uk\/blog\/2827\/the-risks-of-windows-and-linux-line-endings-in-git-with-pogoapi\/","url_meta":{"origin":2486,"position":0},"title":"The Risks of Windows and Linux Line endings in Git with PoGoAPI","author":"Chewett","date":"March 6, 2021","format":false,"excerpt":"This talks about the minor changes needed for the api_hashes api to allow verifying API's. Original Problem Someone contacted me and said they couldnt verify the API's against the hashes I provided. I looked into this and locally there didnt seem to be an issue as the API's matched directly.\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/03\/pogoapi_git_issues_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/03\/pogoapi_git_issues_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/03\/pogoapi_git_issues_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/03\/pogoapi_git_issues_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2021\/03\/pogoapi_git_issues_posticon_OUTPUT.png?fit=1200%2C628&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":678,"url":"https:\/\/chewett.co.uk\/blog\/678\/apt-unable-lock-administration-directory-varlibdpkg-another-process-using\/","url_meta":{"origin":2486,"position":1},"title":"apt Unable to lock the administration directory (\/var\/lib\/dpkg\/) is another process using it?","author":"Chewett","date":"October 4, 2017","format":false,"excerpt":"This post explains why you may sometimes not be able to run apt commands and how to find out what is causing the issue. Why apt sometimes cannot get a lock apt-get is one of the package administration programs for a range of Linux based operating systems. This manages the\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/apt_unable_to_lock_admin_dir.jpg?fit=800%2C800&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/apt_unable_to_lock_admin_dir.jpg?fit=800%2C800&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/apt_unable_to_lock_admin_dir.jpg?fit=800%2C800&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2017\/10\/apt_unable_to_lock_admin_dir.jpg?fit=800%2C800&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":103,"url":"https:\/\/chewett.co.uk\/blog\/103\/irc-client-on-raspberry-pi-screen-and-irssi\/","url_meta":{"origin":2486,"position":2},"title":"IRC client on Raspberry Pi &#8211; Screen and irssi","author":"Chewett","date":"February 20, 2013","format":false,"excerpt":"A IRC client lets you connect to\u00a0a IRC server enabling you to join chatrooms on that server. IRC servers do not by default store logs while you are not logged in. This can be annoying if you wish to keep informed of whats going in on the chatroom. One solution\u2026","rel":"","context":"In &quot;Software&quot;","block_context":{"text":"Software","link":"https:\/\/chewett.co.uk\/blog\/category\/software\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":194,"url":"https:\/\/chewett.co.uk\/blog\/194\/mysql-workbench-working-with-key-based-exchange-mechanisms\/","url_meta":{"origin":2486,"position":3},"title":"Mysql workbench working with key based exchange mechanisms","author":"Chewett","date":"June 3, 2015","format":false,"excerpt":"It appears newer linux sshd configs\u00a0(fedora 22) by default include a smaller set of key exchange based mechanisms that they have turned on. This means that it gives errors saying it is unable to connect to the server. To fix this you need to enable some of the older key\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":453,"url":"https:\/\/chewett.co.uk\/blog\/453\/automatic-installation-commonly-used-packages\/","url_meta":{"origin":2486,"position":4},"title":"Automatic installation of commonly used packages","author":"Chewett","date":"July 15, 2017","format":false,"excerpt":"A number of years ago I was introduced to using Linux day to day. During this period of time I ran a large number of virtual machines to test its performance and various aspects which make it \"linux\". Typically when I first set up a system I would install a\u2026","rel":"","context":"In &quot;Informational&quot;","block_context":{"text":"Informational","link":"https:\/\/chewett.co.uk\/blog\/category\/informational\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":258,"url":"https:\/\/chewett.co.uk\/blog\/258\/vchi-initialization-failed-raspberry-pi-fixed\/","url_meta":{"origin":2486,"position":5},"title":"VCHI initialization failed Raspberry Pi Fixed","author":"Chewett","date":"October 26, 2016","format":false,"excerpt":"If when running vcgencmd on a raspberry pi you get\u00a0VCHI initialization failed then you need to add the video group to your user. The vcgencmd tool requires you have this group role so without it, it will give VCHI initialization failed. To add the user group to your user you\u2026","rel":"","context":"In &quot;Fixes&quot;","block_context":{"text":"Fixes","link":"https:\/\/chewett.co.uk\/blog\/category\/fixes\/"},"img":{"alt_text":"vcgencmd get_mem arm VCHI initialization failed","src":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2016\/10\/vchi_init_failed.png?resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2016\/10\/vchi_init_failed.png?resize=350%2C200 1x, https:\/\/i0.wp.com\/chewett.co.uk\/blog\/wp-content\/uploads\/2016\/10\/vchi_init_failed.png?resize=525%2C300 1.5x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2486","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=2486"}],"version-history":[{"count":1,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2486\/revisions"}],"predecessor-version":[{"id":2489,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/posts\/2486\/revisions\/2489"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media\/2488"}],"wp:attachment":[{"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=2486"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=2486"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chewett.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=2486"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}