Project

General

Profile

Actions

Bug #23273

closed

Critical Error When Posting to Forum

Added by Luke Waltzer 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority name:
High
Assignee:
-
Category name:
WordPress Plugins
Target version:
Start date:
2025-08-27
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Trying to post a message in browser to TLC Forum <https://commons.gc.cuny.edu/groups/teaching-and-learning-center/forum/&gt;, getting:

There has been a critical error on this website.


Files


Related issues

Related to CUNY Academic Commons - Feature #23289: Re-install Jetpack BoostDuplicate2025-08-28

Actions
Actions #1

Updated by Raffi Khatchadourian 4 months ago

Related to #23259?

Actions #2

Updated by Raymond Hoh 4 months ago

This one is a weird one.

Jetpack Boost isn't even activated on the main site, but the error I'm seeing when posting to the forum is the same as in https://redmine.gc.cuny.edu/issues/23259#note-18:

Uncaught Error: Class "Automattic\Jetpack_Boost\Modules\Optimizations\Page_Cache\Pre_WordPress\Path_Actions\Rebuild_File" not found
in /wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/pre-wordpress/storage/class-file-storage.php on line 194

Call stack:

    Automattic\J\M\O\P\P\S\File_Storage::clear()
    wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/pre-wordpress/class-boost-cache.php:526
    Automattic\J\M\O\P\P\Boost_Cache::rebuild_recursive()
    wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/pre-wordpress/class-boost-cache.php:494
    Automattic\J\M\O\P\P\Boost_Cache::rebuild_post_cache()
    wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/pre-wordpress/class-boost-cache.php:369
    Automattic\J\M\O\P\P\Boost_Cache::invalidate_on_post_transition()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-includes/post.php:5740
    wp_transition_post_status()
    wp-includes/post.php:5000
    wp_insert_post()
    wp-content/plugins/bbpress/includes/topics/functions.php:336
    bbp_new_topic_handler()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-content/plugins/bbpress/includes/core/sub-actions.php:399
    bbp_post_request()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-content/plugins/bbpress/includes/core/sub-actions.php:337
    bbp_template_redirect()
    wp-includes/class-wp-hook.php:324
    WP_Hook::apply_filters()
    wp-includes/class-wp-hook.php:348
    WP_Hook::do_action()
    wp-includes/plugin.php:517
    do_action()
    wp-includes/template-loader.php:13
    require_once('/var/www/webroot/ROO.../template-loader.php')
    wp-blog-header.php:19
    require('/wp-blog-header.php')
    index.php:17

I tried rolling back Jetpack Boost to the version before the latest maintenance release and flushed the Litespeed Cache, but that didn't work. I then tried temporarily removing the Jetpack Boost plugin from the Commons and this appears to have addressed the fatal error in the forums. Can you test again, Luke? Also, Raffi feel free to test as well and report back in the other thread.

Actions #3

Updated by Raymond Hoh 4 months ago

I see that Jetpack Boost modified wp-config.php to add:

define( 'WP_CACHE', true ); // Boost Cache Plugin

This most likely caused the issues in both this ticket and #23259. I've just removed this entry from our wp-config.php file on production.

Actions #4

Updated by Luke Waltzer 4 months ago

Posted with success.

Thanks, Ray.

Actions #5

Updated by Boone Gorges 4 months ago

I see that Jetpack Boost modified wp-config.php to add:

This kind of "feature" makes it extremely hard to use WordPress and its plugin ecosystem for anything that is mission critical.

Better still, there's no obvious way to stop this behavior in jetpack-boost. Looking at https://github.com/Automattic/jetpack/blob/e5ae1dd1c3168eda92aa532bc71a8d36dca928c9/projects/plugins/boost/app/modules/optimizations/page-cache/class-page-cache-setup.php#L237, it seems like if we add define( 'WP_CACHE', false ); to our wp-config, it will prevent the plugin from modifying wp-config, but it will result in the wp-cache-defined-not-true error. Do we know whether this will break jetpack-boost in other ways?

Actions #6

Updated by Boone Gorges 4 months ago

Actions #7

Updated by Raymond Hoh 4 months ago

It looks like Jetpack Boost sets the Page Cache configuration options at /wp-content/boost-cache/config.php. If we set enabled to false in that config file and make that file read-only, this would, in theory, prevent Jetpack Boost's Page Cache feature from writing to wp-config.php and being enabled again: https://github.com/cuny-academic-commons/cac/blob/cf32567acef05232a5122a502fa78dea730aa38a/wp-content/plugins/jetpack-boost/app/class-jetpack-boost.php#L243-L245 . I've just set enabled to false, but I haven't re-enabled Jetpack Boost yet. Boone, how do we want to proceed?

Actions #8

Updated by Raymond Hoh 4 months ago

On second thoughts, I don't feel comfortable re-enabling Jetpack Boost unless there was a filter to disable their Page Caching feature entirely.

Their Page Cache setup is highly involved:
1. Creates their settings file at /wp-content/boost-cache/config.php
2. Writes to wp-config.php
3. Adds /wp-content/advanced-cache.php. It's probably this step that caused the fatal error on the main site because advanced-cache.php is enabled at all times on all sites and the checks in that file do not check if the Jetpack Boost plugin is activated or not. I've just removed this file from production.

See https://github.com/cuny-academic-commons/cac/blob/cf32567acef05232a5122a502fa78dea730aa38a/wp-content/plugins/jetpack-boost/app/modules/optimizations/page-cache/class-page-cache-setup.php#L44-L49

Outside of the Page Caching feature, the Jetpack Boost plugin does the following:
- CSS optimization
- Image CDN
- Image guide
- Defer non-essential javascript
- Concatenate JS and CSS

We originally installed this for Raffi for testing purposes on the old server, but now, we're with Reclaim and run Litespeed Cache. If we want to re-introduce these features, I'd probably look for another plugin that specializes in these things.

Actions #9

Updated by Boone Gorges 4 months ago

Thanks for the thoughtful review, Ray. I agree with your take: The plugin does too many things in ways that are not appropriate for a site like ours. If Raffi or other users can point to specific optimizations that jetpack-boost claims, we can consider implementing them in a way that's more appropriate for the Commons.

Ray, can you remove the plugin from the codebase?

Actions #10

Updated by Raymond Hoh 4 months ago

  • Category name set to WordPress Plugins
  • Status changed from New to Resolved
  • Target version set to 2.5.15

I've removed jetpack-boost in https://github.com/cuny-academic-commons/cac/commit/143b518e11eb4d27e79ec45750b8f348bedf4753 and pushed the change to production.

I've also created a ticket over on Jetpack's Github about jetpack-boost's Page Caching feature when used on a multisite install: https://github.com/Automattic/jetpack/issues/45008. If they ever address that and if they make their Page Caching feature easily toggleable via a filter, we could consider adding the plugin back down the road.

Actions

Also available in: Atom PDF