After upgrade to matomo4: archive job fails on one site with "segment is not a supported segment"

After upgrading from 3.14.1 to 4.2.1 (which worked pretty well), the archive cronjob throws an exception each time it tries to work on one specific site:

INFO [2021-05-05 13:55:02] 39983  Failed to create invalidations for report re-archiving (idSites = "all", pluginName = VisitFrequency, report = , startDate = 1606089600): Exception: Segment 'adClickId' is n
ot a supported segment. in /srv/www/htdocs/core/Segment.php:210
Stack trace:
#0 /srv/www/htdocs/core/Segment.php(258): Piwik\Segment->getSegmentByName('adClickId')
#1 /srv/www/htdocs/core/Segment.php(236): Piwik\Segment->getExpressionsWithUnionsResolved(Array)
#2 /srv/www/htdocs/core/Segment.php(163): Piwik\Segment->initializeSegment('adClickId!=0', Array)
#3 /srv/www/htdocs/core/Archive/ArchiveInvalidator.php(512): Piwik\Segment->__construct('adClickId!=0', Array)
#4 /srv/www/htdocs/core/Archive/ArchiveInvalidator.php(587): Piwik\Archive\ArchiveInvalidator->reArchiveReport(Array, 'VisitFrequency', NULL, Object(Piwik\Date), 'adClickId!=0')
#5 /srv/www/htdocs/core/CronArchive.php(346): Piwik\Archive\ArchiveInvalidator->applyScheduledReArchiving()
#6 /srv/www/htdocs/core/CronArchive.php(262): Piwik\CronArchive->run()
#7 /srv/www/htdocs/core/Access.php(664): Piwik\CronArchive->Piwik\{closure}()
#8 /srv/www/htdocs/core/CronArchive.php(268): Piwik\Access::doAsSuperUser(Object(Closure))
#9 /srv/www/htdocs/plugins/CoreConsole/Commands/CoreArchiver.php(27): Piwik\CronArchive->main()
#10 /srv/www/htdocs/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(257): Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /srv/www/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 /srv/www/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Piwik\Plugins\CoreConsole\Commands\CoreArchiver), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 [internal function]: Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /srv/www/htdocs/core/Console.php(130): call_user_func(Array, Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /srv/www/htdocs/core/Access.php(673): Piwik\Console->Piwik\{closure}()
#16 /srv/www/htdocs/core/Console.php(131): Piwik\Access::doAsSuperUser(Object(Closure))
#17 /srv/www/htdocs/core/Console.php(82): Piwik\Console->doRunImpl(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /srv/www/htdocs/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Piwik\Console->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /srv/www/htdocs/console(32): Symfony\Component\Console\Application->run()
#20 {main}

Does anybody have an idea what might be wrong?

Thank you in advance!

  • Alexander

Hi,

Can you check what the Segment “adClickId” segments on? Maybe it uses a value that doesn’t exist in Matomo anymore.

Thanks for the hint!
I’m admin, not a user. But one of the users created a segment, which out of a sudden had no(!) definition (expression) anymore after the upgrade. Strange thing is that the segment name was different to the one mentioned in the error message.
But giving it a valid definition worked.

Thanks again!