Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matomo 5 Upgrade issue, userId is not a supported segment, archiving fails #21339

Closed
tsteur opened this issue Oct 2, 2023 · 5 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Oct 2, 2023

This is likely related to https://github.com/matomo-org/matomo/pull/21218/files

refs #21318

We updated to Matomo 5, now archiving fails for some customers with below error and reports are no longer being processed. The update should probably delete any segment that uses this segment as it's no longer available for the given site?

[2023-10-02 21:06:08] piwik.ERROR: Uncaught exception in API: Exception: Segment 'userId' is not a supported segment. in /Segment.php:235 Stack trace: #0 /Segment.php(283): Piwik\Segment->getSegmentByName('userId') #1 /Segment.php(261): Piwik\Segment->getExpressionsWithUnionsResolved(Array) #2 /Segment.php(169): Piwik\Segment->initializeSegment('userId!=', Array) #3 /var/www/html/plugins/CoreAdminHome/API.php(285): Piwik\Segment->__construct('userId%21%3D', Array, Object(Piwik\Date), Object(Piwik\Date)) #4 [internal function]: Piwik\Plugins\CoreAdminHome\API->archiveReports('47', Object(Piwik\Period\Month), '2023-10-01', 'userId%21%3D', false, false) #5 /API/Proxy.php(255): call_user_func_array(Array, Array) #6 /Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}() #7 /API/Proxy.php(346): Piwik\Context::executeWithQueryParameters(Array, Object(Closure)) #8 /API/Request.php(272): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'archiveReports', Array) #9 /var/www/html/plugins/API/Controller.php(45): Piwik\API\Request->process() #10 [internal function]: Piwik\Plugins\API\Controller->index() #11 /FrontController.php(637): call_user_func_array(Array, Array) #12 /FrontController.php(169): Piwik\FrontController->doDispatch('API', false, Array) #13 /dispatch.php(32): Piwik\FrontController->dispatch() #14 /var/www/html/index.php(25): require_once('/var/www/html/c...') #15 /CliMulti/RequestCommand.php(75): require_once('/var/www/html/i...') #16 /Plugin/ConsoleCommand.php(110): Piwik\CliMulti\Req

@tsteur tsteur added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. To Triage An issue awaiting triage by a Matomo core team member labels Oct 2, 2023
@tsteur tsteur changed the title Matomo 5 Upgrade issue, userId is not a supported segment Matomo 5 Upgrade issue, userId is not a supported segment, archiving fails Oct 2, 2023
@sgiehl
Copy link
Member

sgiehl commented Oct 9, 2023

Generally invalid segments shouldn't cause the archiving to fail. Locally I get the error message, but the archiving doesn't fatal.
Anyway. I guess the best solution might be to adjust our methods that provide details about stored segments to automatically filter away all segments that aren't valid anymore. That way, they might be valid for certain sites only and would automatically reappear if the segment becomes valid again.
This might so be solved as part of #21318 or vise versa.

@sgiehl sgiehl removed the To Triage An issue awaiting triage by a Matomo core team member label Oct 9, 2023
@sgiehl sgiehl added this to the For Prioritization milestone Oct 9, 2023
@michalkleiner michalkleiner reopened this Oct 31, 2023
@sgiehl sgiehl modified the milestones: For Prioritization, 5.0.0 Oct 31, 2023
@sgiehl sgiehl added Bug For errors / faults / flaws / inconsistencies etc. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Oct 31, 2023
@MatomoForumNotifications

This issue has been mentioned on Matomo forums. There might be relevant details there:

https://forum.matomo.org/t/5-0-rc-7-upgrade-issue-tried-again-and-all-is-well/53935/3

@sgiehl
Copy link
Member

sgiehl commented Nov 16, 2023

@tsteur I wasn't able to recreate an archiving failure with invalid segments. For me the archiving is only logging an info that the segment is not supported, but continues. I even tried making the segment invalid while the archiving was already running, this didn't cause a failure either. Having browser triggered archiving on causes a couple of similar uncaught exceptions when viewing reports for an invalid segment. But the stack trace is different and more looks archiving related 🤔

@tsteur
Copy link
Member Author

tsteur commented Nov 16, 2023

Thanks @sgiehl . Maybe it was some kind of race condition and we need to see in future if it happens again?

@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Dec 15, 2023
@sgiehl sgiehl closed this as completed Dec 19, 2023
@tsteur
Copy link
Member Author

tsteur commented Dec 23, 2023

Reopening as this is still an issue. It happened on our account again. Will post details internally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

6 participants