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

When there is a memory error in core:archive process, have a way to see the backtrace #13196

Closed
mattab opened this issue Jul 23, 2018 · 1 comment
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Jul 23, 2018

Use case

  • A core:archive process fails with exhausted memory errors.
  • We need to know what code path was active when the archiving failed.

Got

Example failure from cron:

Error: {"type":1,"message":"Allowed memory size of 8589934592 bytes exhausted (tried to allocate 20480 bytes)","file":"\/core\/DataTable\/Row.php","line":91}

Example failure with the define('PIWIK_PRINT_ERROR_BACKTRACE', true); in bootstrap.php

INFO [2018-07-23 15:51:47] 143396  SUMMARY OF ERRORS
INFO [2018-07-23 15:51:47] 143396  Error: Got invalid response from API request: ?module=API&method=API.get&idSite=8&period=year&date=last5&format=php&trigger=archivephp. Response was 'PHP Fatal error:  Allowed memory size of 8589934592 bytes exhausted (tried to allocate 20480 bytes) in /core/DataTable/Row.php on line 91 a:2:{s:6:"result";s:5:"error";s:7:"message";s:832:"The request requested too much data. To avoid this error, please try to reduce the filter limit. #0 [internal function]: Piwik\Plugins\Cloud\Controller->safemode(Array)
 #1 /core/FrontController.php(559): call_user_func_array(Array, Array)
 #2 /core/FrontController.php(137): Piwik\FrontController->doDispatch('Cloud', 'safemode', Array) 
#3 /core/FrontController.php(88): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array) 
#4 /core/FrontController.php(229): Piwik\FrontController::generateSafeModeOutputFromError(Array) 
#5 [internal function]: Piwik\FrontController::triggerSafeModeWhenError() 
#6 {main}";}'
ERROR [2018-07-23 15:51:47] 143396  1 total errors during this script execution, please investigate and try and fix these errors.

Expected instead

when we set define('PIWIK_PRINT_ERROR_BACKTRACE', true); in bootstrap.php then we would expect somehow to see the original backtrace of the code path that failed, rather than the backtrace of the safe mode.

@mattab mattab added Bug For errors / faults / flaws / inconsistencies etc. c: Performance For when we could improve the performance / speed of Matomo. labels Jul 23, 2018
@mattab mattab added this to the 3.6.0 milestone Jul 23, 2018
@diosmosis diosmosis modified the milestones: 3.6.0, 3.7.0 Jul 24, 2018
@diosmosis diosmosis self-assigned this Aug 1, 2018
@diosmosis
Copy link
Member

@mattab fatal errors don't leave a stack trace so this isn't do-able. Static variables, however, remain so we can build pieces of the stack traces by marking when certain methods start/complete. Will be doing that.

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. c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
Development

No branches or pull requests

2 participants