Wordpress / Site Health / The REST API Error / Loopback Error

2.8k views Asked by At

how are you? I am getting two errors when I use the native WordPress site health feature.

Your site could not complete a loopback request

Loopback requests are used to run scheduled events, and are also used by the built-in editors for themes and plugins to verify code stability.

The loopback request to your site failed, this means features relying on them are not currently working as expected.

Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)

and

The REST API encountered an error

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

The REST API request failed due to an error.
Error: cURL error 35: OpenSSL SSL_connect: Connection reset by peer in connection to mydomain.com:443 (http_request_failed)

Already did:

  • I disabled all plugins.
  • I changed to the default theme.
  • I disabled CSF and ModSecurity on whm.

but without success. How can I resolve this?

2

There are 2 answers

3
derek.z On

I encountered the same two critical issues exactly, in my local development environment.

My WordPress site with the default address 'http://localhost:8000' is running in local docker containers, after adding the extra_hosts part to the docker-compose.yml, the problem resolved.

Here is the working docker-compose.yml

version: '3.3'

services:
   db:
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: somewordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress
   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_USER: wordpress
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_DB_NAME: wordpress
     extra_hosts:
       - "localhost:172.18.0.1"
volumes:
    db_data: {}

Note that 172.18.0.1 is the default docker gateway.

0
The009 On

I got this problem myself when hosting WordPress myself.

It was caused by my network setup. If you are using NAT or your own DNS you will need to do either NAT Reflection or Split DNS.

Your best bet is Split DNS. ( You can look up how to do this depending on your own network server. )

You can find more information from NetGate If use PFSense This will solve your issue. Or hopefully point you in the proper direction.

https://docs.netgate.com/pfsense/en/latest/nat/reflection.html