Out of memory error on CSV product images import
In the Magento admin backend, it appears as if your
csv import is still running, but in the error logs you’ll notice errors that appeared during the import.
recv() failed (104: Connection reset by peer) while reading response header from upstream
In the access logging a
502 status code is returned.
This error is caused by a bug in the
Gd2.php library magento uses to convert image formats.
To fix this issue, use the instructions to fix this bug.
Instructions for manual repair
- Create the new destination for this file:
mkdir -p /data/web/public/app/code/local/Varien/Image/Adapter
- Copy the
Gd2.phpfile to it’s destination:
cp /data/web/public/lib/Varien/Image/Adapter/Gd2.php /data/web/public/app/code/local/Varien/Image/Adapter/Gd2.php
/data/web/public/app/code/local/Varien/Image/Adapter/Gd2.phpwith your favorite editor:
- Go to
register_shutdown_functionon line 49 and change this line:
// register_shutdown_function(array($this, 'destruct'));
- Keep the file open in your editor, and change line 55:
public function destruct()
public function __destruct()
This should lower the memory of the image resize functionality drastically.