0

When trying to install Magento 2 Open Source with the following command, I get the following error. I've already upped my maxfiles to kingdom come, without any positive effect. How do I fix this?

Error

  [ErrorException]
  fopen(/Users/myuser/.composer/cache/files/magento/theme-frontend-luma/873ad0c55501fa7ae548f048b69ca7af8c2a3bd8.zip): failed to open stream: Too many open files

Current maxfiles

$ launchctl limit maxfiles
        maxfiles    9000000        9000000

Composer version

$ composer --version
Composer version 1.10.7 2020-06-03 10:03:56

OS

I'm on macOS 10.15.4

Full output

$ composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition magento-composer
    1/10:       http://repo.packagist.org/p/provider-latest$e90d775d6b3ac421d2e2583dac3f23dbf6378a1eb194d8e3a6ee06b8870ccce8.json
    2/10:       http://repo.packagist.org/p/provider-2019-10$b3a05d79df4089bea2f5fe34d8310a4782aecba55eed265ae5294c4f778a84b3.json
    3/10:       http://repo.packagist.org/p/provider-2015$2386737641788c1c4028f3e4ef660d2b943225ec9ef628f950b78318ab85aae7.json
    4/10:       http://repo.packagist.org/p/provider-2019-07$684cc425814c8fcd3dd38f426d7386883638dac951eb0680c149f6d68c47d9df.json
    5/10:       http://repo.packagist.org/p/provider-2020-04$9b2361cb6ae781889cd664f1d71fcab5de8873e2cbc8f0d812fc52bbe8174689.json
    6/10:       http://repo.packagist.org/p/provider-2020-01$b5bfc61ac4692d85e9adada04b7aa0e7852d899220d93c8365d1c902eb36b70f.json
    7/10:       http://repo.packagist.org/p/provider-2019$2bc08951c25c11eaafd69eefef138011cea4fd0ece31d50f47a57913f3531b16.json
    8/10:       http://repo.packagist.org/p/provider-2016$c40345634080e37ff5671a70bc06d3ca8b289c28c96fbda5728c1e56988359fe.json
    9/10:       http://repo.packagist.org/p/provider-2018$19577c7b34ae6fbb1eb8957653ecdba16ebd7a8dec7ba5727c875d89c1d83bad.json
    10/10:      http://repo.packagist.org/p/provider-2017$502291b972280e346bdaf8bff71f8a62e2647e0b6860a9e25513b5f20564fe61.json
    Finished: success: 10, skipped: 0, failure: 0, total: 10
    1/10:       http://repo.packagist.org/p/provider-latest$e90d775d6b3ac421d2e2583dac3f23dbf6378a1eb194d8e3a6ee06b8870ccce8.json
    2/10:       http://repo.packagist.org/p/provider-2019-07$684cc425814c8fcd3dd38f426d7386883638dac951eb0680c149f6d68c47d9df.json
    3/10:       http://repo.packagist.org/p/provider-2019-10$b3a05d79df4089bea2f5fe34d8310a4782aecba55eed265ae5294c4f778a84b3.json
    4/10:       http://repo.packagist.org/p/provider-2020-01$b5bfc61ac4692d85e9adada04b7aa0e7852d899220d93c8365d1c902eb36b70f.json
    5/10:       http://repo.packagist.org/p/provider-2015$2386737641788c1c4028f3e4ef660d2b943225ec9ef628f950b78318ab85aae7.json
    6/10:       http://repo.packagist.org/p/provider-2016$c40345634080e37ff5671a70bc06d3ca8b289c28c96fbda5728c1e56988359fe.json
    7/10:       http://repo.packagist.org/p/provider-2020-04$9b2361cb6ae781889cd664f1d71fcab5de8873e2cbc8f0d812fc52bbe8174689.json
    8/10:       http://repo.packagist.org/p/provider-2019$2bc08951c25c11eaafd69eefef138011cea4fd0ece31d50f47a57913f3531b16.json
    9/10:       http://repo.packagist.org/p/provider-2018$19577c7b34ae6fbb1eb8957653ecdba16ebd7a8dec7ba5727c875d89c1d83bad.json
    10/10:      http://repo.packagist.org/p/provider-2017$502291b972280e346bdaf8bff71f8a62e2647e0b6860a9e25513b5f20564fe61.json
    Finished: success: 10, skipped: 0, failure: 0, total: 10
Creating a "magento/project-community-edition" project at "./magento-composer"
Installing magento/project-community-edition (2.3.5-p1)
  - Installing magento/project-community-edition (2.3.5-p1): Loading from cache
Created project in /Users/myuser/Sites/Research/magento-composer
    1/10:       http://repo.packagist.org/p/provider-2019-07$684cc425814c8fcd3dd38f426d7386883638dac951eb0680c149f6d68c47d9df.json
    2/10:       http://repo.packagist.org/p/provider-latest$e90d775d6b3ac421d2e2583dac3f23dbf6378a1eb194d8e3a6ee06b8870ccce8.json
    3/10:       http://repo.packagist.org/p/provider-2015$2386737641788c1c4028f3e4ef660d2b943225ec9ef628f950b78318ab85aae7.json
    4/10:       http://repo.packagist.org/p/provider-2019-10$b3a05d79df4089bea2f5fe34d8310a4782aecba55eed265ae5294c4f778a84b3.json
    5/10:       http://repo.packagist.org/p/provider-2019$2bc08951c25c11eaafd69eefef138011cea4fd0ece31d50f47a57913f3531b16.json
    6/10:       http://repo.packagist.org/p/provider-2016$c40345634080e37ff5671a70bc06d3ca8b289c28c96fbda5728c1e56988359fe.json
    7/10:       http://repo.packagist.org/p/provider-2020-01$b5bfc61ac4692d85e9adada04b7aa0e7852d899220d93c8365d1c902eb36b70f.json
    8/10:       http://repo.packagist.org/p/provider-2020-04$9b2361cb6ae781889cd664f1d71fcab5de8873e2cbc8f0d812fc52bbe8174689.json
    9/10:       http://repo.packagist.org/p/provider-2017$502291b972280e346bdaf8bff71f8a62e2647e0b6860a9e25513b5f20564fe61.json
    10/10:      http://repo.packagist.org/p/provider-2018$19577c7b34ae6fbb1eb8957653ecdba16ebd7a8dec7ba5727c875d89c1d83bad.json
    Finished: success: 10, skipped: 0, failure: 0, total: 10
Loading composer repositories with package information
Updating dependencies (including require-dev)


  [ErrorException]
  fopen(/Users/myuser/.composer/cache/files/magento/theme-frontend-luma/873ad0c55501fa7ae548f048b69ca7af8c2a3bd8.zip): failed to open stream: Too many open files
3
  • What are the results of ulimit -n for you? Jun 12 '20 at 7:04
  • ulimit -n results in 256, I'm not really familiar with ulimit and maxfiles and whatnot, but might this be the problem? How would I go about changing this?
    – Ambidex
    Jun 12 '20 at 7:43
  • Something like that should help I think stackoverflow.com/a/14749074/1141023 Jun 12 '20 at 7:53
6

You can up your system's file open limit on Linux or Max OS with the following:

ulimit -n 10000

This should help with the composer issue.

2
  • That did the trick! Am I correct to assume that this will not be permanent? Do I need to fix this value somehow?
    – Ambidex
    Jun 12 '20 at 8:06
  • Honestly, I am not too sure. I know you can fix this in the /etc/security/limits.conf which should be permanent but I am not sure if running ulimit is permanent. Jun 12 '20 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.