Archiving issue in DataTable.php: Deprecated - Implicit conversion from float 2009.999 to int loses precision · Issue #21357 · matomo-org/matomo · GitHub
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

Archiving issue in DataTable.php: Deprecated - Implicit conversion from float 2009.999 to int loses precision #21357

Closed
tsteur opened this issue Oct 4, 2023 · 4 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Oct 4, 2023

We're seeing below warning on PHP 8.1 which causes the archiving to stop afterwards.

[2023-10-04 02:52:58] piwik.DEBUG: PluginsArchiver::callAggregateAllPlugins: Archiving year reports for plugin 'CustomReports' using reports for smaller periods. ["callAggregateAllPlugins","CustomReports"] {"class":"CoreAdminHome","request_id":"4149 "}

[2023-10-04 02:52:58] piwik.DEBUG: aggregating record CustomReports_customreport_1_2 [archive = [idSite = 6, period = year 2023-01-01,2023-12-31, segment = pageUrl=@%252Ftest, plugin = , report = ]] {"record":"CustomReports_customreport_1_2","archive":"[idSite = 6, period = year 2023-01-01,2023-12-31, segment = pageUrl=@%252Ftest, plugin = , report = ]"} {"class":"CustomReports","request_id":"4149 "}

2023-10-04 02:52:58] piwik.WARNING: core/DataTable.php(833): Deprecated - Implicit conversion from float 2009.9999999999998 to int loses precision - Matomo 4.15.2-b1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already) {"trace":[{"file":"core/DataTable.php","line":833,"function":"errorHandler","class":"Piwik\ErrorHandler","type":"::"},{"file":"core/DataTable.php","line":1982,"function":"addRow","class":"Piwik\DataTable","type":"->"},{"file":"core/DataTable.php","line":1966,"function":"aggregateRow","class":"Piwik\DataTable","type":"->"},{"file":"core/DataTable.php","line":651,"function":"aggregateRowWithLabel","class":"Piwik\DataTable","type":"->"},{"file":"core/ArchiveProcessor.php","line":442,"function":"addDataTable","class":"Piwik\DataTable","type":"->"},{"file":"core/ArchiveProcessor.php",
"line":375,"function":"getAggregatedDataTableMapFromBlobs","class":"Piwik\ArchiveProcessor","type":"->"},{"file":"core/ArchiveProcessor.php","line":232,"function":"aggregateDataTableRecord","class":"Piwik\ArchiveProcessor","type":"->"},{"file":"plugins/CustomReports/Archiver.php","line":595,"function":"aggregateDataTableRecords","class":"Piwik\ArchiveProcessor","type":"->"},{"file":"core/Plugin/Archiver.php","line":108,"function":"aggregateMultipleReports","class":"Piwik\Plugins\CustomReports\Archiver","type":"->"},{"file":"core/ArchiveProcessor/PluginsArchiver.php","line":173,"function":"callAggregateMultipleReports","class":"Piwik\Plugin\Archiver","type":"->"},{"file":"core/ArchiveProcessor/Loader.php","line":289,"function":"callAggregateAllPlugins","class":"Piwik\ArchiveProcessor\PluginsArchiver","type":"->"},{"file":"core/ArchiveProcessor/Loader.php","line":181,"function":"prepareAllPlu
ginsArchive","class":"Piwik\ArchiveProcessor\Loader","type":"->"},{"file":"core/ArchiveProcessor/Loader.php","line":164,"function":"insertArchiveData","class":"Piwik\ArchiveProcessor\Loader","type":"->"},{"file":"core/ArchiveProcessor/Loader.php","line":104,"function":"prepareArchiveImpl","class":"Piwik\ArchiveProcessor\Loader","type":"->"},{"file":"core/Context.php","line":75,"function":"Piwik\ArchiveProcessor\{closure}","class":"Piwik\ArchiveProcessor\Loader","type":"->"}]} {"class":"CustomReports","request_id":"4149 "}

@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 4, 2023
@sgiehl
Copy link
Member

sgiehl commented Oct 4, 2023

Hm. That one doesn't make much sense when looking at the code:
https://github.com/matomo-org/matomo/blob/d47d5b4/core/DataTable.php#L833

How should a count on an array return a float? 🤔

@mneudert
Copy link
Member

mneudert commented Oct 4, 2023

What is inside the label column in this case?

If that is a float the message would be the result of the magic array key conversion. Minimal example of that would be $x[1.1] = 'foo'.

@michalkleiner
Copy link
Contributor

Interesting, didn't know about that conversion — deprecation thrown in this 3v4l.org example.

@sgiehl
Copy link
Member

sgiehl commented Oct 4, 2023

For custom reports I guess pretty anything can be in a label column

@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. To Triage An issue awaiting triage by a Matomo core team member labels Oct 5, 2023
@sgiehl sgiehl added this to the 5.0.0 milestone Oct 5, 2023
@sgiehl sgiehl closed this as completed Oct 11, 2023
@sgiehl sgiehl modified the milestones: 5.0.0, 4.15.2 Oct 30, 2023
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.
Projects
None yet
Development

No branches or pull requests

4 participants