Agence-DnD / PIMGento-2

PimGento2 is a Magento 2 extension that allows you to import your catalog from Akeneo CSV files into Magento 2.
Open Software License 3.0
65 stars 59 forks source link

MySQL Error on Product Import #144

Open wucherpfennig opened 7 years ago

wucherpfennig commented 7 years ago

Hi everyone

Warning: PDOStatement::execute(): MySQL server has gone away in /usr/www/users/masch/public/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228

All imports do work except products...

Any suggestions?

Best regards

wucherpfennig

rakibabu commented 6 years ago

Hi @wucherpfennig,

I encoured this issue to. The reason for this, the query transaction in de updateOption() function is to large. See the file: vendor/agencednd/module-pimgento/Product/Model/Factory/Import.php

I added a small fix to close the connection and reconnect in the foreach loop where the query is build.

On the end of the foreach loop you will have to commit the query to prevent the mysql error. foreach ($columns as $column) { around line 425

// close connection to commit transaction
// reconnect
$connection->closeConnection();
$connection = $resource->getConnection();

Maybe a $connection->commit(); will work to.

Kind regards,

Rakhal Imming

akosglue commented 6 years ago

hi, anyone struggling with these settings? akeneo 2.0.7 -> pimgento 100.2.23 -> magento 2.1.10 , mysql server 5.7.20 pimgento import kills the server process.

lukaszolszewski commented 6 years ago

Hi,

@akosglue I have had the same problem like you.

I think You should downgrade your database to 5.7.18 or 5.7.17

In my case, this solution resolved the problem.

akosglue commented 6 years ago

Hi @lukaszolszewski Thanks for the tip. I will pass it to our hosting partner. However, this (half) solution of @rakibabu has solved the problem temporarily for me. (see comments above like https://github.com/Agence-DnD/PIMGento-2/issues/144#issuecomment-335390606)

akosglue commented 6 years ago

This might be resolved by installing mysql 5.7.21. Because this could be relevant:

Related fixed in 5.7.21, 8.0.4: Following an INSERT statement with BLOB values in the ON DUPLICATE KEY UPDATE clause that failed with a constraint violation, a similar statement with no reason to return an error could cause a server exit.

nicobatty commented 6 years ago

Both @rakibabu and @lukaszolszewski solutions worked for me.

Though upgrading to 5.7.21 did not.

As anyone found an other way to fix this problem? Staying on an outdated version doesn't feel super great.