API.php(723): Warning - Invalid argument supplied for foreach() - Matomo 3.13.0

Wenn running the archive script with

php /home/piwik/web/stats.example.com/public_html/console core:archive --matomo-domain=stats.example.com

I get the following warning message

WARNING [2019-12-07 17:37:35] 32545  /home/piwik/web/stats.example.com/public_html/plugins/ScheduledReports/API.php(723): Warning - Invalid argument supplied for foreach() - Matomo 3.13.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)

Hi,

Normally I would now complain that the error message isn’t really helpful, but thankfully this has now changed in Matomo 3.13:
When you check your Matomo log (the one in tmp/logs/matomo.log) it should not only show this warning, but also the complete backtrace (so where exactly this error occured).

You might need to enable logging first:
https://matomo.org/faq/how-to/faq_20991/

Somehow I couldn’t reproduce the error today.
I did some file permissions tweaking last night. Maybe that fixed it.
When I will run into it again I will post the backtrace.

1 Like