M2后台没用户信息,刷索引报错
新搞的开发环境,重新编译后,却报了以下的错误
Design Config Grid index has been rebuilt successfully in 00:00:19
SELECT `e`.`entity_id`, `t_d`.`attribute_id`, `t_d`.`value` FROM `customer_entity` AS `e`
INNER JOIN `customer_entity_varchar` AS `t_d` ON e.entity_id = t_d.entity_id WHERE ( e.entity_id IN (1, 2…… 1230062)) AND (t_d.attribute_id IN ('189'))Customer Grid indexer process unknown error:
Warning: Error while sending QUERY packet. PID=149048 in /var/www/html/us/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php on line 305
Product Flat Data indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Category Flat Data indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Category Products indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Product Categories indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Catalog Rule Product indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Product EAV indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Stock indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Inventory indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Catalog Product Rule indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Product/Target Rule indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Target Rule/Product indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Product Price indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Catalog Search indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Sales Rule indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Google Product Removal Feed indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Google Product Feed indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Amasty Feed Rule indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Amasty Feed Products indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
Search Score Rules indexer process unknown error:
SQLSTATE[HY000]: General error: 2006 MySQL server has gone away
本以为是程序问题,查来找去却未发现异常,后面百度了一下大概原因是mysql的max_allowed_packet太小,因为要插入的数据很多,超过了mysql限制的大小,所以异常了,原因知道了,那就得看看自身环境问题
设置本机的限制,调大一点
mysql> set global max_allowed_packet = 2*1024*1024*10;
Query OK, 0 rows affected (0.00 sec)
mysql> show global VARIABLES like 'max_allowed_packet';
+--------------------+----------+
| Variable_name | Value |
+--------------------+----------+
| max_allowed_packet | 20971520 |
+--------------------+----------+
1 row in set (0.00 sec)
最后重新执行索引命令,因用户数据非常多,所以等待了老长时间,最后正常了。