MySQL errors during Commerce installation (solved)

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=

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 :

[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…

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

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

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

Could not create table `modx_commerce_address` SQL: CREATE TABLE ... ERROR: Array ( 
  [0] => HY000
  [1] => 2006 
  [2] => 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? That should work better for you.

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=

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

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?

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 :

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 ?

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

OK found !
I have increased the mysql parameter “wait_timeout” from 10 to 100 and the installation works :slight_smile:

1 Like