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
Field width 3356450096 is too long in core/DataTable.php #18544
Comments
@tsteur I think that error actually only occurs as Line 1585 in 70b004c
But it tries to add the full array content to the exception message. Locally that ends up for me in a memory exhausted error. Maybe the message above would occur if I would have a more memory available. We maybe should change the error messages in that case, so it no longer tries to add the full data content. |
Truncating the exported array makes sense and could be a good quick fix 👍 We could limit it to the first 1M characters or so |
Actually I'm not sure if it's worth to include it at all. The variable is an array, so doing a var_export on it will double the amount of used memory for it. So we would need to truncate the array before dumping it, but hard to say how big the dump will be without looking through the array content and its structure. |
Not sure if I understand correctly. I thought in this case it's not a memory issue but maybe a limitation in |
I think the problem is, that the array is too big in some cases. But we can't know which part of the array is how big. So using the first 1000 entries in the array might still be too big, depending on the complexity of the array. |
We had the same problem again
Request:
|
I'll prepare a PR to adjust the exception messages. I guess there is no much value in printing the whole content in the exception anyway. |
Error: {"type":1,"message":"Field width 3356450096 is too long","file":"/var/www/html/core/DataTable.php","line":1586,"request_id":"2b6ce","backtrace":" on /var/www/html/core/DataTable.php(1586)\n","safemode_backtrace":"#0 [internal function]: Piwik\Plugins\MyPlugin\Controller->safemode(Array)\n#1 /core/FrontController.php(619): call_user_func_array(Array, Array)\n#2 /core/FrontController.php(168): Piwik\FrontController->doDispatch('MyPlugin', 'safemode', Array)\n#3 /core/FrontController.php(99): Piwik\FrontController->dispatch('CorePluginsAdmi...', 'safemode', Array)\n#4 /core/FrontController.php(274): Piwik\FrontController::(Array)\n#5 [internal function]: Piwik\FrontController::triggerSafeModeWhenError()\n#6 {main}"}
URL: https://example.matomo.org/index.php?date=previous24&period=month&expanded=1&filter_limit=-1&force_api_session=1&format=CSV&idSite=4&language=fr&method=API.getProcessedReport&apiModule=Referrers&apiAction=getReferrerType&module=API&period=month&segment=&translateColumnNames=1&convertToUnicode=0&token_auth=....
No referrer
GET: {"date":"previous24","period":"month","expanded":"1","filter_limit":"-1","force_api_session":"1","format":"CSV","idSite":"4","language":"fr","method":"API.getProcessedReport","apiModule":"Referrers","apiAction":"getReferrerType","module":"API","segment":"","translateColumnNames":"1","convertToUnicode":"0","token_auth":"....","format_metrics":"bc"}
POST: {"token_auth":"....","date":"previous24","period":"month","expanded":"1","filter_limit":"-1","force_api_session":"1","format":"CSV","idSite":"4","language":"fr","method":"API.getProcessedReport","apiModule":"Referrers","apiAction":"getReferrerType","module":"API","segment":"","translateColumnNames":"1","convertToUnicode":"0","format_metrics":"bc"}
The text was updated successfully, but these errors were encountered: