# MySQL errors during Commerce installation (solved)

**URL:** <https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752>\
**Category:** Commerce\
**Created:** [February 19, 2019, 12:24pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752 "2019-02-19T12:24:35Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 19, 2019, 12:24pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/1 "2019-02-19T12:24:35Z")

</div>

Hi,

I wonder to test Commerce for a new customer but I have difficulties to install it.  
You can see the full report here : [https://pb.spheerys.fr/?de59b2819a99fda9#edaH2rSmIsqO/XDwZlfOhmDsSkBLRJz6Pkx2EMu8C9Q=](https://pb.spheerys.fr/?de59b2819a99fda9#edaH2rSmIsqO/XDwZlfOhmDsSkBLRJz6Pkx2EMu8C9Q=)

It’s sound like a MySQL issue, but the MODX instance is installed on a new server and MySQL working well, even during and after Commerce installation.  
The server is not overloaded, has free memory etc…

Worse : Commerce looks installed on the Menu Extensions but if I try to use it, it’s obviously tell me some tables are missing on the MODX log :

```auto
[2019-02-19 10:56:21] (ERROR in xPDO::getService @ /home/HDA/web/dev.cookooling.com/public_html/core/xpdo/xpdo.class.php : 1234) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead.
[2019-02-19 10:56:21] (ERROR in modRestCurlClient::__construct @ /home/HDA/web/dev.mydomain.com/public_html/core/model/modx/rest/modrestcurlclient.class.php : 26) modRestClient::__construct is deprecated since version 2.3.0. Use the modRest classes instead.
[2019-02-19 10:57:32] (ERROR @ /home/HDA/web/dev.mydomain.com/public_html/core/xpdo/xpdo.class.php : 644) Could not load class: Commerce from commerce.
[2019-02-19 10:57:32] (ERROR @ /home/HDA/web/dev.mydomain.com/public_html/core/xpdo/xpdo.class.php : 1247) Problem getting service commerce, instance of class Commerce, from path /home/HDA/web/dev.mydomain.com/public_html/core/components/commerce/model/commerce/
[2019-02-19 10:59:33] (ERROR @ /home/HDA/web/dev.mydomain.com/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error HY000 executing statement: 

[2019-02-19 12:26:21] (ERROR @ /home/HDA/web/dev.mydomain.com/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error 42S02 executing statement: 
Array
(
    [0] => 42S02
    [1] => 1146
    [2] => Table 'HDA_domain.modx_commerce_tax_group' doesn't exist
)

```

I don’t understand what’s going wrong…

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [February 19, 2019, 1:00pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/2 "2019-02-19T13:00:02Z")

</div>

Can you just paste in the installation log or at least the errors from it? Your link doesn’t work for me.

---

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 19, 2019, 1:08pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/3 "2019-02-19T13:08:05Z")

</div>

I can’t because too long, but this new link is working : [https://pb.spheerys.fr/?6445dc55c97fccb0#CWBh1ffil4Je5hQPu4cVdAV/fMs6znxICmM5/8LQpQU=](https://pb.spheerys.fr/?6445dc55c97fccb0#CWBh1ffil4Je5hQPu4cVdAV/fMs6znxICmM5/8LQpQU=)

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [February 19, 2019, 2:23pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/4 "2019-02-19T14:23:21Z")

</div>

Okay so that does look like it’s losing connection with the database after handling the files:

```auto
Could not create table `modx_commerce_address` SQL: CREATE TABLE ... ERROR: Array ( 
  [0] =&gt; HY000
  [1] =&gt; 2006 
  [2] =&gt; MySQL server has gone away )

```

This has happened before to someone else, and as a result of that I changed the order in which our package is installed in 0.12. Can you try installing v0.12 by [opting-in to the pre-release that’s currently available](https://support.modmore.com/faq/5-package+provider/#faq_161)? That should work better for you.

---

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 19, 2019, 2:30pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/5 "2019-02-19T14:30:33Z")

</div>

OK I did it, but the package still don’t want to install.  
But now I have the same MySQL error, but a little bit different : [https://pb.spheerys.fr/?e547752634b90f97#cIH/loPQiV1RCG5koyoUHj9/cVwq0dYd9gPZrmCgIqo=](https://pb.spheerys.fr/?e547752634b90f97#cIH/loPQiV1RCG5koyoUHj9/cVwq0dYd9gPZrmCgIqo=)

---

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 20, 2019, 12:05pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/6 "2019-02-20T12:05:36Z")

</div>

Could it be a workaround to run a SQL dump file to initialize the SQL tables manually ?

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [February 20, 2019, 12:46pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/7 "2019-02-20T12:46:31Z")

</div>

You’re going to need to install updates in the future too, so this is not a problem that can be worked around like that.

The last time something like this happened, the problem was that the file unpacking/preserving took longer than the mysql query/idle timeout. That was fixed with 0.12 by changing the order in which certain things happen in the package. Basically, that made it a little faster.

This error suggests some issue communicating with the MySQL server after which the connection is dropped:

> PHP warning: Error while sending QUERY packet. PID=2723

The log doesn’t say why though.

Does it consistently have that error? Can you look at mysql logs for that PID?

---

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 21, 2019, 8:09am UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/8 "2019-02-21T08:09:30Z")

</div>

I still have the error, after several trying.  
My server is a VPS so I tryied to boost it with higher resources (RAM, CPU…) but nothing change.  
About your last question : the indicated PID is apache, not mysql.  
The apache log during the commerce install process is not relevant :

```auto
151.xxx.yyy.227 - - [21/Feb/2019:09:06:51 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:52 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:53 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:54 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:55 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:56 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:57 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:58 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:59 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:00 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:01 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:02 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:03 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:04 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:05 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:06 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:07 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:08 +0100] "POST /connectors/index.php HTTP/1.0" 200 1100 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:09 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:10 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:11 +0100] "POST /connectors/index.php HTTP/1.0" 200 351 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:06:47 +0100] "POST /connectors/index.php HTTP/1.0" 200 490 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"
151.xxx.yyy.227 - - [21/Feb/2019:09:07:12 +0100] "POST /connectors/index.php HTTP/1.0" 200 38185 "http://dev.mydomain.com/manager/?a=workspaces" "Mozilla/5.0 (X11; Linux x86_64; rv:65.0) Gecko/20100101 Firefox/65.0"

```

Maybe I could change a mysql parameter, but which one ?

---

<div class="post-metadata">

**Author:** ![mhamstra](https://forum.modmore.com/user_avatar/forum.modmore.com/mhamstra/32/459_2.png) [@mhamstra](https://forum.modmore.com/u/mhamstra)\
**Post date:** [February 21, 2019, 1:58pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/9 "2019-02-21T13:58:19Z")

</div>

Perhaps this is the moment for you to involve your host/sysadmin to help with debugging why that connection gets dropped.

---

<div class="post-metadata">

**Author:** ![Spheerys](https://forum.modmore.com/user_avatar/forum.modmore.com/spheerys/32/158_2.png) [@Spheerys](https://forum.modmore.com/u/Spheerys)\
**Post date:** [February 21, 2019, 2:52pm UTC](https://forum.modmore.com/t/mysql-errors-during-commerce-installation-solved/1752/10 "2019-02-21T14:52:09Z")

</div>

OK found !  
I have increased the mysql parameter “wait\_timeout” from 10 to 100 and the installation works 🙂
