Matomo undercounting visitors and pageviews

I’ve had Matomo running successfuly for over a year on AWS. Two days ago my visitor count reported went from over 750 to 39. I checked the Matomo visitor log and counted 800 visitors. I followed the instructions to delete the reports for the day. Still got 39. On the next day, my count showed as 39 on Sunday and 400 on Monday. Monday’s actual count was 800. I rebooted the server. Also Matomo updated on Monday to version 4.11.0. No change in the bad count. What can I do?

Can you access the Matomo logs. Is there any error (eg during the archiving process)?

I have been running the archive as a corn job. It has worked for ages. This new problem occurred starting just a day before v11 update. Here is the output from the corn job:

Webmin Dashboard

Execute Cron Job

Output from command //usr/local/bin/php /usr/local/www/matomo/console core:archive --url=“https://stats.malechastityjournal.com” > /dev/null …

ERROR [2022-08-10 19:29:26] 48003 Got invalid response from API request: ?module=API&method=CoreAdminHome.archiveReports&idSite=1&period=year&date=2022-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 [2022-08-10 19:29:26] 48003 Uncaught exception: /usr/local/www/matomo/libs/Zend/Db/Statement/Pdo.php(236): SQLSTATE[HY000]: General error: 2006 MySQL server has gone away [Query: , CLI mode: 1] [Zend_Db_Statement_Exception] SQLSTATE[HY000]: General error: 2006 MySQL server has gone away [PDOException] SQLSTATE[HY000]: General error: 2006 MySQL server has gone away core:archive [–url="…"] [–skip-idsites[="…"]] [–skip-all-segments] [–force-idsites[="…"]] [–skip-segments-today] [–force-periods[="…"]] [–force-date-last-n[="…"]] [–force-date-range[="…"]] [–force-idsegments="…"] [–concurrent-requests-per-website[="…"]] [–concurrent-archivers[="…"]] [–max-websites-to-process="…"] [–max-archives-to-process="…"] [–disable-scheduled-tasks] [–accept-invalid-ssl-certificate] [–php-cli-options[="…"]] [–force-all-websites] [–force-report[="…"]]

Maybe you have more data to archive as before… Then did you try to increase the value of ‘memory_limit’ in your php.ini file as suggested by the error message?
Did you also check the PHP CLI error log file?

Were you able to fix this? How? Same thing happened to me when updating to 4.11.

The php.ini file is used by PHP to store its settings. For its location: