Got
WARNING SitesManager[2015-01-06 12:30:02] [fe2f0] /home/pcsolcom/public_html/piwik/libs/Zend/Db/Statement/Mysqli.php(70): Warning - Error while sending STMT_PREPARE packet. PID=887526 - Piwik 2.10.0 - Please report this message in the Piwik forums: http://forum.piwik.org (please do a search first as it might have been reported already)
After successful update to Piwik 2.10.0
+1 here with ver. 2.14.1
and on 2.14.2 too
H.
vmg
October 21, 2015, 4:22pm
3
+1 on 2.14.3
Warning - Error while sending STMT_PREPARE packet. PID=15636 - Piwik 2.14.3
komtur
(Christian Jakubaszek)
August 22, 2017, 12:54am
4
I got the same Error with version 3.0.4:
WARNING: /var/www/piwik/libs/Zend/Db/Statement/Mysqli.php(70): Warning - Error while sending STMT_PREPARE packet. PID=13467 - Piwik 3.0.4
Running it under a debian 9.1 and Apache 2.4.25 and php7.0-fpm
on a server with 64 BG RAM
Lukas
(Lukas Winkler)
August 22, 2017, 4:25pm
5
Hi,
There is an (quite old) github issue about this problem:
opened 07:00AM - 20 Feb 15 UTC
closed 04:09AM - 08 Apr 15 UTC
answered
I run the `core:archive` script directly on the command line for a site with abo… ut 300 visits per day and more than 30 segments. It takes 5 to 10 minutes to process everything, but fails after year-period processing and before range-period processing with a database error:
```
Warning - Error while sending STMT_PREPARE packet.
```
The query preceding this warning is:
```
SELECT option_name, option_value FROM `piwik_option` WHERE option_name LIKE ?
```
I guess, that error occurs in `CronArchive::loadCustomDateRangeToPreProcess()`, but I have no idea why. The next thing I get is a fatal "MySQL server has gone away" error.
This error occurs in Piwik 2.11, but also in earlier versions.
If I run `core:archive` for each period separately using `--force-periods`, it works though.
Here is the last part of the verbose log of `core:archive`:
```
INFO CoreConsole[2015-02-19 14:52:10] Archived website id = 1, period = year, 21534 visits in last last2 years, 14490 visits this year, Time elapsed: 73.307s
DEBUG UsersManager[2015-02-19 14:52:10] Db::fetchAll() executing SQL: SELECT option_name, option_value FROM `piwik_option` WHERE option_name LIKE ?
WARNING UsersManager[2015-02-19 14:52:10] /kunden/larsen-mdm.de/piwik/libs/Zend/Db/Statement/Mysqli.php(70): Warning - Error while sending STMT_PREPARE packet. PID=8974 - Piwik 2.11.0 - Please report this message in the Piwik forums: [forum.piwik.org] (please do a search first as it might have been reported already)
DEBUG SitesManager[2015-02-19 14:52:10] Db::fetchAll() executing SQL: SELECT idsite FROM piwik_site
ERROR CoreConsole[2015-02-19 14:52:10] Mysqli prepare error: MySQL server has gone away
[Exception]
Mysqli prepare error: MySQL server has gone away
Exception trace:
() at /kunden/larsen-mdm.de/piwik/core/CronArchive.php:406
Piwik\CronArchive->logFatalError() at /kunden/larsen-mdm.de/piwik/plugins/CoreConsole/Commands/CoreArchiver.php:43
Piwik\Plugins\CoreConsole\Commands\CoreArchiver->execute() at /kunden/larsen-mdm.de/piwik/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
Symfony\Component\Console\Command\Command->run() at /kunden/larsen-mdm.de/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /kunden/larsen-mdm.de/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at n/a:n/a
call_user_func() at /kunden/larsen-mdm.de/piwik/core/Console.php:58
Piwik\Console->Piwik\{closure}() at /kunden/larsen-mdm.de/piwik/core/Access.php:454
Piwik\Access::doAsSuperUser() at /kunden/larsen-mdm.de/piwik/core/Console.php:59
Piwik\Console->doRun() at /kunden/larsen-mdm.de/piwik/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /kunden/larsen-mdm.de/piwik/console:27
```
`wait_timeout` of my MySQL server is 1 hour, `max_allowed_packet` is 16 MB and I'm not allowed to change that value, but it should be sufficient for the simple query shown above.
You can try out if this tips help:
https://piwik.org/faq/troubleshooting/faq_183/