matomo-org / matomo-for-wordpress

Get a fully functioning Matomo Analytics for your WordPress. Star us on Github? +1. Matomo is the leading open alternative to Google Analytics that gives you full control over your data. Privacy is built-in. 100% data ownership, no one else can see your data. We love Pull Requests!
https://matomo.org
GNU General Public License v3.0
120 stars 25 forks source link

Error when archiving report #820

Closed Anideus closed 1 year ago

Anideus commented 1 year ago

Hello

I've had a big problem with Matomo for a few days now. (19th July) I can't see any more visits. The log is working, but the archives are not. Real-time visits : Ok Graph of last visits and summary of visits: 0

I've been using Matomo for over a year now and it suddenly stopped working on 19 July. I haven't touched a thing.

I've tried to follow the method to find a solution, and manual archiving gives me a big error line. I'll copy and paste it below. Sorry, it's in French.

Matomo Archive Warnings: 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-21&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-21&format=json&trigger=archivephp: \'\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-20&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-20&format=json&trigger=archivephp: \'\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-19&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=day&date=2023-07-19&format=json&trigger=archivephp: \'\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=week&date=2023-07-17&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=week&date=2023-07-17&format=json&trigger=archivephp: \'\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2023-07-01&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=month&date=2023-07-01&format=json&trigger=archivephp: \'\'' 'Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2023-01-01&format=json&trigger=archivephp. The response was empty. This usually means a server error. A solution to this error is generally to increase the value of \'memory_limit\' in your php.ini file. For more information and the error message please check in your PHP CLI error log file. As this core:archive command triggers PHP processes over the CLI, you can find where PHP CLI logs are stored by running this command: php -i | grep error_log' 'Error unserializing the following response from ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2023-01-01&format=json&trigger=archivephp: \'\'' '12 total errors during this script execution, please investigate and try and fix these errors.' '12 total errors during this script execution, please investigate and try and fix these errors.'

I dont know how i can fix that. :/

Infos: Wordpress 6.2.2 PHP Version: 8.0.28 matomo: 4.14.2 Thème: Magazine news byte premium

Anideus commented 1 year ago

Hello, I relink here the system report. Someone can help me please?

Thanks a lot to you...

Errors

Matomo

Endpoints

Crons

Contrôles obligatoires

Contrôles facultatifs

Matomo Settings

Logs

WordPress

WordPress Plugins

Server

PHP cli

Database

Browser

Anideus commented 1 year ago

Hello. I tried uninstalling and reinstalling Matomo. The problem is still there, and I still get the same error. I've searched with a friend, but I can't find the source of the problem.

The new error:

Rapport system:

              # Errors

Matomo

Endpoints

Crons

Contrôles obligatoires

Contrôles facultatifs

Matomo Settings

Logs

WordPress

WordPress Plugins

Server

PHP cli

Database

Browser

diosmosis commented 1 year ago

Hi @Anideus, apologies for the late reply. Can you try increasing the wordpress memory limits and see if that has an effect? For example, setting define('WP_MAX_MEMORY_LIMIT', '1024M'); or define('WP_MEMORY_LIMIT', '256M'); in your wp-config.php file?

Anideus commented 1 year ago

Hello. Thanks for the reply and your help :) Unfortunately I don't have access to this part, and can't change it, as I'm on a shared server with OVH. (I've tried to ask them too, but they refuse to do it themselves). What's strange is that Matomo has been on this site for 2 years, and has never had any problems. Then all of a sudden there was nothing left in terms of data, and these errors appeared (I'd say around 15 July - last Update). I reinstalled, but it didn't change anything....

diosmosis commented 1 year ago

@Anideus can you add define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false); to your wp-config.php file and see if it makes a difference for archiving?

diosmosis commented 1 year ago

@Anideus you should have access to the files on your server, like the wordpress and matomo PHP files, correct?

Anideus commented 1 year ago

Hello.

Thank you very much for your help.

I tried to add this line in the wp-config.PHP as requested.

It literally broke the site. (erreur 503) I had to remove the line to get the site back to normal...

image

diosmosis commented 1 year ago

@Anideus you have to add the code exactly before the "That's all, stop editing!" message in the file. The file needs to look like this when your modification is finished (please read the note first):

<?php
// ... everything before /* That's all, stop editing! Happy publishing. */ should be here and unmodified

define('MATOMO_SUPPORT_ASYNC_ARCHIVING', false);

/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
  define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

Note: Please don't post the contents of the file here, it can contain sensitive information.

If you're not comfortable making the change, that's ok, but it might be a little bit before I can help further.

Anideus commented 1 year ago

OH! Thank you so much! I positioned the line of code where you advised, and it reactivated the data. I can see the number of visits again! Thank you very much for your help, sincerely. (I was pulling my hair out :) ) image

(but it seems that Matomo still has errors. Should I submit the troubleshooting report?) image

diosmosis commented 1 year ago

@Anideus I'm glad it's working now! Can you check the System Report to see what the items in red are? We'll see if you can just ignore that notice.

Anideus commented 1 year ago

Hello

Well thanks for the answers. Well, i have this errors:

image

But However, the "Archive reports" button gives me a strange error. If I try to archive, it displays my entire style sheet (with the !doctype html).

diosmosis commented 1 year ago

@Anideus you should be able to ignore those two warnings. The first case might mean Matomo might load a bit slower than it has to. The second case might be a problem if your site is high volume. But in either case, your hosting provider would have to change these values, you won't be able to affect them by yourself.

If I try to archive, it displays my entire style sheet (with the !doctype html).

Can you provide a screenshot of at least a part of what you see after clicking it? (Note: if there's data displaying then archiving is working, it's just that this troubleshooting button isn't. You could ignore it but it might be good to find out what's happening.)

Anideus commented 1 year ago

Hello.

Well, i'm in trouble again.. And i dont know why >_< For the last 3 days, I've had nothing displayed. It seems to be updating in the wordpress dashboard widget, but if I go into matomo, I get stuck on this display. Yet again, I haven't touched anything. I don't understand a thing...

image

In my ftp journal i can see this line in error : AH01630: client denied by server configuration: /var/www/vhosts/nameofthesite.com/wp-content/plugins/matomo/app/config/global.ini.php

I haven't touched a thing...

diosmosis commented 1 year ago

Hi @Anideus, sorry this is happening! Can you do the following:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('MATOMO_DEBUG', true);

(Remember, the additions need to be added before the /* That's all, stop editing! Happy publishing. */ line.)

diosmosis commented 1 year ago

The current issue was due to a plugin incompatibility with W3 Total Cache. Closing this for now as troubleshooting is complete.