magento-hackathon / magento-composer-installer

Composer installer for Magento modules
210 stars 156 forks source link

Permission denied only with connect20 packages #108

Closed sylvainraye closed 10 years ago

sylvainraye commented 10 years ago

Hi, If I install or update any connect20 package via composer, I have problems with a permission denied. The only solution I have is to do sudo composer updatehowever it makes all my deployed files with a root user and I have to execute an additional a chown.

It seems to be related to tar package and maybe a problem on composer itself and not the magento composer installer

Here is the message I have for example:

Writing /Users/sylvainraye/.composer/cache/repo/https---packagist.org/provider-sebastian$comparator.json into cache
  - Installing connect20/locale_mage_community_fr_fr (1.7.0.1)
Downloading http://connect20.magentocommerce.com/community/Locale_Mage_community_fr_FR/1.7.0.1/Locale_Mage_community_fr_FR-1.7.0.1.tgz
    Downloading: 100%         
Writing /Users/sylvainraye/.composer/cache/files/connect20/locale_mage_community_fr_fr/1.7.0.1-.tar into cache
    Extracting archive

  [UnexpectedValueException]                                                                                                                                                                                
  unable to create temporary file for decompression of gzipped phar archive "/www-data/hosts/diglin_demo/htdocs/magento/vendor/connect20/Locale_Mage_community_fr_FR/0767cb7a653c4ca6083795c75877b085.tgz"  

Exception trace:
 () at phar:///usr/local/bin/composer/src/Composer/Downloader/TarDownloader.php:28
 PharData->__construct() at phar:///usr/local/bin/composer/src/Composer/Downloader/TarDownloader.php:28
 Composer\Downloader\TarDownloader->extract() at phar:///usr/local/bin/composer/src/Composer/Downloader/ArchiveDownloader.php:43
 Composer\Downloader\ArchiveDownloader->download() at phar:///usr/local/bin/composer/src/Composer/Downloader/DownloadManager.php:201
 Composer\Downloader\DownloadManager->download() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:155
 Composer\Installer\LibraryInstaller->installCode() at phar:///usr/local/bin/composer/src/Composer/Installer/LibraryInstaller.php:86
 Composer\Installer\LibraryInstaller->install() at /www-data/hosts/diglin_demo/htdocs/magento/vendor/magento-hackathon/magento-composer-installer/src/MagentoHackathon/Composer/Magento/Installer.php:405
 MagentoHackathon\Composer\Magento\Installer->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:153
 Composer\Installer\InstallationManager->install() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:140
 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:541
 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:215
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/InstallCommand.php:122
 Composer\Command\InstallCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:241
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:892
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:191
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:117
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Symfony/Component/Console/Application.php:121
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:83
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:43
 require() at /usr/local/bin/composer:15
vernard commented 10 years ago

Have you tried changing the folder permissions to 777?

You can do that by using the chmod command example: chmod -R 777 /var/www

-R option is used to make it recursive

sylvainraye commented 10 years ago

Hi, The problem appear on a fresh install, no problem with firegento packages, only with connect20 dependencies. The target folder where it must be deployed have the correct rights (I mean the vendor folder). The problem to extract the tar is into the composer folder ~/.composer.

I will check again how it goes with the permissions

vernard commented 10 years ago

Hmm... How about the permission of the composer.phar?

When installing connect20 packages, composer will use the .tar.gz file and it will create temporary folders where the composer will put in the contents then unpack after downloading.

Flyingmana commented 10 years ago

can you provide me with a composer.json so I can try to reproduce? Also, which OS do you use?

sylvainraye commented 10 years ago

Well I found the problem because I had similar issue with magerun. Stupid issue, was cause of permissions on the tmp folder of Zend Server. PHP delivered with Zend Server doesn't use the tmp folder of the OS but its own tmp folder located at /usr/local/zend/tmp, the permissions were not correct for my current user. I changed from 775 to 777.

My apologize for the disturbing.