-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Closed
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.
Milestone
Description
See #18436 (comment)
There is most likely also be a regression we should handle in 4.6.2. The problem is the update script, which tries to iterate over all segments here:
matomo/core/Updates/4.6.0-b4.php
Lines 51 to 77 in 4fe950a
foreach ($idSites as $idSite) { | |
$segmentStrings = Rules::getSegmentsToProcess([$idSite]); | |
foreach ($segmentStrings as $segmentString) { | |
$segment = new Segment($segmentString, [$idSite]); | |
if ($segment->getOriginalString() === $segment->getString()) { | |
continue; | |
} | |
$segmentsToAppend = [VisitFrequencyAPI::NEW_VISITOR_SEGMENT, VisitFrequencyAPI::RETURNING_VISITOR_SEGMENT]; | |
foreach ($segmentsToAppend as $segmentToAppend) { | |
// we need to migrate the existing archive | |
$oldSegmentString = Segment::combine($segment->getString(), SegmentExpression::AND_DELIMITER, $segmentToAppend); | |
$newSegmentString = Segment::combine($segment->getOriginalString(), SegmentExpression::AND_DELIMITER, $segmentToAppend); | |
$oldSegmentHash = Segment::getSegmentHash($oldSegmentString); | |
$newSegmentHash = Segment::getSegmentHash($newSegmentString); | |
if ($oldSegmentHash === $newSegmentHash) { | |
continue; | |
} | |
$doneFlagsToMigrate['done' . $oldSegmentHash . '.Goals'] = 'done' . $newSegmentHash . '.Goals'; | |
$doneFlagsToMigrate['done' . $oldSegmentHash . '.VisitsSummary'] = 'done' . $newSegmentHash . '.VisitsSummary'; | |
$doneFlagsToMigrate['done' . $oldSegmentHash . '.UserCountry'] = 'done' . $newSegmentHash . '.UserCountry'; | |
} | |
} | |
} |
We should do a try/catch around the segment construct and simply skip segments that cause an exception.
To prevent an error during update like this:
./console core:update --yes -vvv
*** Update ***
Database Upgrade Required
Your Matomo database is out-of-date, and must be upgraded before you can continue.
Matomo database will be upgraded from version 4.5.0 to the new version 4.6.1.
ERROR [2021-12-01 11:47:55] 51704 Uncaught exception: /matomo/core/Segment.php(215): Segment 'dimension1' is not a supported segment. [Query: , CLI mode: 1]
DEBUG [2021-12-01 11:47:55] 51704 Loaded plugins: (...)
[Exception]
Segment 'dimension1' is not a supported segment.
Exception trace:
(...)
Metadata
Metadata
Assignees
Labels
BugFor errors / faults / flaws / inconsistencies etc.For errors / faults / flaws / inconsistencies etc.