-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Invalid argument supplied for foreach() #10453
Comments
Thanks for the report @l36t - do you know how to reproduce this issue? if we can reproduce it we will be able to fix it. Thanks for sending more information.... for example maybe you could find the request from your webserver access log that triggered this error ? |
@l36t please see previous comment, can you send the HTTP request in your access.log file, that has triggered this error? (you can find it by looking at the datetime of the error and finding back the request that was made at the same second or one-two seconds before) |
Hi @mattab , grep "PHP Warning" error_log |wc -l like this one: [Tue Feb 21 21:10:26.535362 2017] [php7:warn] [pid 16922:tid 140190181963520] [client 181.196.76.228:59504] PHP Warning: Invalid argument supplied for foreach() in /datos/httpd-pwk-2.4.25/htdocs/analytics/core/Tracker/RequestSet.php on line 38, referer: http://www.extra.ec/actualidad/elecciones2017-resultados-votaciones-actualidad-DD1104603 The requests "surrounding" that error are attached in the following file: Please, let me know if you need more information: I'm wondering if this could imply to lost hits Thank you in advance. |
I have the same problem with the same error message and use the most recent version 3.5.0. It may have something to do with log importing. It looks like you need to make sure that $requests in line 38 is definitely an array before feeding the var to foreach().
|
Are you able to produce a stack trace for that error? would be good to know where the empty requestset comes from, as that might be the main problem |
Sorry, no. We cannot fiddle with the live installation and I it seems the error is not easy to reproduce in a test environment. Maybe I can add a simple log to dump the var if the error happens ... |
We're seeing this error with the latest version using PHP 7.1, and we use redis.
That's almost 70k errors in less than 12 hours. How can we diagnose what's going on here ? |
OK, disabling redis as the QueueTracker stops this problem,, but the load on the server goes mad. If you enable MySQL queue then the error doesn't show. If you enable Redis Queue then the error returns
|
I can confirm the same environment. PHP 7.1 and Redis and still lots of that error message with the most recent version. |
In my case, I lived together with that bunch of errors every day... until they disapeared suddenly. |
How are you tracking? Using the JavaScript tracker? We can't reproduce this issue here. |
@wmtech-1 be good if you could update to latest version as well if not done yet. |
@tsteur, |
We're still seeing these errors - using php 7.1.33 - maybe we need to update that ? |
Are you all using Queued tracking? I had a quick look in the code and right now I can't really think of a way this may be triggered. |
We could workaround and just add a check to avoid this notice. Chances are though it might actually maybe hide a bug. |
FYI, upgrading to php 7.2 fixed this error entirely. Probably safe to close this issue as I can't imagine many people are still running php 7.1. |
I have it running on 7.2 and see it. Yet have pending Matomo updates. |
this was fixed with #17877 |
my apache error.log sometimes print:
PHP Warning: Invalid argument supplied for foreach() in C:\phpEnv\Apache24\htdocs\piwik\core\Tracker\RequestSet.php on line 38
I use piwik 2.16.1,php5.5.36,how to resolve this problem,does this warning affect collecting data?
The text was updated successfully, but these errors were encountered: