• I’ve had this site up for a few years now; up until a couple of weeks ago everything worked just fine. I’m running a couple of sites on the same machine with Apache Virtual hosts; my current setup, since I’m running a few different servers, is Cloudflare→Apache Reverse Proxy→Wordpress. What I’m running into, and currently banging my head against, is two recommended improvements:

    • A scheduled event, *fill in event*, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended
    • The REST API did not process the context query parameter correctly

    Problem is no cron jobs are running, so no scheduled email sends for upcoming appointments, events, virtual meetings, etc. I’m not a programmer or web guru; I’m doing this on the side for a personal business and have, up until now, been able to troubleshoot and solve most issues, but this one is being persistent. I’ve got another site, on another virtual host, set up exactly the same way, from Cloudflare through the Apache reverse proxy to the virtual host, and it has zero issues.

    So far, I’ve disabled all plugins and reverted to a default theme (Twenty Twenty-Three), disabled Cloudflare protection, reverted to a complete backup from when the REST API worked, and event deleted the entire WordPress directory and started from a fresh install, all to no avail. Even the fresh install, with a blank database and no plugins, reported the same 2 errors.

    I’ve enabled the debug log, and nothing shows up but 1 deprecated php issue that I fixed. Apache error logs aren’t throwing anything either. I’ve switched the cron queue to the system cron, bumped the WP memory and PHP memory, bumped the PHP timeout, ran through a few different plugin conflict checkers (which found absolutely nothing), but still no luck. Emails and notifications in response to an action (account registration, booked appointment, etc.) send just fine, and work just fine, but anything relying on WP cron is not working.

    Everything is up to date, running php 8.0 and WP 6.2 on Ubuntu. I’m inclined to believe maybe this is an issue with the reverse proxy/VH setup in Apache, but I don’t understand why another site with the same configs, albeit fewer plugins, works perfectly fine.

    At this point, sorta at a loss. I don’t understand why a backup, which I know for 100% certainty, worked just fine, doesn’t work. The only thing I can figure is that I did have an issue with the hard drive of the machine running both sites at the end of March that required a complete wipe and restore, and that I may not have set up the Apache VH config the same, but I still can’t figure out why one site would work after the restore but not the other.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there,

    I’m inclined to believe maybe this is an issue with the reverse proxy/VH setup in Apache, but I don’t understand why another site with the same configs, albeit fewer plugins, works perfectly fine.

    It does sound like that indeed, specifically that GET parameters are not passed to your WordPress install.

    Let’s look at these error messages.

    A scheduled event, *fill in event*, failed to run. Your site still works, but this may indicate that scheduling posts or automated updates may not work as intended

    Cron jobs are executed by an internal request to ?doing_wp_cron=<number>. This message indicates that this cron job is not executed. A reason could be that the request is stripped of that GET parameter.

    The REST API did not process the context query parameter correctly

    Here, the Site Health check issues a request to /wp-json/wp/v2/types/post?context=edit. The error indicates that the request was made without the context parameter.

    An easy way to identify this is to look at your server’s access log and check request made to your site and if they include these parameters or not.

    Thread Starter zkmay11

    (@zkmay11)

    Yeah, I’ve narrowed it down to the reverse proxy specifically; taking the reverse proxy out of the loop clears all the errors. Still trying to figure out why the exact same setup for the VH in the reverse proxy works just fine for one site, but not the other. When I run the health check and look at the logs:

    "GET /wp-json/wp-site-health/v1/tests/page-cache?_locale=user HTTP/1.1" 200 6860 "https://themays.me/wp-admin/site-health.php"

    I’m not great at really digging into what’s going on under the hood, but it appears that the RP is passing the entire url through. I’m sure it boils down to an issue with my VH directives, so I’ll have to more digging there.

    • This reply was modified 1 year, 10 months ago by zkmay11.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with REST API (context query)’ is closed to new replies.