Home Forums Feedback ACF JSON causing server overflow


ACF JSON causing server overflow

  • 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

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

    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)

The topic ‘ACF JSON causing server overflow’ is closed to new replies.