@habakuk007 opened this Issue on December 11th 2020

Hello,

since the update to 4.0.5 I get these error message from cron (and also in the web ui):

ERROR [2020-12-11 11:00:12] 4020 Uncaught exception: core/Date.php(160): The date '1970-01-01' is a date before first website was online. Try date that's after Aug 6, 1991 (timestamp 681436800).: 2
The date '1970-01-01' is a date before first website was online. Try date that's after Aug 6, 1991 (timestamp 681436800).: 2

[Exception]
The date '1970-01-01' is a date before first website was online. Try date that's after Aug 6, 1991 (timestamp 681436800).: 2

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[="..."]] [--disable-scheduled-tasks] [--accept-invalid-ssl-certificate] [--php-cli-options[="..."]] [--force-all-websites]

The version I had before the update was probably 4.0.3 and it worked for several years now.

I use this instance of matomo not for the tracking of software usage, not for websites.

Matomo-Version: 4.0.5
MySQL-Version: 10.3.25-MariaDB
PHP-Version: 7.4.13

Any ideas?

Regards!
Stefan

@tsteur commented on December 14th 2020 Member

@diosmosis do you have maybe any idea?

@diosmosis commented on December 14th 2020 Member

Looks like something is doing new Date(2), which seems rather strange. Only thing I can think of is a timestamp in the archive table being off or having to deal w/ some other strange data.

@habakuk007 could you run the command with -vvv (ie, ./console core:archive -vvv) and post the result?

@habakuk007 commented on December 14th 2020

Hello @diosmosis,

thanks for your answer!

If I run ./console core:archive -vvv I still get the error Uncaught exception: Date.php(160): The date '1970-01-01' is a date before first website was online. (see
output.txt

Trace:

Exception trace:
() at /var/www/virtual/u/html/core/Date.php:160
Piwik\Date::factory() at /var/www/virtual/u/html/core/ArchiveProcessor/Loader.php:441
Piwik\ArchiveProcessor\Loader->getMinVisitTimesPerSite() at /var/www/virtual/u/html/core/ArchiveProcessor/Loader.php:413
Piwik\ArchiveProcessor\Loader->hasSiteVisitsBetweenTimeframe() at /var/www/virtual/u/html/core/ArchiveProcessor/Loader.php:365
Piwik\ArchiveProcessor\Loader->canSkipThisArchive() at /var/www/virtual/u/html/core/CronArchive.php:864
Piwik\CronArchive->invalidateRecentDate() at /var/www/virtual/u/html/core/CronArchive.php:808
Piwik\CronArchive->invalidateArchivedReportsForSitesThatNeedToBeArchivedAgain() at /var/www/virtual/u/html/core/CronArchive/QueueConsumer.php:160
Piwik\CronArchive\QueueConsumer->getNextArchivesToProcess() at /var/www/virtual/u/html/core/CronArchive.php:367
Piwik\CronArchive->run() at /var/www/virtual/u/html/core/CronArchive.php:262
Piwik\CronArchive->Piwik{closure}() at /var/www/virtual/u/html/core/Access.php:664
Piwik\Access::doAsSuperUser() at /var/www/virtual/u/html/core/CronArchive.php:268
Piwik\CronArchive->main() at /var/www/virtual/u/html/plugins/CoreConsole/Commands/CoreArchiver.php:27
Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute() at /var/www/virtual/u/html/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /var/www/virtual/u/html/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/virtual/u/html/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at n/a:n/a
call_user_func() at /var/www/virtual/u/html/core/Console.php:130
Piwik\Console->Piwik{closure}() at /var/www/virtual/u/html/core/Access.php:673
Piwik\Access::doAsSuperUser() at /var/www/virtual/u/html/core/Console.php:131
Piwik\Console->doRunImpl() at /var/www/virtual/u/html/core/Console.php:82
Piwik\Console->doRun() at /var/www/virtual/u/html/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /var/www/virtual/u/html/console:32

I also get this error in the UI (but here only for a test instance, that probably uses dates like '1970-01-01'):

grafik

Regards!
Stefan

@diosmosis commented on December 15th 2020 Member

@habakuk007 this should be fixed by https://github.com/matomo-org/matomo/pull/16957, would you be able to confirm? It seems that you have a visit with a timestamp of 2 (2 seconds past the posix epoch).

@habakuk007 commented on December 15th 2020

Hello @diosmosis,

I applied the changes from #16957 to the Loader.php on my server and now it works again.

Thanks!

This Issue was closed on December 15th 2020
Powered by GitHub Issue Mirror