Support

Account

Home Forums Feedback ACF JSON causing server overflow

Solved

ACF JSON causing server overflow

    • wgrt

    • January 27, 2018 at 2:32 am

    Today I had a peculiar issue.

    The following error occurred:

    [26-Jan-2018 12:53:16 UTC] PHP Warning: readdir() expects parameter 1 to be resource, boolean given in <my-website>/wp-content/plugins/advanced-custom-fields-pro/includes/json.php on line 146

    This caused an infinite loop, which in turn generated an unstoppable stream of error log messages on the server. This consumed all space on the server.

    I later learned that this had to do with the fact that the permissions on the acf-json folder were not sufficient for the opendir() function in the script to work well. That made opendir() return false, which in turn caused an infinite loop at the readdir() call.

    I realise that folder permissions are my problem, but I can imagine nicer ways for the script to tell me about the problem, instead of almost taking my entire server down 😉

  • You should report this as a bug here https://support.advancedcustomfields.com/new-ticket/

    I suspect that changing line 142 from
    $dir = opendir( $path );
    to

    
    if (($dir = opendir($dir)) === false) return false;
    

    would fix the issue, but that’s just a guess

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

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.