[2.16.2] RDS - Oops… there was a problem during the request error with segmented goals

Config:
DB: MySQL 5.6.23 on Amazon RDS
RDS default mysql-5-6 option group
Parameter group default.mysql5.6 updated with wait_timeout=6400 and max_allowed_packet=1073741824 (1024M)

When trying to runs a goals overview query with a segment, I very often get the following error:
Oops… there was a problem during the request. Maybe the server had a temporary issue, or maybe you requested a report with too much data. Please try again. If this error occurs repeatedly please contact your Piwik administrator for assistance.

I cannot find any occurrence of an error log, even with the log viewer plugin attached. I do find that when reloading the page a second/third/fourth time, it might show eventually.

The data set is really small, our site gets so few hits that it’s almost negligible (<100 hits daily). The query will die even when I set it to a span of 1 week duration.

A day span usually works, and other operations seem to work better.

Searching for answers brings little help, it’s like searching for a needle in a haystack since I cannot see any errors being thrown.

Thanks in advance!

Hi there,
Is there an error in your webserver error log?

The error logs on the web server (both nginx with PHP-FPM) is surprisingly completely empty as well as anything that is historical. Access logs show all the traffic coming in as expected.

What is your Interactive Timeout set to? I believe I had to set mine to 720 on AWS RDS.

Also, if you aren’t building your archives via a CRON job, then most of your queries will run much longer (at least the first time).

I set my max_execution_time to 60 through php_admin_value. This solved the problem for me