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

General error: 2006 MySQL server has gone away (when running archive.php) #8390

Closed
tolispy opened this issue Jul 21, 2015 · 4 comments
Closed
Labels
answered For when a question was asked and we referred to forum or answered it.

Comments

@tolispy
Copy link

tolispy commented Jul 21, 2015

archive.php cannot finished
every time after 25min I get "General error: 2006 MySQL server has gone away"
I suspect sql command timeout
Any ideas?

here is the console output

[root@zeus ~]# php /var/www/vhosts/sexblue-box.gr/httpdocs/piwik/misc/cron/archive.php --url=http://www.sexblue-box.gr/


Using this 'archive.php' script is no longer recommended.
Please use '/path/to/php /var/www/vhosts/sexblue-box.gr/httpdocs/piwik/console core:archive --url=http://www.sexblue-box.gr/' instead.
To get help use '/path/to/php /var/www/vhosts/sexblue-box.gr/httpdocs/piwik/console core:archive --help'
See also: http://piwik.org/docs/setup-auto-archiving/

If you cannot use the console because it requires CLI

try 'php archive.php --url=http://your.piwik/path'

INFO CoreConsole[2015-07-21 11:13:03] ---------------------------
INFO CoreConsole[2015-07-21 11:13:03] INIT
INFO CoreConsole[2015-07-21 11:13:03] Running Piwik 2.14.1 as Super User
INFO CoreConsole[2015-07-21 11:13:03] ---------------------------
INFO CoreConsole[2015-07-21 11:13:03] NOTES
INFO CoreConsole[2015-07-21 11:13:03] - If you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archivi ng' in Piwik UI > Settings > General Settings.
INFO CoreConsole[2015-07-21 11:13:03] See the doc at: http://piwik.org/docs/setup-auto-archiving/
INFO CoreConsole[2015-07-21 11:13:03] - Reports for today will be processed at m ost every 150 seconds. You can change this value in Piwik UI > Settings > Genera l Settings.
INFO CoreConsole[2015-07-21 11:13:03] - Reports for the current week/month/year will be refreshed at most every 3600 seconds.
INFO CoreConsole[2015-07-21 11:13:03] - Archiving was last executed without erro r 98 days 11 hours ago
INFO CoreConsole[2015-07-21 11:13:04] - Will process 1 websites with new visits since 98 days 11 hours , IDs: 1
INFO CoreConsole[2015-07-21 11:13:04] - Will process 1 other websites because so me old data reports have been invalidated (eg. using the Log Import script) , ID s: 1
INFO CoreConsole[2015-07-21 11:13:04] ---------------------------
INFO CoreConsole[2015-07-21 11:13:04] START
INFO CoreConsole[2015-07-21 11:13:04] Starting Piwik reports archiving...
INFO CoreConsole[2015-07-21 11:13:04] Will pre-process for website id = 1, perio d = day, date = last52
INFO CoreConsole[2015-07-21 11:13:04] - pre-processing all visits
INFO CoreConsole[2015-07-21 11:15:24] Archived website id = 1, period = day, 0 s egments, 0 visits in last last52 days, 0 visits today, Time elapsed: 0.001s
INFO CoreConsole[2015-07-21 11:15:24] Will pre-process for website id = 1, perio d = week, date = last100
INFO CoreConsole[2015-07-21 11:15:24] - pre-processing all visits
INFO CoreConsole[2015-07-21 11:22:11] Archived website id = 1, period = week, 0 segments, 151298 visits in last last100 weeks, 367 visits this week, Time elapse d: 406.620s
INFO CoreConsole[2015-07-21 11:22:11] Will pre-process for website id = 1, perio d = month, date = last52
INFO CoreConsole[2015-07-21 11:22:11] - pre-processing all visits
ERROR CoreConsole[2015-07-21 11:35:01] Got invalid response from API request: ?m odule=API&method=API.get&idSite=1&period=month&date=last52&format=php&trigger=ar chivephp. The response was empty. This usually means a server error. This soluti on to this error is generally to increase the value of 'memory_limit' in your ph p.ini file. Please check your Web server Error Log file for more details.
INFO CoreConsole[2015-07-21 11:35:01] Archived website id = 1, period = month, 0 segments, 0 visits in last last52 months, 0 visits this month, Time elapsed: 77 0.702s
INFO CoreConsole[2015-07-21 11:35:01] Will pre-process for website id = 1, perio d = year, date = last7
INFO CoreConsole[2015-07-21 11:35:01] - pre-processing all visits
INFO CoreConsole[2015-07-21 11:37:59] Archived website id = 1, period = year, 0 segments, 337176 visits in last last7 years, 39628 visits this year, Time elapse d: 178.132s

[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-segme nts] [--force-idsites[="..."]] [--force-periods[="..."]] [--force-date-last-n=". .."] [--force-date-range[="..."]] [--force-idsegments="..."] [--concurrent-reque sts-per-website[="..."]] [--disable-scheduled-tasks] [--accept-invalid-ssl-certi ficate]

@tsteur
Copy link
Member

tsteur commented Jul 21, 2015

refs #7669 #4055

what's your wait_timeout config in MySQL? Maybe wait_timeout=28800; helps

@gaumondp
Copy link

What about the recommendation ?

"Using this 'archive.php' script is no longer recommended.
Please use '/path/to/php /var/www/vhosts/sexblue-box.gr/httpdocs/piwik/console core:archive --url=http://www.something/' instead."

@mattab
Copy link
Member

mattab commented Jul 22, 2015

@mattab mattab closed this as completed Jul 22, 2015
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Jul 22, 2015
@SR-mkuhn
Copy link

seems there is a real solution in #7669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it.
Projects
None yet
Development

No branches or pull requests

5 participants