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

Notice - A non well formed numeric value encountered in Goals API #18261

Closed
tsteur opened this issue Nov 3, 2021 · 2 comments · Fixed by #18355
Closed

Notice - A non well formed numeric value encountered in Goals API #18261

tsteur opened this issue Nov 3, 2021 · 2 comments · Fixed by #18355
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Nov 3, 2021

Below warnings I can see in our own Matomo. It refers to this line https://github.com/matomo-org/matomo/blob/4.6.0-b2/plugins/Goals/API.php#L513

WARNING CoreHome[2021-11-02 23:33:27 UTC] [ee954 ] core/Metrics/Formatter.php(161): Notice - A non well formed numeric value encountered - Matomo 4.5.0 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already) #0/core/Metrics/Formatter.php(161),#1/plugins/CoreHome/Columns/Metrics/ConversionRate.php(42),#2/core/Metrics/Formatter.php(202),#3/plugins/Goals/API.php(522),[internal function]: Piwik\Plugins\Goals\API->Piwik\Plugins\Goals{closure}(),#5/core/DataTable.php(512),#6/core/DataTable.php(618),#7/core/DataTable/Map.php(97),#8/core/API/DataTablePostProcessor.php(303),#9/core/API/DataTablePostProcessor.php(133)

We have probably hundred of these entries for each request where this happens.

Let me know if more details is needed to find the problem.

@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Nov 3, 2021
@tsteur tsteur added this to the 4.7.0 milestone Nov 3, 2021
@sgiehl
Copy link
Member

sgiehl commented Nov 18, 2021

@tsteur are you able to figure out an example url where that happens?
I would assume the reason is kind of explained in the comment here maybe:

// if we are comparing, this will be queried with format_metrics=0, but we will eventually need to format the metrics.
// unfortunately, we can't do that since the processed metric information is in the GetMetrics report. in this case,
// we queue the filter so it will eventually be formatted.
if (!empty($compare)) {
$getMetricsReport = ReportsProvider::factory('Goals', 'getMetrics');
$table->queueFilter(function (DataTable $t) use ($getMetricsReport) {
$t->setMetadata(Metrics\Formatter::PROCESSED_METRICS_FORMATTED_FLAG, false);
$formatter = new Metrics\Formatter();
$formatter->formatMetrics($t, $getMetricsReport, $metricsToFormat = null, $formatAll = true);
});
}

It says the data is normally queried with format_metrics=0, but to get formatted metrics nevertheless, the formatter is applied.
I actually wonder if the problem occurs if a compare is requested with format_metrics=1? In that case the metric might already be formatted, but the formatter is applied again nevertheless. Maybe the problem would be solved if we extend the condition with an direct check if format_metrics === 0

@tsteur
Copy link
Member Author

tsteur commented Nov 18, 2021

Indeed it might only happen when comparing. I view a specific goal report for a week, then compare a segment, and then see this in the logs. I don't have a specific URL though.

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

Successfully merging a pull request may close this issue.

2 participants