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

warning Piwik.php(122): Warning - A non-numeric value encountered #14540

Closed
mattab opened this issue Jun 19, 2019 · 9 comments · Fixed by #15304
Closed

warning Piwik.php(122): Warning - A non-numeric value encountered #14540

mattab opened this issue Jun 19, 2019 · 9 comments · Fixed by #15304
Assignees
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Jun 19, 2019

WARNING: www/demo.piwik.org/core/Piwik.php(122): Warning - A non-numeric value encountered - Matomo 3.10.0-rc1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)

@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Jun 19, 2019
@mattab mattab added this to the 3.10.0 milestone Jun 19, 2019
@fdellwing
Copy link
Contributor

fdellwing commented Jun 19, 2019

matomo/core/Piwik.php

Lines 120 to 123 in 4fc073e

public static function getPercentageSafe($dividend, $divisor, $precision = 0)
{
return self::getQuotientSafe(100 * $dividend, $divisor, $precision);
}

I searched the log for newly added or changed calls to this function, but was not able to find anything recent. So it might be a side effect of another change.

git log -SgetPercentageSafe -- .
git log -GgetPercentageSafe -- .

@mattab mattab modified the milestone: 3.10.0 Jun 23, 2019
@mattab
Copy link
Member Author

mattab commented Jun 27, 2019

Again got the error on demo where it was displayed 10 times in a row... this may affect all users, not sure... Could we maybe add a silent fail in front of it? or throw an exception (may cause some feature of Matomo to fail)? @diosmosis @tsteur

@Findus23
Copy link
Member

@mattab I already though a few times that it might be helpful to add an option that can be temporarily enabled (with a system check urging everyone to disable it again) that will display proper stack traces to all error messages.

That would make debugging far easier as the whole error message people post isn't that helpful in many cases when the php error or warning just occurs in some helper function or in twig.

@tsteur
Copy link
Member

tsteur commented Jun 28, 2019

It could also be just logged to the file. Such things aren't easy to troubleshoot etc. Best to move this to 3.11

@mattab mattab modified the milestones: 3.10.0, 3.11.0 Jun 29, 2019
@mattab mattab modified the milestones: 3.11.0, 3.12.0 Jul 23, 2019
@katebutler katebutler self-assigned this Oct 4, 2019
@tsteur
Copy link
Member

tsteur commented Oct 10, 2019

To find the root cause for these issues better we have changed the file log to include a trace in #14961
So when this issue happens again be good to get a trace and then we can maybe look into this further.

@mattab mattab closed this as completed Oct 22, 2019
@mattab mattab added the worksforme The issue cannot be reproduced and things work as intended. label Oct 22, 2019
@romankk
Copy link

romankk commented Nov 5, 2019

@mattab
Keep getting
WARNING: /var/www/matomo/html/matomo/core/Piwik.php(122): Warning - A non-numeric value encountered - Matomo 3.12.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) (Module: Goals, Action: getItemsName, In CLI mode: false)

@tsteur
Copy link
Member

tsteur commented Nov 5, 2019

Can you enable logging to file see https://matomo.org/faq/troubleshooting/faq_115/ and then maybe it will be logging a backtrace into the $MATOMODIR/tmp/logs/matomo.log.
Basically you need to add

[log]
log_writers[] = screen
log_writers[] = file

to your config/config.ini.php

@SejlaG
Copy link

SejlaG commented Nov 28, 2019

Hi all,

Any updates on this issue? We keep seeing the error.

It occurs 10 times in a row. Please see image.
image

@mattab mattab reopened this Nov 28, 2019
@mattab mattab added Regression Indicates a feature used to work in a certain way but it no longer does even though it should. and removed not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. worksforme The issue cannot be reproduced and things work as intended. labels Nov 28, 2019
@mattab mattab modified the milestones: 3.12.0, 3.13.1 Nov 28, 2019
@mattab
Copy link
Member Author

mattab commented Nov 28, 2019

Reopening as the error shows up in 3.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
8 participants