• Resolved neralex

    (@neralex)


    After update and also after a re-install I get an critical error. So there is no way to install the current version. Latest version of PHP 8.1.

    [Tue Feb 20 12:56:39.465574 2024] [php:error] [pid 103515] [client 91.39.42.27:57964] PHP Fatal error: Uncaught Error: Undefined constant "FS_CHMOD_FILE" in /var/www/domain.tld/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php:164\nStack trace:\n#0 /var/www/domain.tld/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php(86): WP_Filesystem_Direct->chmod()\n#1 /var/www/domain.tld/httpdocs/wp-content/plugins/matomo/classes/WpMatomo/Updater.php(156): WP_Filesystem_Direct->put_contents()\n#2 /var/www/domain.tld/httpdocs/wp-content/plugins/matomo/classes/WpMatomo/Updater.php(88): WpMatomo\Updater->update()\n#3 /var/www/domain.tld/httpdocs/wp-content/plugins/matomo/classes/WpMatomo.php(218): WpMatomo\Updater->update_if_needed()\n#4 /var/www/domain.tld/httpdocs/wp-includes/class-wp-hook.php(324): WpMatomo->init_plugin()\n#5 /var/www/domain.tld/httpdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()\n#6 /var/www/domain.tld/httpdocs/wp-includes/plugin.php(517): WP_Hook->do_action()\n#7 /var/www/domain.tld/httpdocs/wp-settings.php(643): do_action()\n#8 /var/www/domain.tld/httpdocs/wp-config.php(98): require_once('…')\n#9 /var/www/domain.tld/httpdocs/wp-load.php(50): require_once('…')\n#10 /var/www/domain.tld/httpdocs/wp-admin/admin.php(34): require_once('…')\n#11 /var/www/domain.tld/httpdocs/wp-admin/plugins.php(10): require_once('…')\n#12 {main}\n thrown in /var/www/domain.tld/httpdocs/wp-admin/includes/class-wp-filesystem-direct.php on line 164, referer: https://domain.tld/wp-admin/plugins.php

    • This topic was modified 9 months ago by neralex.
Viewing 11 replies - 1 through 11 (of 11 total)
  • dennycy

    (@dennycy)

    I am also facing a similar issue in version 5.0.3, where the site crashes with a critical error in both the frontend and admin areas. Although I managed to roll back to version 5.0.2, it didn’t resolve the issue. Currently, I have deactivated the plugin. Whenever I attempt to reactivate it, the site crashes again.

    Thread Starter neralex

    (@neralex)

    @dennycy 5.0.3 is working for me, so I rolled back to this version.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @neralex, can you tell me who your hosting provider is?

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    Hi @dennycy, the issue your facing is likely different than neralax’s. can you tell me if you see an error message anywhere? If not, can you temporarily add:

    define('WP_DEBUG', 1);
    define('WP_DEBUG_LOG', 1);

    to your wp-config.php file? (Make sure to add it *before* the “/* That’s all, stop editing! Happy publishing. */” line.)

    Then activate Matomo, trigger the error and check the debug.log file that appears in the wp-content directory.

    Thread Starter neralex

    (@neralex)

    @dizzyatinnocraft This is an dedicated server with debian 12 on Hetzner in Germany and I’m using the Sury.org package-list for PHP8.1.x.

    During the first update-procedure via the wordpress-dashboard I got the message that the matomo folder from the plugin directory could not be moved to the directory: upgrade-temp-backup. The update was cancelled immediately afterwards. As a result, there was no longer a matomo folder in the plugins directory. So I downloaded the latest version via the wordpress-dashboard and encountered this critical error for the first time when I tried to activate the plugin. So I downloaded the latest version of the plugin directly from www.ads-software.com and uploaded the files via FTP. When I tried to activate the plugin, then I got this critical error again.

    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @neralax This specific issue isn’t due entirely to the Matomo plugin, but due to the WP_Filesystem() function either failing and/or WordPress not being set up properly (thus resulting in the FS_CHMOD_… constants not getting defined).

    When determining how to best read/write to files, WordPress will write a dummy file to the wp-content dir. It will then check to see if the file owner of the newly created file (which should be the user that the webserver is running as) matches the file owner of the wp-admin/includes/file.php file. If they don’t match, then WordPress tries to access everything via ftp or something similar instead of just reading/writing to the filesystem directly. Would you be able to check if this is the case in your install?

    Thread Starter neralex

    (@neralex)

    @dizzyatinnocraft This sounds similuar to this old wordpress issue: https://core.trac.www.ads-software.com/ticket/41329#comment:5

    The file-owner of this file is in the same user-group of the user, that is running the webserver. This is needed to upload files via ftp to the web-directory, where the installation is placed and it with all other plugins and their update-precedures without this issue. When a new file or folder was a created by a lugin, then is it created with the user of the webserver – how it should be.

    I changed the owner of the file.php to the webserver-user and tried to update the plugin again and got this error-message on the update-screen of the dashboard:

    An error occurred while updating Matomo Analytics - Ethical Stats. Powerful Insights.: The update cannot be installed because some files could not be copied. This is usually due to inconsistent file permissions.

    So I changed the file-permission of the file.php back and checked the permissions of the matomo-folder inside the plugin-directory, which I uploaded via FTP today – the folder was not added to the user-group of the webserver-user. After changing the folder permissions the update runs without any issue.

    EDIT: But the critical error still exists. So I changed the file-permissions of the file.php back to the webserver-user and the issue was gone.

    Thanks for your information to understand how it works. When a new folder was a created by an FTP-user, then the user of the webserver got no write-permission. This was the reason, why the folder was not able to move. On this way I found a little permisson-issue on my FTP-users, which I was able fix too.

    • This reply was modified 9 months ago by neralex.
    • This reply was modified 9 months ago by neralex.
    • This reply was modified 9 months ago by neralex.
    Plugin Support dizzyatinnocraft

    (@dizzyatinnocraft)

    @neralex I take it the latest version 5.0.4 is now working properly for you? Let me know if not or there are any other issues.

    Regarding the critical, we’ll be making a change to avoid a critical error in this case so WP will at least still be accessible. That change will be in the next release near the end of this month.

    Thread Starter neralex

    (@neralex)

    @dizzyatinnocraft Yeah, I was able to do the update and the current version is running now without any other issues. Thanks for trying to avoid the critical error in the next release.

    I still have the issue with matomo 5.0.5 wordpress plugin. After the update it will crash the whole admin backend.

    Thread Starter neralex

    (@neralex)

    @nicohood yeah same here. The way how the authors are using write-permissions for moving the files while the update-procedure is still not working properly and it happens only with this plugin. It crashes at the first try, then WP is disabling the plugin, then I have to delete all the plugin-files from /upgrade-temp-backup/, there the downloaded update-files are located and couldn’t be copied the /plugins/ folder, then I have to delete the old files from /plugins/ folder and THEN I can finally reinstall the plugin without any issues directly. I don’t know what is causing this trouble but this is only one plugin, which makes so much trouble. I’m close to delete it and will set up an stand-alone matomo instance… it’s really annoying.

    • This reply was modified 7 months, 4 weeks ago by neralex.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘5.0.4 critical error: After update can’t access backend’ is closed to new replies.