Support

Account

Home Forums General Issues admin-ajax.php returns nothing in production

Solved

admin-ajax.php returns nothing in production

  • I have a simple ACF setup with relationship fields.

    On my localhost (docker wordpress:5.3) I am able to use the live search functionality of the relationship field.

    On production, however, I cannot. All that is returned is nothing (not 0, literally an empty string.

    There are no differences between local and live environments.

    If you’ve seen this before or could point me in the right direction. That would be great. I’ll accept any wild theory or intuition.

  • More context:

    I’m using the latest version, 5.8.7 with WordPress 5.2.X

    When performing a live search in an ACF relationship field in the admin section, admin-ajax.php is called.

    On my local dev environment, I can search in that box and have results returned. Even if there are no results, I receive this:

    {"results":[],"more":false,"limit":0}

    On production, if I search, all I ever receive is (results or not) an empty string.

    wp_debug doesn’t log an error.

  • I think this might be a firewall, cache or cookie problem.

    I can see successful requests to admin-ajax.php have a different cookie set. The heartbeat action, for example, uses different cookies than acf/fields/relationship/query

    However, both requests go to https://mysite.com/wp-admin/admin-ajax.php

  • This was the result of a request being redirected by a firewall (Securi). HTTPS wasn’t set up correctly and would cause a redirect loop if not for the firewall fowarding.

    I untangled that mess and it’s working fine now.

    Just putting my answer here in case this happens to you.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘admin-ajax.php returns nothing in production’ is closed to new replies.