{"id":847,"date":"2024-07-06T07:14:27","date_gmt":"2024-07-06T07:14:27","guid":{"rendered":"https:\/\/linuxresellerwebhosting.in\/blog\/?p=847"},"modified":"2024-07-06T08:35:28","modified_gmt":"2024-07-06T08:35:28","slug":"ah01075-error-dispatching-request","status":"publish","type":"post","link":"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/","title":{"rendered":"AH01075: Error dispatching request to \u2013 How to fix in Plesk"},"content":{"rendered":"<p>users may notice the error \u201cAH01075: Error dispatching request to\u201d in the domain\u2019s error logs along with a \u201c504 Gateway Time-out\u201d or \u201c503 Service Temporarily Unavailable\u201d error on the website<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Plesk_%E2%80%9CAH01075_Error_dispatching_request_to%E2%80%9D\"><\/span>Plesk \u201cAH01075: Error dispatching request to\u201d<span class=\"ez-toc-section-end\"><\/span><\/h2><div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/#Plesk_%E2%80%9CAH01075_Error_dispatching_request_to%E2%80%9D\" >Plesk \u201cAH01075: Error dispatching request to\u201d<\/a><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><ul class='ez-toc-list-level-4' ><li class='ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/#503_Service_Temporarily_Unavailable_on_Plesk\" >503 Service Temporarily Unavailable on Plesk<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/#504_Gateway_Time-out_on_website\" >504 Gateway Time-out on website<\/a><ul class='ez-toc-list-level-5' ><li class='ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/#Increase_the_FastCGI_limits_for_a_single_domain\" >Increase the FastCGI limits for a single domain:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-5'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/linuxresellerwebhosting.in\/blog\/ah01075-error-dispatching-request\/#Increase_the_FastCGI_limits_server-wide\" >Increase the FastCGI limits server-wide:<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n<p>Moving ahead, let us see how our Support Techs go about these errors.<\/p>\n<h4><span class=\"ez-toc-section\" id=\"503_Service_Temporarily_Unavailable_on_Plesk\"><\/span><strong>503 Service Temporarily Unavailable on Plesk<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>Symptoms of this error include:<\/p>\n<ul>\n<li>The \/var\/www\/vhosts\/example.com\/logs\/error_log file shows:<\/li>\n<\/ul>\n<pre>[proxy_fcgi:error] [pid 350:tid 139649016084224] (104)Connection reset by peer: [client 203.0.113.2:58642] AH01075: Error dispatching request to :, referer: http:\/\/example.com\/wordpress\/wp-admin\/upload.php<\/pre>\n<ul class=\"nitro-offscreen\">\n<li>`dmesg` command output shows:<\/li>\n<\/ul>\n<pre class=\"nitro-offscreen\">[4289853.349670] php-cgi[49424]: segfault at 30 ip 00007fc662113088 sp 00007fc630ad3d10 error 4\r\n[4289853.349672] in libMagickCore.so.5.0.0[7fc661f8e000+237000]<\/pre>\n<p class=\"nitro-offscreen\">An ImageMagick library bug can cause this error.<\/p>\n<p class=\"nitro-offscreen\">In order to fix this, we disable the Imagick PHP module for PHP handler for the website:<\/p>\n<ol class=\"nitro-offscreen\">\n<li>To do so, we log in to Plesk<\/li>\n<li>Browse to\u00a0<strong>Tools &amp; Settings &gt; PHP Settings<\/strong><\/li>\n<li>Then click on the <strong>PHP handler<\/strong> that is set for the domain, e.g. PHP 8.0:<\/li>\n<li>To disable the extension, we <strong>Uncheck<\/strong> the Imagick checkbox:<\/li>\n<li>Later, we ensure that no sites are using this module.<\/li>\n<\/ol>\n<p class=\"nitro-offscreen\">Make note that these settings are common to the 8.0<strong>\u00a0CGI applications<\/strong>, 8.0<strong>\u00a0FastCGI applications<\/strong>. The settings apply to all websites that use these handlers.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-854 size-full\" src=\"https:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2024\/07\/AH01075.png\" alt=\"AH01075: Error dispatching request\" width=\"706\" height=\"453\" srcset=\"https:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2024\/07\/AH01075.png 706w, https:\/\/linuxresellerwebhosting.in\/blog\/wp-content\/uploads\/2024\/07\/AH01075-300x192.png 300w\" sizes=\"auto, (max-width: 706px) 100vw, 706px\" \/><\/p>\n<h4 class=\"nitro-offscreen\"><span class=\"ez-toc-section\" id=\"504_Gateway_Time-out_on_website\"><\/span><strong>504 Gateway Time-out on website<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p class=\"nitro-offscreen\">Symptoms of this error include:<\/p>\n<ul class=\"nitro-offscreen\">\n<li>Website example.com is not accessible. We come across the below error in a browser:<\/li>\n<\/ul>\n<pre class=\"nitro-offscreen\">504 Gateway Time-out<\/pre>\n<ul class=\"nitro-offscreen\">\n<li>In the domain error log file, <strong>Domains &gt; example.com &gt; Logs<\/strong>,\u00a0we see the error:<\/li>\n<\/ul>\n<pre class=\"nitro-offscreen\">[proxy_fcgi:error] [pid 42290:tid 140458047010560] (70007)The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to :, referer: http:\/\/example.com\/gallery<\/pre>\n<ul class=\"nitro-offscreen\">\n<li>In the<strong> Plesk &gt; Domains &gt; example.com &gt; PHP Settings<\/strong> it shows the website uses a \u201cFastCGI application\u201d (not an \u201cFPM application\u201d) PHP handler.<\/li>\n<\/ul>\n<p class=\"nitro-offscreen\">The cause of this error can be the execution PHP code of the website takes longer than the specified timeout.<\/p>\n<p class=\"nitro-offscreen\">To fix the issue, we increase the timeout. We can increase the FastCGI limits for an affected domain only or on a server-wide level.<\/p>\n<h5 class=\"nitro-offscreen\"><span class=\"ez-toc-section\" id=\"Increase_the_FastCGI_limits_for_a_single_domain\"><\/span><strong>Increase the FastCGI limits for a single domain:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ol class=\"nitro-offscreen\">\n<li>Log into Plesk<\/li>\n<li>Then, go to <strong>Domains &gt; example.com &gt; Apache &amp; Nginx Settings<\/strong>.<\/li>\n<li>We add the following lines to the text boxes <strong>Additional directives for HTTP<\/strong> and <strong>Additional directives for HTTPS<\/strong>:\n<pre><code>FcgidIdleTimeout 1200\r\nFcgidProcessLifeTime 1200\r\nFcgidConnectTimeout 1200\r\nFcgidIOTimeout 1200\r\nTimeout 1200\r\nProxyTimeout 1200<\/code><\/pre>\n<p>However, if the website still shows \u201c504 Gateway Timeout\u201d we increase timeouts to higher values.<\/li>\n<li>Finally, we click <strong>OK<\/strong>\u00a0to apply the changes.<\/li>\n<\/ol>\n<h5 class=\"nitro-offscreen\"><span class=\"ez-toc-section\" id=\"Increase_the_FastCGI_limits_server-wide\"><\/span><strong>Increase the FastCGI limits server-wide:<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h5>\n<ol class=\"nitro-offscreen\">\n<li>We connect to the Plesk server via SSH as the root user.<\/li>\n<li>Then we open the FastCGI configuration file fcgid.conf in a text editor. The location of the file depends on the operating system:<br \/>\n(a) for CentOS\/RHEL\/CloudLinux distributions:<\/p>\n<pre><code>\/etc\/httpd\/conf.d\/fcgid.conf<\/code><\/pre>\n<p>(b) for Debian\/Ubuntu distributions:<\/p>\n<pre><code>\/etc\/apache2\/mods-enabled\/fcgid.conf<\/code><\/pre>\n<\/li>\n<li>Eventually, we increase FastCGI timeout limits:<\/li>\n<\/ol>\n<pre>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0FcgidIdleTimeout 1200\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0FcgidProcessLifeTime 1200 \r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0FcgidConnectTimeout 1200 \r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0FcgidIOTimeout 1200<\/pre>\n<ol class=\"nitro-offscreen\">\n<li>If we use FPM PHP handler to create \/etc\/httpd\/conf.modules.d\/00-proxy_timeout.conf then we add the following lines into it:<\/li>\n<li>\n<pre><code>Timeout 1200\r\nProxyTimeout 1200<\/code><\/pre>\n<\/li>\n<li>Then we test configuration with \u201capachectl configtest\u201d command. The output will be similar to:\n<pre><code># apachectl configtest\r\nSyntax OK<\/code><\/pre>\n<\/li>\n<li>Then we restart Apache:<br \/>\n(a) for CentOS\/RHEL-based operating systems:<\/p>\n<pre><code># service httpd restart<\/code><\/pre>\n<p>(b) for Debian\/Ubuntu-based operating systems:<\/p>\n<pre><code># service apache2 restart<\/code><\/pre>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>users may notice the error \u201cAH01075: Error dispatching request to\u201d in the domain\u2019s error logs along with a \u201c504 Gateway<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[1],"tags":[],"class_list":["post-847","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/comments?post=847"}],"version-history":[{"count":9,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/847\/revisions"}],"predecessor-version":[{"id":857,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/posts\/847\/revisions\/857"}],"wp:attachment":[{"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/media?parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/categories?post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxresellerwebhosting.in\/blog\/wp-json\/wp\/v2\/tags?post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}