Howto: Resolve “Failed to Open File” error when installing Magneto Connect extensions

If you’re trying to install a Magento extension though Magento Connect and getting an error like the following:

CONNECT ERROR: Failed to open file /var/www/magento/downloader/.cache/community/OrganicInternet_SimpleConfigurableProducts-0.7.4/app/code/community/OrganicInternet/SimpleConfigurableProducts/Catalog/Model/Product/Type/Configurabl

It’s caused by a simple (yet long-lived and un-fixed) bug in Magento’s downloader.

Open:

/downloader\lib\Mage\Archive\Tar.php

Find:

if (!($header['name'] == '././@LongLink' && $header['type'] == 'L')) {
     $header['name'] = trim($header['name']);
     return $header;
}

Replace with:

if (!(trim($header['name']) == '././@LongLink' && $header['type'] == 'L')) {
     $header['name'] = trim($header['name']);
     return $header;
}

Then try to install your extension again. Always remember to disable the compiler before hand, clear caches, and log out of the admin after installing an extension.

Leave a Reply

Your email address will not be published.