{"id":2939,"date":"2019-10-23T17:39:44","date_gmt":"2019-10-23T09:39:44","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&#038;p=2939"},"modified":"2022-10-05T08:00:27","modified_gmt":"2022-10-05T00:00:27","slug":"error-522-connection-timed-out","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/error-522-connection-timed-out","title":{"rendered":"Error 522: Connection timed out"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"2939\" class=\"elementor elementor-2939\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-1a950c7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"1a950c7\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2177b034\" data-id=\"2177b034\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c6c0a5b elementor-widget elementor-widget-heading\" data-id=\"c6c0a5b\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Error 522: Connection Timed Out<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6bf88837 elementor-widget elementor-widget-text-editor\" data-id=\"6bf88837\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<h4><strong>Overview<\/strong><\/h4><p>Error 522 indicates that Cloudflare is unable to reach the origin web server and the request times out.\u00a0<\/p><p>As a first step in troubleshooting Error 522:<\/p><ul><li>Check that the origin web server is active and accepting HTTP requests.<\/li><li>Verify that the DNS settings in your Cloudflare account are correct.<\/li><\/ul><hr \/><h4><strong>Common Causes<\/strong><\/h4><p>Several conditions may cause Error 522 to appear. The most common causes include:<\/p><ul><li>Overloaded web server<\/li><li>Blocked Cloudflare requests<\/li><li>Faulty network routing<\/li><li>Disabled keepalives<\/li><\/ul><p>Other possible causes may also include:<\/p><ul><li>Incorrect IP address in the Cloudflare DNS settings (i.e. the request from us was sent to the wrong place)<\/li><li>Offline origin web server<\/li><li>Dropped packets on the host network<\/li><\/ul><p>Below, you will find additional information for the most common causes.<\/p><h4><strong>Overloaded origin web server<\/strong><\/h4><p>A server could be dropping requests as a result of an overload condition.\u00a0What constitutes a high load can differ depending on the server&#8217;s hardware and software.<\/p><p>Generally, a load average of over 10-20 could mean that the server is overloaded. To check for this on Linux\/Unix, you can run the\u00a0<strong>w<\/strong>\u00a0or\u00a0<strong>top<\/strong>\u00a0commands in the terminal window.<\/p><p>If you&#8217;re unable to verify web server load on your own, check with your host or a system administrator.<\/p><h4><strong>Blocked Cloudflare requests<\/strong><\/h4><p>Blocking Cloudflare requests is the most common cause of intermittent 522 errors.<\/p><p>When traffic flows through a Cloudflare-enabled website, the origin web server sees all requests as coming from a handful of Cloudflare IP addresses. This can often trigger firewalls and IP rate-limiters to block Cloudflare requests, thinking that the website is under attack.\u00a0<strong>CPHulk<\/strong>\u00a0(which comes with\u00a0<strong>cPanel<\/strong>) and other services have been known to do this.<\/p><p>To avoid this situation, make sure that:<\/p><ul><li style=\"list-style-type: none;\"><ul><li>Cloudflare IPs are not being blocked in .htaccess, iptables, or your firewall.<\/li><\/ul><\/li><\/ul><ul><li style=\"list-style-type: none;\"><ul><li>Your hosting provider isn&#8217;t rate limiting or blocking requests from Cloudflare IPs. Ask the host to whitelist the\u00a0<a href=\"http:\/\/www.cloudflare.com\/ips\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Cloudflare IP addresses<\/a>\u00a0.<\/li><\/ul><\/li><\/ul><p>In addition, your host provider might wish to disable the rate limiter<span style=\"color: #0274be;\"><span style=\"background-color: #d5d5d5;\">.<\/span><\/span><\/p><h4><strong>Faulty network routing<\/strong><\/h4><p>Faulty network routing between Cloudflare and the origin web server is more difficult to troubleshoot than the other causes. Before checking for this, first rule out the other potential causes.<\/p><p>If you believe network issues might be the cause, file a ticket with Cloudflare support. Useful information to provide in your ticket includes:<\/p><ul><li>Details about what you have checked so far<\/li><li>An\u00a0MTR or traceroute\u00a0from your server to a Cloudflare IP address, preferably one of the IP addresses from which you have seen requests from Cloudflare in the past<\/li><\/ul><h4><strong>Disabled keepalives<\/strong><\/h4><p>Cloudflare uses\u00a0the Keep-Alive header\u00a0to improve performance. Disabling it in the origin web server causes connections to fail and return a 522 error in some circumstances. This feature is enabled by default in most major web servers, so unless you&#8217;ve explicitly disabled it, this shouldn&#8217;t be an issue.<\/p><hr \/><h4><strong>Understand how Error 522 is trigger<\/strong><\/h4><p>When someone visits a Cloudflare-enabled website, a connection is establish between Cloudflare and the website&#8217;s origin server. To establish a connection, TCP uses a three-way handshake.<\/p><ol><li>SYN: Cloudflare sends three SYN packets to the origin server.<\/li><li>SYN+ACK: In response, the origin server replies with a SYN+ACK.<\/li><li>ACK: Finally, Cloudflare sends an ACK back to the origin server.<\/li><\/ol><p>At this point, both Cloudflare and the origin server have receive an acknowledgement of the connection, and communication is establish. If the origin server does not send a SYN+ACK back to Cloudflare within 15 seconds, a 522 error will occur and the connection is close.<\/p><p>This diagram illustrates a successful TCP handshake:<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-2961 size-medium\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/s1-1-300x97.png\" alt=\"\" width=\"300\" height=\"97\" \/><\/p><p>The next diagrams shows that the SYN+ACK is not return from the origin web server within 15 seconds, triggering the Error 522 timeout:<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2963\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/s2-300x93.png\" alt=\"\" width=\"300\" height=\"93\" \/><\/p><p>Another condition for an Error 522 timeout occurs when the origin responds with a SYN+ACK and established a TCP connection, but never responds to the request with an ACK within 90 seconds (A 524 condition ACKs the request, but waits too long to send the response). Here is an illustration detailing this scenario:<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-2964\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/s3-300x103.png\" alt=\"\" width=\"300\" height=\"103\" \/><\/p><p>Checking for these conditions with your server administrator or hosting provider is the best way to resolve these errors. If there is a network problem, a\u00a0traceroute\u00a0or MTR from the site origin is also useful.<\/p><p>If you continue to see 522 errors after ruling out the aforementioned possibilities and troubleshooting the issue, contact Cloudflare Support for further investigation.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Error 522: Connection Timed Out Overview Error 522 indicates that Cloudflare is unable to reach the origin web server and the request times out. As a first step in troubleshooting Error 522: Check that the origin web server is active and accepting HTTP requests. Verify that the DNS settings in your Cloudflare account are correct. &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.mondoze.com\/guide\/kb\/error-522-connection-timed-out\"> <span class=\"screen-reader-text\">Error 522: Connection timed out<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[53],"kbtag":[110],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2939"}],"collection":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/comments?post=2939"}],"version-history":[{"count":12,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2939\/revisions"}],"predecessor-version":[{"id":17729,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/2939\/revisions\/17729"}],"wp:attachment":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/media?parent=2939"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=2939"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtag?post=2939"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=2939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}