• Resolved jamminjames

    (@jamminjames)


    I recently installed Memcached on our CentOS 7 server running nginx. When I set the W3TC database cache to use it, problems started cropping up. For one thing, when I log out of WordPress, I get a 502 Bad Gateway error.

    Looking at the logs I’m getting a lot of references to “PgCache_ContentGrabber,” but not sure if it’s related. Eg:

    2023/03/22 22:58:50 [error] 21494#21494: *10497 FastCGI sent in stderr: “PHP message: PHP Fatal error: Uncaught Error: Call to undefined function adrotate_group() in /var/www/humortimes/wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php(1906) : eval()’d code:1
    Stack trace:

    0 /var/www/humortimes/wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php(1906): eval()

    1 [internal function]: W3TC\PgCache_ContentGrabber->_parse_dynamic_mfunc()

    2 /var/www/humortimes/wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php(1877): preg_replace_callback()

    3 /var/www/humortimes/wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php(394): W3TC\PgCache_ContentGrabber->_parse_dynamic()

    4 /var/www/humortimes/wp-content/plugins/w3-total-cache/PgCache_ContentGrabber.php(224): W3TC\PgCache_ContentGrabber->process_cached_page_and_exit()

    5 /var/www/humortimes/wp-content/advanced-cache.php(37): W3TC\PgCache_ContentGrabber->process()

    6 /var/www/humortimes/wp-settings.php(95): include(‘/var/www/humort…’)

    7 /var/www/humortimes/wp-config.php(132): require_onc” while reading response header from upstream, client: 172.71.222.21, server: https://www.humortimes.com, request: “GET /59387/princess-ivanka-furious-pam-bondi/ HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php-fpm/php-fpm.sock:”, host: “www.humortimes.com”

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jamminjames

    Thank you for reaching out and I a happy to assist you with this.
    The Stack trace indicates that you’ve setup the Page Fragment Cache and the code is not parsed. Can you please doublecheck the code and which caching method have you ben using for Page Cache before installing and using Memcached?
    Thanks!

    Thread Starter jamminjames

    (@jamminjames)

    Thanks for the reply. Page cache is currently using APCu. I just now turned off the fragment cache, it was also using APCu. The database cache is what I was using memcached for, but I’ve disabled it for now.

    What code needs to be parsed? I thought you just turned these caches on or off, and that was it.

    To use memcached for the database cache, should I make the fragment cache use it as well?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jamminjames

    I am referring to Page Fragment Cache and not Fragment Cache. Page Fragment cache is used to wrap the specific part of the code with <mfunc>

    Have you done that in the past?

    Thanks!

    Thread Starter jamminjames

    (@jamminjames)

    So, you’re talking about something done in our website coding, not in the W3TC setup? No, we haven’t done that, as far as I know, and I just did a search in our child functions.php file and all other places where anything might have been custom coded.

    I neglected to mention, we do have a custom login url, so perhaps the logout problem is related to that?

    Thread Starter jamminjames

    (@jamminjames)

    Also, I’m using a FastCGI cache and Cloudflare, in case that is relevant.

    Thread Starter jamminjames

    (@jamminjames)

    I think the problem may have been that I had memcached installed, but not the pecl php memcache extension. That is now installed, and I flushed all the caches and now it seems to be okay. At least, I didn’t get that 502 logging out.

    I’ll keep a close eye on things and post again if there are any problems. Thanks!

    Thread Starter jamminjames

    (@jamminjames)

    I’m getting a lot of people emailing and saying the website won’t load (they’re not specific on the error). I tell them to clear their browser cache and try again, and that seems to work. But why is this happening? W3tc should update their browser cache if it’s out of date, correct?

    I have pretty much everything checked in the browser cache settings for all file types, except for “Prevent caching of objects after settings change” and “Enable?HTTP?(brotli) compression” (greyed out). Is there a way to export the settings to show you?

    • This reply was modified 1 year, 7 months ago by jamminjames.
    • This reply was modified 1 year, 7 months ago by jamminjames.
    • This reply was modified 1 year, 7 months ago by jamminjames.
    Thread Starter jamminjames

    (@jamminjames)

    Now more problems are cropping up again. The logout problem, and when I try to login, it’s supposed to go to the 2FA code, but stays on the login page, with a warning saying “CODE REQUIRED: Please provide your 2FA code when prompted.”

    Another thing that could perhaps help solve this issue: When I set up memcached on the server, one test that was recommended was to use the “telnet humortimes.com 80” command via cli, then enter the “stats” command. When I do that, I get a “HTTP/1.1 400 Bad Request” response. However, when I try “systemctl status memcached”, it says it’s active.

    Also, the wordpress error “There has been a critical error on this website.” was popping up sometimes when accessing the site. I disabled gzip in the browser cache, that seemed to fix it. How can I get that working again?

    For now, I’ll disable the memcache again, but I’d really like to be able to use it. Any help would be appreciated. Thanks.

    • This reply was modified 1 year, 7 months ago by jamminjames.
    • This reply was modified 1 year, 7 months ago by jamminjames.
    • This reply was modified 1 year, 7 months ago by jamminjames.
    Thread Starter jamminjames

    (@jamminjames)

    Update: gzip is already enabled in our nginz setup, perhaps the W3tc setting caused a conflict?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @jamminjames

    I’ll try to replicate this as this is very awkward.

    I’ll get back to you once I have a clear answer.

    Thanks!

    Thread Starter jamminjames

    (@jamminjames)

    Thanks. Also, I’ve been getting the WordPress “There has been a critical error on this website” notice intermittently, not on the home page, but on post pages. Tried deactivating plugins, etc, but the only thing that will work right now is to disable W3TC.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘W3TC Memcached related errors’ is closed to new replies.