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

Non Well Formed Numeric Value in Live Plugin in 3.0 #11066

Closed
James-Oakley opened this issue Dec 22, 2016 · 12 comments · Fixed by #11095
Closed

Non Well Formed Numeric Value in Live Plugin in 3.0 #11066

James-Oakley opened this issue Dec 22, 2016 · 12 comments · Fixed by #11095
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@James-Oakley
Copy link

See https://forum.piwik.org/t/non-well-formed-numeric-value-in-live-plugin-in-3-0/22199

Piwik 3.0.0. PHP 7.1.0

This error only appears about once a day, and disappears on refreshing the dashboard. It leaves no trace in the PHP error_log or anywhere else - it's an onscreen warning only.

Here's the exact message:

WARNING: {path-to-piwik}/plugins/Live/VisitorProfile.php(365): Notice - a non well formed numeric value encountered - Piwik 3.0.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)

@lbnaaps
Copy link

lbnaaps commented Dec 22, 2016

just reiterating above error report - same configuration -> same error message

@tsteur
Copy link
Member

tsteur commented Dec 22, 2016

Do you know if you are using any 3rd party plugins? You can find out on "Administration => Plugins" and then select "third party". If so, can you temporarily deactivate them all and see if the error still occurs?

It might be a PHP 7.1.0 issue so moving into 3.0.1 milestone for now.

@tsteur tsteur added this to the 3.0.1 milestone Dec 22, 2016
@lbnaaps
Copy link

lbnaaps commented Dec 22, 2016

third party: ExampleRssWidget (v1.0) inactive - has not been active on this 5 day old installation.
i also notice the panel 'Latest visits' (i guess it is called, i'm on danish translation 8) ) hasn't been updated the last 2 days although the 'Here and Now' panel show recent visits

@James-Oakley
Copy link
Author

James-Oakley commented Dec 22, 2016

Do you know if you are using any 3rd party plugins?

ExampleRssWidget (v1.0) and PiwikPro (v3.0.0) are both listed as "Inactive". I think that means I'm not using any.

i also notice the panel 'Latest visits' (i guess it is called, i'm on danish translation 8) ) hasn't been updated the last 2 days

I don't know about Latest visits (that may be a translation issue), but in the "Add a widget" dropdown, "Visitors in Real Time" shows as being in the "Live!" category, and is updating fine.

@kokspflanze
Copy link

Hi,
i have the bug too, it happens if you click on a VisitorProfil.

it happens if generationTime is generated @ https://github.com/piwik/piwik/blob/3.x-dev/plugins/Live/Visitor.php#L309 it looks like 0,18 s

actionDetails

                ["actionDetails"]=>
                array(1) {
                  [0]=>
                  array(10) {
                    ["type"]=>
                    string(6) "action"
                    ["url"]=>
                    string(25) "http://www.example.com/"
                    ["pageTitle"]=>
                    string(81) "foobar"
                    ["pageIdAction"]=>
                    string(1) "2"
                    ["serverTimePretty"]=>
                    string(19) "22.12.2016 11:32:19"
                    ["pageId"]=>
                    string(5) "10751"
                    ["generationTime"]=>
                    string(6) "0,18 s"
                    ["interactionPosition"]=>
                    string(1) "1"
                    ["icon"]=>
                    NULL
                    ["timestamp"]=>
                    int(1482406339)
                  }
                }

@James-Oakley
Copy link
Author

James-Oakley commented Dec 23, 2016

i have the bug too, it happens if you click on a VisitorProfil.

Well done for working that out. I was only seeing this very occasionally, and I'd only ever had it when the thumbnail regenerates in my browser speeddial plugin. Copying the error message to this issue meant reading tiny text, and I couldn't reproduce it.

Now I can. You're quite right; here's how to reproduce this: Go to a site's dashboard, and click on the link to view a visitor profile (which opens in a lightbox). Then click on the "PIWIK" logo top-left of the screen, to return to your dashboard (showing all the sites you're tracking, not just the one you were previously in). You then get a warning DIV at the top of the page with the above error message in - one warning for every profile you visited. Refresh the page to reload the dashboard, and the message disappears (the warning is regarded as dismissed).

@mattab
Copy link
Member

mattab commented Dec 26, 2016

@kokspflanze @James-Oakley can you try replace these lines: https://github.com/piwik/piwik/blob/3.x-dev/plugins/Live/Visitor.php#L308-L310

by:

            } elseif ($actionDetail['custom_float'] > 0) {
                var_dump($actionDetail['custom_float']);
                $actionDetail['generationTime'] = $formatter->getPrettyTimeFromSeconds($actionDetail['custom_float'] / 1000, true);
            }

and then reproduce the issue which should display some string on top of the screen? what is the value displayed?

@James-Oakley
Copy link
Author

what is the value displayed?

float(604) float(366) float(65) float(67) float(66)

@mattab
Copy link
Member

mattab commented Dec 26, 2016

Found the issue I think, and should be fixed in https://github.com/piwik/piwik/pull/11095/files

Do you mind testing the patches to the two files and confirm it fixes the issue?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 26, 2016
@kokspflanze
Copy link

@mattab looks good from my site=)

@James-Oakley
Copy link
Author

+1

Patches applied successfully, and the issue appears to be resolved. :-)

@mattab mattab closed this as completed Dec 27, 2016
mattab added a commit that referenced this issue Dec 27, 2016
…age generation time in Visitor Profile (#11095)

* Live API: New 'generationTimeMilliseconds' field used to process Average generation time in Visitor Profile
fixes #11066

* more precision

* Expected test files

* Reporting API: showColumns and hideColumns should be applied recursively (#11100)

* Recursively delete columns specified with hideColumns

* Custom Dimensions tests

* Invalid argument supplied for foreach() + Contents tests

* New unit test for ColumnDelete filter

* Submodules
@lvnilesh
Copy link

lvnilesh commented Mar 2, 2017

A non well formed numeric value encountered in /var/www/html/wp-content/plugins/wp-piwik/classes/WP_Piwik/Widget/Overview.php on line 32
WP Version:		4.7.2
WP Memory Limit:		256 MB
Language:		en_US
Server Info:		Apache/2.4.10 (Debian)
PHP Version:		7.1.1
PHP Post Max Size:		32 MB
PHP Time Limit:		30
PHP Max Input Vars:		1000
cURL Version:		7.38.0, OpenSSL/1.0.1t
MySQL Version:		5.7.17
Max Upload Size:		32 MB

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
6 participants