WordPress loopback fails on check.
Last Updated on by
After WordPress health check, loopback request shows errored or delayed.
In my experience, there are two causes I have identified for this issue.
- DNS is not resolving and cURL is failing to find the expected results.
- A plugin is installed which is breaking the cURL response.
1. DNS is not resolving
First, it is critical to understand the error; so, install curl in server where wordpress is executed.
apt -y install curl
Now, run curl in verbose mode against https request as indicated by Loopback.
The loopback request to your site failed, this may prevent WP_Cron from working, along with theme and plugin editors. Error encountered: (0) cURL error 7: Failed to connect to www.ampeduphome.com port 443: Connection refused
So, in my case I ran against www.ampeduphome.com
curl -v https://www.ampeduphome.com
Ran, and below is the resulted output…
root@web01:~# curl -v https://www.ampeduphome.com * Rebuilt URL to: https://www.ampeduphome.com/ * Trying 188.8.131.52... * TCP_NODELAY set * connect to 184.108.40.206 port 443 failed: Connection refused * Trying 220.127.116.11... * TCP_NODELAY set * connect to 18.104.22.168 port 443 failed: Connection refused * Failed to connect to www.ampeduphome.com port 443: Connection refused * Closing connection 0 curl: (7) Failed to connect to www.ampeduphome.com port 443: Connection refused
What the heck, why is the ip 22.214.171.124. That is not my ip; so, where did it come from? DIG, it is very helpful in situations such as this! More info, check here if interested in installing. For your info, check out 6. Install dnsutils that is the section that get dig on a server. So, I ran dig like this.
dig www.ampeduphome.com A
root@web01:~# dig www.ampeduphome.com A ; <<>> DiG 9.10.3-P4-Debian <<>> www.ampeduphome.com A ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 23513 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 512 ;; QUESTION SECTION: ;www.ampeduphome.com. IN A ;; ANSWER SECTION: www.ampeduphome.com. 1799 IN A 126.96.36.199 ;; Query time: 85 msec ;; SERVER: 188.8.131.52#53(184.108.40.206) ;; WHEN: Tue Jan 22 17:34:47 CST 2019 ;; MSG SIZE rcvd: 64
Well there it is, google dns is reporting back 220.127.116.11! Ok, I do not have time for errors like this!!! How is google doing this? I do not know, so the only thing I can do for now is fix my local dns resolver. Next thing to do, modify resolv.conf.
Now, this is what resolv.conf looks like.
domain ampeduphome.com search ampeduphome.com. nameserver 18.104.22.168 nameserver 192.168.100.1 nameserver 22.214.171.124
So, simply added 126.96.36.199 to the top of the list for now. Also, I looked at my DNS on https://my.ionos.com and it is correct. Whatever, not sure what is up google’s butt at this time. It is not resolving my domain correctly at this time. This should be temporary as all is correct on my DNS. Also can run this. If you do not want to, here is the output:
Anyway, eventually google came back correct so I reverted back to original resolv.conf
domain ampeduphome.com search ampeduphome.com. nameserver 192.168.100.1 nameserver 188.8.131.52
2. Plugin causes Loopback issues.
So after fixing the first issue, I had another issue. This time, cURL would timeout when Loopback check was performed. Here are the errors:
Next, I ran the Test without plugins. The result, it worked; so, the issue was plugin related.
Result from testing without any plugins active and a default theme: The loopback request to your site completed successfully.
Then, I ran “Test individual plugins”. This resulted in the culprit.
Finally, disabled plugin and Health Check completes without error.