MySQL server has gone away


#1

Hi there,

I’m getting the following error. The odd thing is that MySQL (MariaDB) is not crashing or throwing any errors in the syslog.

INFO [2019-02-19 08:15:20] 6214  ---------------------------
INFO [2019-02-19 08:15:20] 6214  INIT
INFO [2019-02-19 08:15:20] 6214  Running Matomo 3.8.1 as Super User
INFO [2019-02-19 08:15:20] 6214  ---------------------------
INFO [2019-02-19 08:15:20] 6214  NOTES
INFO [2019-02-19 08:15:20] 6214  - Reports for today will be processed at most every 150 seconds. You can change this value in Matomo UI > Settings > General Settings.
INFO [2019-02-19 08:15:20] 6214  - Reports for the current week/month/year will be requested at most every 3600 seconds.
INFO [2019-02-19 08:15:20] 6214  - Archiving was last executed without error 3 min 13s ago
INFO [2019-02-19 08:15:20] 6214  - Will process 1 other websites because some old data reports have been invalidated (eg. using the Log Import script or the InvalidateReports plugin) , IDs: 4
INFO [2019-02-19 08:15:20] 6214  ---------------------------
INFO [2019-02-19 08:15:20] 6214  START
INFO [2019-02-19 08:15:20] 6214  Starting Matomo reports archiving...
INFO [2019-02-19 08:15:20] 6214  - tracking data found for website id 1 since 2019-02-19 08:12:07 UTC (since the last successful archiving)
INFO [2019-02-19 08:15:20] 6214  Will pre-process for website id = 1, period = day, date = last2
INFO [2019-02-19 08:15:20] 6214  - pre-processing all visits
INFO [2019-02-19 08:15:22] 6214  Archived website id = 1, period = day, 0 segments, 2658 visits in last 2 days, 380 visits today, Time elapsed: 1.442s
INFO [2019-02-19 08:15:22] 6214  Will pre-process for website id = 1, period = week, date = last93
INFO [2019-02-19 08:15:22] 6214  - pre-processing all visits
INFO [2019-02-19 08:15:25] 6214  Archived website id = 1, period = week, 0 segments, 1639711 visits in last 93 weeks, 2658 visits this week, Time elapsed: 2.641s
INFO [2019-02-19 08:15:25] 6214  Will pre-process for website id = 1, period = month, date = last52
INFO [2019-02-19 08:15:25] 6214  - pre-processing all visits
INFO [2019-02-19 08:15:37] 6214  Archived website id = 1, period = month, 0 segments, 2162215 visits in last 52 months, 41804 visits this month, Time elapsed: 12.447s
INFO [2019-02-19 08:15:37] 6214  Will pre-process for website id = 1, period = year, date = last7
INFO [2019-02-19 08:15:37] 6214  - pre-processing all visits
ERROR [2019-02-19 08:27:15] 6214  Got invalid response from API request: ?module=API&method=API.get&idSite=1&period=year&date=last7&format=php&trigger=archivephp. Response was 'a:2:{s:6:"result";s:5:"error";s:7:"message";s:139:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away, caused by: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away";}'
INFO [2019-02-19 08:27:15] 6214  Archived website id = 1, period = year, 0 segments, 0 visits in last 7 years, 0 visits this year, Time elapsed: 698.277s
INFO [2019-02-19 08:27:15] 6214  Archived website id = 1, 4 API requests, Time elapsed: 714.810s [1/19 done]
WARNING [2019-02-19 08:27:15] 6214  /var/www/piwik/htdocs/libs/Zend/Db/Statement/Pdo.php(228): Warning - PDOStatement::execute(): MySQL server has gone away - Matomo 3.8.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)
WARNING [2019-02-19 08:27:15] 6214  /var/www/piwik/htdocs/libs/Zend/Db/Statement/Pdo.php(228): Warning - PDOStatement::execute(): Error reading result set's header - Matomo 3.8.1 - Please report this message in the Matomo forums: https://forum.matomo.org (please do a search first as it might have been reported already)



  [Zend_Db_Statement_Exception]
  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away






  [PDOException]
  SQLSTATE[HY000]: General error: 2006 MySQL server has gone away



core:archive [--url="..."] [--force-all-websites] [--force-all-periods[="..."]] [--force-timeout-for-periods[="..."]] [--skip-idsites[="..."]] [--skip-all-segments] [--force-idsites[="..."]] [--force-periods[="..."]] [--force-date-last-n="..."] [--force-date-range[="..."]] [--force-idsegments="..."] [--concurrent-requests-per-website[="..."]] [--concurrent-archivers[="..."]] [--disable-scheduled-tasks] [--accept-invalid-ssl-certificate] [--php-cli-options[="..."]]

What could be the cause and how can we resolve it?


#2

Might be the wait_time setting which I increased from 10 to 30 Minutes for testing.


(Fabian Dellwing) #3

https://matomo.org/faq/troubleshooting/faq_183/