Piwik Exception MissingFilePermissionException

since the beginning of May, I have this error, I followed the information provided, but it does not correct anything.
Thank you for your help

Fatal error: Uncaught Piwik\Exception\MissingFilePermissionException:

Matomo couldn't write to some directories (running as user 'www-data').

Try to Execute the following commands on your server, to allow Write access on these directories:

    chown -R www-data:web /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/app
    find /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/cache/matomo/logs -type f -exec chmod 644 {} \;
    find /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/cache/matomo/logs -type d -exec chmod 755 {} \;

If this doesn't work, you can try to create the directories with your FTP software, and set the CHMOD to 0755 (or 0777 if 0755 is not enough). To do so with your FTP software, right click on the directories then click permissions.

After applying the modifications, you can refresh the page.

If you need more help, try Matomo.org.
in /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/app/core/Filechecks.php:95 Stack trace: #0 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/app/core/FrontController.php(318): Piwik\Filechecks::dieIfDirectoriesNotWritable() #1 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Bootstrap.php(84): Piwik\FrontController->init() #2 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Bootstrap.php(110): WpMatomo\Bootstrap->bootstrap() #3 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/SystemReport.php(135): WpMatomo\Bootstrap::do_bootstrap() #4 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/Menu.php(71): WpMatomo\Admin\SystemReport->__construct() #5 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/class-wp-hook.php(308): WpMatomo\Admin\Menu->add_menu() #6 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() #7 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/plugin.php(517): WP_Hook->do_action() #8 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-admin/includes/menu.php(155): do_action() #9 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-admin/menu.php(420): require_once('...') #10 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-admin/admin.php(158): require('...') #11 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-admin/plugins.php(10): require_once('...') #12 {main} thrown in /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/app/core/Filechecks.php on line 95
1 Like

Hi @gregouzdev
Can you check the user running the CRON (in case a CRON is set) is the same as the user running Matomo?
Can you also check, with the Matomo PHP “user” that you can write in the pointed directories?

Hi @Philippe,
yes the problem is there, there is no scheduled cron task, and the user/group are the same throughout the tree structure, I tried to put the rights 755 and 777, but nothing exchange

i have add in wp-config.php

define('WP_DEBUG', true );
define('WP_DEBUG_LOG', true );
define('MATOMO_DEBUG', true );
define('MATOMO_SAFE_MODE', true );
define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false);

since the error is :

Fatal error: Uncaught Error: Class "Piwik\Plugins\SitesManager\Model" not found in /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/SystemReport.php:997 
Stack trace: 
#0 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/SystemReport.php(252): WpMatomo\Admin\SystemReport->get_wordpress_info() #1 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/SystemReport.php(322): WpMatomo\Admin\SystemReport->get_error_tables() 
#2 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/class-wp-hook.php(308): WpMatomo\Admin\SystemReport->show() 
#3 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters() 
#4 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-includes/plugin.php(517): WP_Hook->do_action() #5 /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-admin/admin.php(259): do_action() 
#6 {main} thrown in /var/www/vhosts/mydomain.com/tld-www.mydomain.com/wp-content/plugins/matomo/classes/WpMatomo/Admin/SystemReport.php on line 997

WordPress 6.2.2
PHP 8.1.20 (FastCGI)
Matomo Analytics 4.14.2

do you have an idea ?