• Resolved sturdywall12

    (@sturdywall12)


    Greetings,

    lately, I noticed my VPS server failing with errors such as 500. I have to restart nginx and php8.2-fpm services in order to restore the site to running state.

    The VPS is 4 cores 4GB. WordPess only consumes 42mb out of memory at all times. Max memory limit for WP is 700mb. Max memory limit for PHP is 2000mb. Yet memory consumption for overall VPS doesn’t go above 1.2GB.

    The error in question starts with series of PHP Fatal errrors, but according to my nginx logs it starts with this:

    2024/07/27 08:57:40 [error] 162804#162804: *445 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.221, server: mp-performance.ae, request: "GET /wp-json/jetpack/v4/jitm?message_path=wp%3Awoocommerce_page_wc-admin%3Aadmin_notices&query=page%253Dwc-admin%252Cpath%253D%25252Fgoogle%25252Fdashboard&full_jp_logo_exists=false&_wpnonce=c934831b75 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *450 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.220, server: mp-performance.ae, request: "GET /wp-json/wc-analytics/admin/notes?page=1&per_page=25&type=error%2Cupdate&status=unactioned&_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *456 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.221, server: mp-performance.ae, request: "GET /wp-json/wc/gla/mc/reports/programs?after=2023-07-01&before=2023-07-27&fields%5B0%5D=clicks&fields%5B1%5D=impressions&_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *453 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.220, server: mp-performance.ae, request: "GET /wp-json/wc/gla/jetpack/connected?_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *446 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 141.101.97.103, server: mp-performance.ae, request: "GET /wp-admin/admin-ajax.php?action=nasa_list_fonts_admin&fill= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *458 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.220, server: mp-performance.ae, request: "GET /wp-json/wc/gla/mc/target_audience?_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162804#162804: *455 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.221, server: mp-performance.ae, request: "GET /wp-json/wc/gla/mc/reports/programs?after=2024-07-01&before=2024-07-27&fields%5B0%5D=clicks&fields%5B1%5D=impressions&_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:40 [error] 162805#162805: *457 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.69.222.220, server: mp-performance.ae, request: "GET /wp-json/wc/gla/mc/countries?continents=true&_locale=user HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard"
    2024/07/27 08:57:47 [error] 162804#162804: *393 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 141.101.97.9, server: mp-performance.ae, request: "GET /wp-admin/admin.php?page=wc-admin&path=%2Fgoogle%2Fdashboard HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?inner_page=edit&page=duplicator-pro-schedules"
    2024/07/27 08:57:56 [error] 162804#162804: *464 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 162.158.163.226, server: mp-performance.ae, request: "GET /shop/?filter_make_model=a4-prestige&filter_make_brand=michelin,varta,castrol,brigdestone,bosch,wruth HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.com", referrer: "https://mp-performance.com/shop/?filter_make_model=a4-prestige&filter_make_brand=michelin%2Cvarta%2Ccastrol%2Cbrigdestone%2Cbosch%2Cwruth%2Cdorman"

    Here’s system report from WP: https://gist.github.com/ubut12d/8108f4b9cdaae35908ce91dc1e4d9d89

    Here’s fatal-error log when it occurs: https://gist.github.com/ubut12d/27180cb60360b8b6de2cf21fc0fae70d

    I’m feeling tired off this issue, I look all over internet and many sites trying to trace this issue. Yet even with my large free RAM/memory the issue presists. Please help!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Moderator James Huff

    (@macmanx)

    The line items are all tracing back to /wp-includes/theme.php

    Does the problem continue if you use the Twenty Twenty-Four theme?

    Thread Starter sturdywall12

    (@sturdywall12)

    Yes. It shows up in any random php file. At random times, mostly if I’m doing any PHP operation such as working on the site at wp-admin pages. For example:

    2024/07/24 14:53:59 [error] 99605#99605: *43050 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught Error: Undefined constant "ABSPATH" in /var/www/html/wordpress/wp-includes/blocks/index.php:8
    Stack trace:
    #0 {main}
    thrown in /var/www/html/wordpress/wp-includes/blocks/index.php on line 8" while reading response header from upstream, client: 198.41.242.185, server: mp-performance.ae, request: "GET /wp-includes/blocks/index.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.com"
    2024/07/24 17:47:02 [error] 99605#99605: *49963 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Out of memory (allocated 41943040 bytes) (tried to allocate 630980608 bytes) in /var/www/html/wordpress/wp-content/plugins/wp-crontrol/src/bootstrap.php on line 24" while reading response header from upstream, client: 172.71.135.88, server: mp-performance.ae, request: "GET /wp-admin/plugin-install.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/plugins.php"
    2024/07/19 08:01:44 [error] 47865#47865: *64 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 2097152000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.71.210.130, server: mp-performance.ae, request: "GET /wp-admin/admin-ajax.php?action=nasa_list_fonts_admin&fill= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.2-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/wp-admin/admin.php?page=wc-status"

    You can convert the allowed memory size of “2097152000” to mb, it’s in fact 2gb. For some reason WP/PHP wants to allocate out of sudden extra 4GB on top of the 2GB.

    I always have my VPS htop function running, the memory never goes above 1.2GB on server resources side. But my PHP-Fpm being on-demand, the system is idling with 700-800mb RAM and while providing webserver or php-fpm child processes the ram only gets consumed up to 1.2-1.3GB.

    Please advise. Thanks!

    Moderator James Huff

    (@macmanx)

    Yeah, that definitely seems too much, my own sites run with a “generous” allocation of 512mb.

    This problem may be a plugin or theme conflict. Please attempt to deactivate all plugins and switch to the default Twenty Twenty-Four theme. If the problem goes away, re-activate them one by one to identify the source of the problem.

    Thread Starter sturdywall12

    (@sturdywall12)

    As this is production site and the issue will only show on production environment. I have to disable 5-10 plugins and observe each few days. Thanks for the advice.

    Is it possible for cache plugin such as WP Fastest to cause such issue?

    Will get back with results once I figure the culprit.

    Moderator James Huff

    (@macmanx)

    Cache plugins should ideally be saving resources, but they do use resources to generate the cache, so it’s always possible.

    Thread Starter sturdywall12

    (@sturdywall12)

    It’s been few weeks since the issue disappeared. The issue gets triggered when either the NasaTheme is active or when I’m using the WP-ADMIN area.

    I’m typing here my reply to NasaTheme support. I find this saddening as either WordPress thinks this issue is not from their software. Why can’t WordPress fix this bug/issue? Why me as web developer have to go through WordPress actual software and point the issue. Knowing I will be asked to disable this disable that plugin activate this. No actual debugging! Could someone help me please? This is production website and even WordPress blows a fuse over simple process and asks for 4GB memory allocation. This is a disaster!

    Hello,

    Upon confirmation, this error is related to the theme. As I tried to simulate how it gets triggered in the admin page by either going to update or dashboard settings of update. It only gets triggered when the elsssi theme is activated.

    ——
    *65555 FastCGI sent in stderr: "PHP message: PHP Fatal error: Allowed memory size of 3145728000 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, request: "POST /wp-admin/admin-ajax.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", referrer: "/wp-admin/post.php?post=10792&action=edit&lang=en"
    —-

    Line 189 of theme.php file is related to the theme’s stylesheet:


    function get_stylesheet() {
    /**
    * Filters the name of current stylesheet.
    *
    * @since 1.5.0
    *
    * @param string $stylesheet Name of the current stylesheet.
    */
    return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );
    }

    —-

    I suspect there’s incompatibility with the theme and either php8.3 or opcache or whatever else is running on the website. As I disabled almost all plugins and the issue still occurs.

    WP tried to allocate 4 extra GB while doing that operation, something is not right. While this is development issue that should be handled by either NasaTheme or WordPress. I find the solutions generic and not helpful. I as web developer will not go through learning WP coding just to fix a glitch or bug issue. What hurts is how WordPress seems to be throwing the ball into NasaTheme field while NasaTheme might claim I should pay for someone to fix one of the party’s -NsasTheme or WordPress- incompetence.

    Many people seem to suffer this issue. I need this fixed.
    Moderator James Huff

    (@macmanx)

    It’s been few weeks since the issue disappeared.

    So, the issue is resolved?

    Why can’t WordPress fix this bug/issue?

    If it was a consistent and reproducible problem affecting all WordPress sites, we’d be able to easily identify the problem and produce a fix.

    As you have determined, the problem is caused by your theme, and as such it is up to the theme’s developer to fix their product.

    Alternatively, you could switch to a different theme, these are all free: https://www.ads-software.com/themes/

    Thread Starter sturdywall12

    (@sturdywall12)

    After further testing. The issue looks to be general to WordPress platform itself.

    I tested this with changing the theme to generic WP theme. Again same error being thrown right at theme.php file line 189.

    Counter measures I did were changing some fastcgi settings and excluding theme.php file from cache process. But looks like it doesn’t work.

    From what I can see, the line 189 on theme.php file is related to stylesheet and possibily goes into infinite loop which causes 4GB memory allocation request.

    I’ve been battling this issue for months now. I cannot find anyone to help me resolve this issue. Even the business owner is considering shifting to Shopify as WordPress cannot run withouth hiccups every now and then.

    Even now with generic WP theme. It keeps throwing critical website error and many errors:

    2024/08/30 17:00:20 [error] 151269#151269: *1610 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 2684354560 bytes exhausted (tried to allocate 4295229440 bytes) in /var/www/html/wordpress/wp-includes/theme.php on line 189" while reading response header from upstream, client: 172.70.38.150, server: mp-performance.ae, request: "GET /product-tag/5w-40/?lang=ar&v=7516fd43adaa HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:04:20 [error] 151269#151269: *1730 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 108.162.227.148, server: mp-performance.ae, request: "GET /product-tag/ngk/?on-sale=1&v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:05:09 [error] 151269#151269: *1762 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 162.158.163.218, server: mp-performance.ae, request: "GET /product-tag/grips/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:05:32 [error] 151269#151269: *1788 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 162.158.106.28, server: mp-performance.ae, request: "GET /product-tag/steering-yoke/?on-sale=1&v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:05:55 [error] 151269#151269: *1805 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 162.158.189.161, server: mp-performance.ae, request: "GET /product-tag/engine-drain-bolt/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:06:22 [error] 151269#151269: *1829 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 162.158.190.115, server: mp-performance.ae, request: "GET /product-tag/2-1-bar/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:06:44 [error] 151269#151269: *1839 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 172.69.166.96, server: mp-performance.ae, request: "GET /product-tag/magneto-cover/?in-stock=1&on-backorder=1&v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:06:54 [error] 151269#151269: *1845 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 172.69.59.125, server: mp-performance.ae, request: "GET /product-tag/obd2/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:07:32 [error] 151269#151269: *1953 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 172.71.124.163, server: mp-performance.ae, request: "GET /product-tag/probolt/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:08:15 [error] 151269#151269: *2037 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 172.71.131.137, server: mp-performance.ae, request: "GET /product-category/oem-parts/?v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae", referrer: "https://mp-performance.ae/online-shop/?v=ea8a1a99f6c9"
    2024/08/30 17:08:20 [error] 151269#151269: *2044 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 172.71.124.162, server: mp-performance.ae, request: "GET /product-tag/universal/?v=1c2903397d88 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"
    2024/08/30 17:08:20 [error] 151269#151269: *2049 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_type() on null in /var/www/html/wordpress/wp-content/plugins/nasa-core/includes/incls/nasa_08_wc_attr_ux.php:342
    Stack trace:
    #0 /var/www/html/wordpress/wp-includes/class-wp-hook.php(322): Nasa_WC_Attr_UX->product_content_variations_ux_loop()
    #1 /var/www/html/wordpress/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
    #2 /var/www/html/wordpress/wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(198): do_action()
    #4 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/ArchiveProductTemplatesCompatibility.php(149): Automattic\WooCommerce\Blocks\Templates\AbstractTemplateCompatibility->get_hooks_buffer()
    #5 /var/www/html/wordpress/wp-content/plugins/woocommerce/src/Blocks/Templates/AbstractTemplateCompatibility.php(70): Automattic\WooCommerce\Blocks\Templates\ArchiveProductTemplate" while reading response header from upstream, client: 162.158.107.31, server: mp-performance.ae, request: "GET /product-tag/2023/?featured=1&on-backorder=1&on-sale=1&v=ea8a1a99f6c9 HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php8.3-fpm.sock:", host: "mp-performance.ae"

    Help is really appreciated.

    • This reply was modified 1 month, 3 weeks ago by sturdywall12.
    Moderator James Huff

    (@macmanx)

    What is “generic WP theme” in this case? Lack of specifics don’t help us help you.

    Whatever it is, the error is now coming from this nasa-core plugin.

    If the theme was calling that plugin, and that plugin was using too much memory, it makes sense the failure tracked up through the theme to theme.php where it would eventually terminate.

    What is the URL of the site, where did you get that plugin, and do you have any issue specially with that plugin deactivated?

    And please let’s stop returning to this being an issue “general to WordPress platform itself.” Hitting PHP memory allocation errors is no more unique to WordPress than they are to anything that runs under a hardware system that uses RAM.

    WordPress with no plugins or themes doesn’t run into memory errors on properly configured servers, I don’t run into any with my sites, and neither do these: https://www.ads-software.com/showcase/

    This isn’t something that needs to be fixed in WordPress. It needs to be fixed in the plugin or theme that’s asking for too much memory to run, or it needs to be fixed in the server configuration, and constantly pressing otherwise is becoming unproductive.

    So, back to the question, so we can isolate what’s causing this, what is the URL of the site, where did you get that nasa-core plugin, and do you have any issue specially with that plugin deactivated?

    Moderator James Huff

    (@macmanx)

    Adding in that https://www.nasa.gov also runs on WordPress and doesn’t experience any memory issues that we’ve heard about: https://wptavern.com/why-nasa-chose-wordpress-for-revamping-its-flagship-website

    Are you affiliated with nasa.gov?

    zenguerrilla

    (@zenguerrilla)

    Hello,
    we get the exact same error after upgrading to PHP 8.2 from 7.4:
    2024/09/20 10:08:18 [notice] 1078#1078 [unit] #12118: php message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4295229440 bytes) in /site/web/wp/wp-includes/theme.php on line 189

    sometimes it’s on line 189, other times on line 325:
    2024/09/16 13:01:09 [notice] 152#152 [unit] #1482: php message: PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 4295229440 bytes) in /site/web/wp/wp-includes/theme.php on line 325

    but it always try to allocate 4GB of memory.

    Our wordpress setup is based on roots.io, with a custom theme and we use composer for all plugin installations.

    We have Wordfence plugin installed and we’ve managed to reproduce the problem consistently after manually running the wf_scan_monitor cron event using wp-cli, and then viewing the wp-admin dashboard. We have disabled this cron job since then, but the problem re-appeared today.

    As a temporary workaround we have disabled wp-cron altogether and we’re monitoring it.

    Thread Starter sturdywall12

    (@sturdywall12)

    Hello @zenguerrilla

    We didn’t have the issue for a while. Somehow I spent few nights trying all sort of tweaks and fixes until I found what worked for me. Please note we have redis cache plugin enabled since the beginning. Along with the usual nginx fastcgi cache. We lowered the cache inactivity or its life to 50m instead of 1 full day.

    I highly suspect the culprit is OpCache. Do you have it enabled?

    If so, please make sure to follow my post here on GIT: https://github.com/rhubarbgroup/redis-cache/issues/547

    Not sure if this is the fix for the issue but it is part of the solution. The other solution I came up with was excluding some files from the nginx fastcgi cache in nginx/website conf file:

    In the location ~/ of .php, add this:

        if ($request_uri ~* "/wp-content/|xmlrpc.php|wp-cron.php|robots.txt|/wp-content/upgrade|/wp-content/backups-dup-pro|/wp-content/wp-cloudflare-super-page-cache|/wp-content/jetpack-waf|theme.php|phpmemtest.php|502_recovery_point.php|info.php|xmlrpc.php|wp-.*.php|/wp-admin/|/admin-*|wp-cron|/shopping-cart/|/checkout-3/|/my-account/"){
    set $no_cache 1;
    }

    Please let me know how it goes, I’m willing to share my server’s configuration with you and hopefully you get it fixed. I really hate how the support community works here, I had to pay for some random guy on freelance website who seemed to have +500 5 stars reviews, the guy was clueless and didn’t even sound professional at all. I mean I do have +18 years experience in web development, programming & network engineering. But I only took control over the company’s website as our previous hired web developer was a complete failure who was the type of “google, copy, paste & use AI to generate content quickly”. Extremely lazy guy. It took me few months to get kick started to learn and get going with WP. It’s a great platform, but it’s so easy for the platform to crash once you install the wrong plugin or something isn’t agreeing with the files/permisisons/etc..

    Regards.

    Hello @sturdywall12
    We had both OPCache and JIT enabled, and it turns out JIT was the issue. After disabling it, everything is back to normal. Thank you very much!

    Thread Starter sturdywall12

    (@sturdywall12)

    @zenguerrilla glad you found the solution.

    Once the WP is stable I suggest experimenting with exclusion or blacklisting folders and php files that causes the issue. As OpCache and JIT are very useful tools for increasing the application’s speed along with lesser resources usage whenever users are browsing the site.

    Thank you for the suggestion; we’ll look into it.

Viewing 15 replies - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.