• Resolved corelus

    (@corelus)


    After updating to the latest version (2.1.8), am not able to see w3c settings or other subpages related to the plugin. I am also not able anymore to see wp-plugins list from backend. I disabled w3c total cache, deleted & reinstall it again, then I wasn’t able to activate w3c plugins.

    Running Environment:
    Wordpress v 5.8
    PHP 7.2
    W3C Total Cache Plugin Pro

    and here is the debug error message:

    Uncaught W3TC\Util_WpFile_FilesystemOperationException in /wp-content/plugins/w3-total-cache/Util_WpFile.php:242 Stack trace: #0 /wp-content/plugins/w3-total-cache/Generic_Environment.php(19): W3TC\Util_WpFile::file_exists(‘/www/…’) #1 /wp-content/plugins/w3-total-cache/Root_Environment.php(28): W3TC\Generic_Environment->fix_on_wpadmin_request(Object(W3TC\Config), false) #2 /wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php(742): W3TC\Root_Environment->fix_in_wpadmin(Object(W3TC\Config)) #3 /wp-includes/class-wp-hook.php(303): W3TC\Generic_Plugin_Admin->admin_notices(”) #4 /wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #5 /wp-includes/plugin.php(470): WP_Hook->do_action(Array) #6 /wp-admin/admin-header.php(287): do_act in /wp-content/plugins/w3-total-cache/Util_WpFile.php on line 242

    Any help or idea how to resolve this issue?

    • This topic was modified 3 years, 6 months ago by corelus.
    • This topic was modified 3 years, 6 months ago by corelus.
Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @corelus

    Thank you for reaching out and I am sorry about the issue you experienced with the latest update.
    can you please confirm if you have had a direct filesystem — FTP, SSH2?
    Also please let me know if the issue persists if you roll back the plugin to the 2.1.6 version.
    A similar issue was reported here.
    Thanks!

    Thread Starter corelus

    (@corelus)

    Hello Marko,
    @vmarko Thank you for your support and I am sure if we’ll rollback to 2.1.6 or 2.1.7 it will works fine, since the issue occurred after updating to the 2.1.8 version. And sorry but I am not sure what file system do we have, but everything is deployed via git after testing on a virtual staging server and we use SSH if we want to change any files or update any plugins. hopefully this will help you.
    we did reinstall the older version 2.1.7 on staging and it looks fine there is no issues occurring.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @corelus

    We can confirm the issue with the latest release that is causing this and it’s related to the direct filesystem.
    Please keep the plugin on 2.1.7 as this will be fixed in the next patch release that will be out soon.
    Thanks!

    Thread Starter corelus

    (@corelus)

    Hello Marko,
    at the moment we’ll keep the 2.1.7 version and will be waiting for he next release.
    Thank you for your support!

    We also have this issue which didn’t come to light right away.

    May I ask when a fix is likely to be released? We have around 200 websites we’ll need to roll back…

    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @1stwebdesigns

    We are working on a fix for this and it will be fixed soon.
    This may not be the issue on all websites.
    Once again I am sorry about the issue you are experiencing and we are working on a patch.
    Thank you for your patience.

    Hello,

    I’m not sure why this topic is listed as Resolved? It sounds like there will be a Bug Fix released for W3 Total Cache but nothing has been released yet. Is that correct?

    We run W3 Total Cache on all of our sites and I have this error on 10 WP sites now.

    Fatal error: Uncaught W3TC\Util_WpFile_FilesystemOperationException

    I could not roll back the plugin I had to deactivate W3 Total Cache to get past this issue.

    Thanks
    Monte

    2.1.8 has completely broken my plugins control with a fatal error. I now need to manually remove w3-total-cache from multiple sites as I can no longer update any plugins.

    FYI, I use ssh2 for updates.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @doconeill and @mpersinger

    As I’ve mentioned in the previous posts, this is a known issue for some environments and we are working on a fix that will be released soon and will fix the issue.
    Once again, thank you for your patience!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @corelus @1stwebdesigns @mpersinger @doconeill

    Thank you for your patience.
    While we are working on a release there is a quick fix for the “uncaught exception”

    In file Generic_Environment.php line 19 change

    if ( Util_WpFile::file_exists( Util_Environment::site_path() . 'robots.txt' ) ) {

    to

    if ( file_exists( Util_Environment::site_path() . 'robots.txt' ) ) {

    Also if anyone intends to toggle the “robots blocking” setting off or deactivate the plugin you may also need (assuming the same issue occurs with the Util_WpFile::delete_file function)

    In file Generic_Environment.php line 280 change

    Util_WpFile::delete_file( $robots_path );

    to

    unlink( $robots_path );

    Once again thank you for your patience and understanding.

    @vmarko This is a dangerous fix. If I change line 19 as indicated, then I get:

    
    [18-Sep-2021 04:05:31 UTC] PHP Warning:  ftp_fget() expects parameter 1 to be resource, null given in /var/www/web/html/wp-admin/includes/class-wp-filesystem-ftpext.php on line 146
    [18-Sep-2021 04:05:31 UTC] PHP Fatal error:  Uncaught W3TC\Util_WpFile_FilesystemRmException in /var/www/web/html/wp-content/plugins/w3-total-cache/Util_WpFile.php:215
    Stack trace:     
    #0 /var/www/web/html/wp-content/plugins/w3-total-cache/Generic_Environment.php(284): W3TC\Util_WpFile::delete_file('/var/www/web/ht...')
    #1 /var/www/web/html/wp-content/plugins/w3-total-cache/Generic_Environment.php(23): W3TC\Generic_Environment->robots_rules_remove(Object(W3TC\Util_Environment_Exceptions))
    #2 /var/www/web/html/wp-content/plugins/w3-total-cache/Root_Environment.php(28): W3TC\Generic_Environment->fix_on_wpadmin_request(Object(W3TC\Config), false)
    #3 /var/www/web/html/wp-content/plugins/w3-total-cache/Generic_Plugin_Admin.php(742): W3TC\Root_Environment->fix_in_wpadmin(Object(W3TC\Config))
    #4 /var/www/web/html/wp-includes/class-wp-hook.php(303): W3TC\Generic_Plugin_Admin->admin_notices('')                      
    #5 /var/www/web/html/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array)                               
    #6 /var/www/web/html/wp-includes/plugin.php(470): WP_Hook->do_action(Array)                                                
    #7 /var/www/web/html/wp-admin/admin-header.php(287): do_action('admin_notices')                                            
    #8 /var/www/web/html/wp-admin/plugins.php(603): require_once('/var/www/web/ht...')                                         
    #9 {main}     
      thrown in /var/www/web/html/wp-content/plugins/w3-total-cache/Util_WpFile.php on line 215
    

    If I make the modification to unlink() as indicated, then merely opening the plugins page will delete robots.txt even though it’s not empty. It seems $wp_filesystem->get_contents( $robots_path ) doesn’t actually get the contents of the file.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @icydog

    Thank you for the feedback.
    Let me double-check this and I’ll get back to you.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @icydog

    Thank you for your patience.
    Can you please try the following
    Change lines 279-281 in Generic_Environment.php

    if ( empty( trim( $wp_filesystem->get_contents( $robots_path ) ) ) ) {
    	Util_WpFile::delete_file( $robots_path );
    }

    to

    if ( trim( file_get_contents( $robots_path ) ) == false ) {
    	unlink( $robots_path );
    }

    This will hopefully resolve the robots.txt delete issue even when not empty

    Thanks!

    @vmarko This seems to do what it wants to be doing in both cases (robots.txt empty and not empty). Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @icydog

    Thank you for the information!
    Glad to know this helps!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Plugin giving a Fatal error back after update to 2.1.8’ is closed to new replies.