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

Fatal error ceil(): Argument #1 ($num) must be of type int|float, string given in GridGraph.php #20616

Closed
tsteur opened this issue Apr 21, 2023 · 8 comments
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.

Comments

@tsteur
Copy link
Member

tsteur commented Apr 21, 2023

See error below on Matomo 4.14.3

Error: {"message":"ceil(): Argument #1 ($num) must be of type int|float, string given","file":"plugins/ImageGraph/StaticGraph/GridGraph.php","line":137,"request_id":"3a575","backtrace":" on plugins/ImageGraph/StaticGraph/GridGraph.php(137)\n#0 plugins/ImageGraph/StaticGraph/GridGraph.php(137): ceil('8.468.35')\n#1 plugins/ImageGraph/StaticGraph/Evolution.php(24): Piwik\Plugins\ImageGraph\StaticGraph\GridGraph->initGridChart(true, 691053, false, true, true)\n#2 plugins/ImageGraph/API.php(506): Piwik\Plugins\ImageGraph\StaticGraph\Evolution->renderGraph()\n#3 [internal function]: Piwik\Plugins\ImageGraph\API->get(3, 'week', '2022-09-19,2023...', 'Goals', 'get', 'evolution', 0, 'revenue', false, true, 1065, 450, '27', '27', '1', 'ecommerceOrder', '3450A3,43a047', '222222', 'efefef', 'dcdcdc', false, '0', false, false)\n#4 core/API/Proxy.php(244): call_user_func_array(Array, Array)\n#5 core/Context.php(28): Piwik\API\Proxy->Piwik\API\{closure}()\n#6 core/API/Proxy.php(335): Piwik\Context::executeWithQueryParameters(Array, Object(Closure))\n#7 core/API/Request.php(267): Piwik\API\Proxy->call('\\Piwik\\Plugins\\...', 'get', Array)\n#8 plugins/API/Controller.php(45): Piwik\API\Request->process()\n#9 [internal function]: Piwik\Plugins\API\Controller->index()\n#10 core/FrontController.php(637): call_user_func_array(Array, Array)\n#11 core/FrontController.php(169): Piwik\FrontController->doDispatch('API', false, Array)\n#12 core/dispatch.php(32): Piwik\FrontController->dispatch()\n#13 index.php(25): require_once('c...')\n#14 {main}","safemode_backtrace":"#0 [internal function]:

URL: /index.php?module=API&method=ImageGraph.get&idSite=3&apiModule=Goals&apiAction=get&token_auth=XYZANONYMIZED&idGoal=ecommerceOrder&period=week&date=2022-09-19,2023-04-16&filter_sort_column=revenue&column=revenue&columns=revenue&language=en&width=1065&height=450&fontSize=27&showMetricTitle=0&aliasedGraph=1&legendAppendMetric=0&backgroundColor=efefef&gridColor=dcdcdc&colors=3450A3,43a047&legendFontSize=27&cacherand=8723117

Referrer: None

GET: {"module":"API","method":"ImageGraph.get","idSite":"3","apiModule":"Goals","apiAction":"get","token_auth":"XYZANONYMIZED","idGoal":"ecommerceOrder","period":"week","date":"2022-09-19,2023-04-16","filter_sort_column":"revenue","column":"revenue","columns":"revenue","language":"en","width":"1065","height":"450","fontSize":"27","showMetricTitle":"0","aliasedGraph":"1","legendAppendMetric":"0","backgroundColor":"efefef","gridColor":"dcdcdc","colors":"3450A3,43a047","legendFontSize":"27","cacherand":"8723117","filter_limit":100}

@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 Apr 21, 2023
@tsteur
Copy link
Member Author

tsteur commented Apr 24, 2023

This happened again today.

@michalkleiner
Copy link
Contributor

Hi @tsteur,
thank you for reporting the issue. Can you please provide a bit more detail on what steps you were taking when the error happened? Was it within the Matomo dashboard or an API request? Thanks!

@michalkleiner michalkleiner added Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. and removed To Triage An issue awaiting triage by a Matomo core team member labels Apr 28, 2023
@tsteur
Copy link
Member Author

tsteur commented Apr 29, 2023

This happened again for yet a different customer.

@michalkleiner I don't have more information.

Was it within the Matomo dashboard or an API request? Thanks!

It says "Referrer: None" so I assume this was a regular API request.

@tsteur
Copy link
Member Author

tsteur commented May 2, 2023

This one happened again.

@Stan-vw
Copy link
Contributor

Stan-vw commented May 2, 2023

Can you perhaps explain a bit further what the problem/impact here is?
I'm not sure if it's just 1 referrer not showing but rather it's showing a "None" value (so it's easy to spot vs interpreting incorrect data), whether this is fixed with a refresh, whether it happens everytime you do the same steps or whether it seems random, ...
Thanks

@tsteur
Copy link
Member Author

tsteur commented May 2, 2023

@Stan-vw the team would be better able to explain than me.

@michalkleiner
Copy link
Contributor

It does look like an API request for a graph and the issue is with the max value being a string instead of a number. We can be defensive and retype in the method that gets the maximum, but that could be hiding some other potential issue. Looking at how CpChart\Data produces the maximum it should never be a string, so this might be worth investigating what is going on in more detail.

@michalkleiner michalkleiner removed the Waiting for user feedback Indicates the Matomo team is waiting for feedback from the author or other users. label May 3, 2023
@michalkleiner
Copy link
Contributor

michalkleiner commented May 4, 2023

I'll close this as a duplicate of #19940 since the symptoms are the same and the fix would also be the same.

@michalkleiner michalkleiner added duplicate For issues that already existed in our issue tracker and were reported previously. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels May 4, 2023
@sgiehl sgiehl closed this as completed May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For issues that already existed in our issue tracker and were reported previously.
Projects
None yet
Development

No branches or pull requests

4 participants