Home Forums Backend Issues (wp-admin) Fatal error: Maximum function nesting level reached


Fatal error: Maximum function nesting level reached

  • Hi community,

    I am having a serious issue where I can no longer access the ACF Field Groups, and thus cannot add/edit field groups.

    When I attempt to access this area, I get the following warning:
    Fatal error: Maximum function nesting level of ‘256’ reached, aborting! in /app/public/wp-includes/plugin.php on line 176

    I am running WordPress 4.9.8 and ACF 5.7.7.

    I have tried many different solutions, which have not worked. These include:

    • Updated xdebug nesting value via php.ini
    • Updated xdebug nesting value via PHP
    • Disabled all plugins (except ACF)

    I would very much appreciate any support on this!

    Thank you

  • I had a similar “Maximum function nesting level of ‘200’ reached” issue this AM when updating a site using WP 5.0.3 to version 5.7.12.

    This site imports a number of ACF Pro fields via JSON, and I’m working to localize the issue further.

    I reverted to previous versions of ACF Pro and the problem seems to introduced in the 5.7.11 release. The problem resolves if I rollback the version to 5.7.10.

    The traceback of the error log hit the following before the page failed to render. Both Pages and AJAX Requests that use ACF fields via the WP API were failing to render.

    We use ACF Pro pretty heavily – is there a particular case where the acf/validate_setting filter might be hitting recursively when the page loads?

    #0 {acf-pro-path}/includes/api/api-helpers.php(145): apply_filters(‘acf/validate_se…’, ‘export_textdoma…’)
    #1 {acf-pro-path}/includes/api/api-helpers.php(165): acf_validate_setting(‘export_textdoma…’)
    #2 {acf-pro-path}/includes/deprecated.php(78): acf_get_setting(‘export_textdoma…’, ”)
    #3 {wp-path}/wp-includes/class-wp-hook.php(286): acf_deprecated->acf_settings_l10n_textdomain(”)
    #4 {wp-path}/wp-includes/plugin.php(203): WP_Hook->apply_filters(”, Array)
    #5 Error while reading response header from upstream.
    2019/02/20 19:19:38 [error] 1352#1352: *4123 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Maximum function nesting level of ‘200’ reached, aborting! in {wp-path}/wp-includes/plugin.php:176

  • @nickxd It looks like we are having exactly the same issue. Did you find a solution for this?

  • Not sure if this will help you but it appears to be a PHP extension may be causing the issue and not PHP. PHP has no limits on nested function calls. I found this

  • @hube2 That is correct, however, if I turn XDebug off, I get an out of memory error, because of the too many nested function calls, so that won’t fix the real issue we’re having.

  • What is your memory limit?

  • @hube2 Our memory limit is 512 MB, it really is exactly the same issue as @nickxd is/was having. Something inside ACF is causing an infinite loop, and with that it surpasses the memory limit. Even cranking up the limit to 1024 MB or more is not the solution.

  • I’m not seeing this issue at all the latest version of ACF. You say that you can’t access field groups.

    Does the group list page load?

    Are you having issues editing all field groups or just some?

    What is in the field groups that are giving you problems?

  • @hube2 It seems to only be a problem when already having lot’s of large field groups that are being loaded with acf-json (local). Even displaying some groups (in this case on an options page) gives issues.

  • I’m going to need more information on the JSON files that are causing the issues.

    This is what I would do to narrow it down. Download a copy of all of the JSON files. Delete all of the JSON files from the server – does this clear up the issue? If it does then narrow down what JSON file or combination of files is causing the issue.

  • To answer your question, Marco, at last check we were still having the issue but only on one of our sites – we have frozen the ACF version and haven’t had a chance to test again with the latest release, I will try devoting some more troubleshooting time this week or early next week.

    This site also has our largest number of JSON files (Another site has nearly as many but not quite as many), and we do some filtering of field configuration after loading these via JSON using ACF hooks. We use these JSON files pretty deeply in our workflow in a custom plugin, so we’ll give this a test but we’re talking about 30 – 40 required by the theme so this will take us a while to test to narrow things down. We use two add-ons typically as well, and we haven’t been able to localize if it’s an issue with those fields in particular:

    Advanced Taxonomy Selector:
    Image Crop Add-On:

    We’re on Vagrant servers in developemnt where we have control over a range of PHP configuration options – we’ve tried increasing server and PHP memory limits, max number of variables limits, all with no luck.

  • An Update to this issue – As of ACF Pro 5.8.2, this issue appears to be resolved.

  • As of version 5.8.4 (Pro) the issue is NOT resolved. I get this error message when trying to edit a field group:
    Fatal error: Uncaught Error: Maximum function nesting level of '256' reached, aborting! in /Users/petermumford/Documents/network/wp-content/plugins/advanced-custom-fields-pro/includes/acf-utility-functions.php on line 81

  • I have been struggling with it, and feel that the issue also exists in v5.8.5 as well.

  • I’ve solved the issue for us. We are using ACF JSON to save the groups inside the theme, however, in one of these groups there was a repeater field without ‘child’ fields, which caused this issue. Removing this field completely fixed it!

  • In my case, I have only three (3) fields in the ACF field groups two of them are of type ‘Date’ and the 3rd one being a ‘File’ type, and still experiencing the same error.
    Don’t know what is the reason.

  • Hi

    I recently had this issue over my entire frontend as well. My problem was that I had a field named the same as a Custom Post Type (i.e. “projects”). Renaming the field fixed the issue for me.

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

The topic ‘Fatal error: Maximum function nesting level reached’ is closed to new replies.