Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not compress the PHAR: the compression requires too many file descriptors to be opened #437

Open
theofidry opened this issue Sep 21, 2019 · 1 comment

Comments

@theofidry
Copy link
Member

theofidry commented Sep 21, 2019

Bug report

Question Answer
Box version 3.8.0
PHP version 7.2.18
Platform with version OSX

When trying to compile Box, I got:

 [ERROR] Could not compress the PHAR: the compression requires too many file descriptors to be opened (1806). Check your
         system limits or install the posix extension to allow Box to automatically configure it during the compression

This is the first time ever I got it... 1806 matches the number of files found in box.phar, but what looks weird is that:

posix_getrlimit()['soft openfiles'] => 10240
posix_getrlimit()['hard openfiles'] => 10240

So it is likely that either checking this file limit is not enough...

For the record, the limit is bumped here and the actual code for bumping the limit is here

@theofidry
Copy link
Member Author

theofidry commented Sep 27, 2020

This issue is still occurring locally... no clue why or how to fix it

$ make compile
# Compile Box
bin/box compile

    ____
   / __ )____  _  __
  / __  / __ \| |/_/
 / /_/ / /_/ />  <
/_____/\____/_/|_|


Box version 3.x-dev@e65178c

 // Loading the configuration file "/path/to/box/box.json.dist".

🔨  Building the PHAR "/path/to/box/bin/box.phar"

? Removing the existing PHAR "/path/to/box/bin/box.phar"
? Setting replacement values
  + @release-date@: 2020-09-27 14:03:56 UTC
? Registering compactors
  + KevinGH\Box\Compactor\Php
  + KevinGH\Box\Compactor\PhpScoper
  + KevinGH\Box\Compactor\Json
? Adding main file: /path/to/box/bin/box
? Adding requirements checker
? Adding binary files
    > 31 file(s)
? Auto-discover files? Yes
? Exclude dev files? Yes
? Adding files
    > 1617 file(s)
? Generating new stub
  - Using shebang line: #!/usr/bin/env php
  - Using banner:
    > This file is part of the box project.
    >
    > (c) Kevin Herrera <kevin@herrera.io>
    > Théo Fidry <theo.fidry@gmail.com>
    >
    > This source file is subject to the MIT license that is bundled
    > with this source code in the file LICENSE.
? Dumping the Composer autoloader
? Removing the Composer dump artefacts
? Compressing with the algorithm "GZ"


 [ERROR] Could not compress the PHAR: the compression requires too many file descriptors to be opened (1687). Check your
         system limits or install the posix extension to allow Box to automatically configure it during the compression



In Compile.php line 667:

  unable to create temporary file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant