-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
Failed to open stream and cannot open phar archive #433
Comments
Thanks for the report. It sounds very weird indeed, could you upload the problematic PHAR just in case? |
I just downloaded the latest 3.8.0 phar from the releases page, but here it is just in case |
I'm honestly lost at what could do this... Trying to install 7.2.21 to see if this is happening locally as well... |
So I decided to clone the repo and run
|
This is really curious... I was aware of a similar issue when compressing the PHAR, hence Box raises the file limit: https://github.com/humbug/box/blob/master/src/Console/Command/Compile.php#L621 This however looks unrelated and happening in the processes when parallelising the work... @kelunik do you have an idea on what's going there? Or maybe on how we could debug this or make it easier to debug |
@theofidry I've no idea, sorry. Could you check which setup worked before, so which PHP version you used before? What's the configured file limit? |
@allejo could you confirm:
If possible run the compilation step with |
Here's the output of the
Thanks a lot for taking the time to help! |
I really can't find anything on it :( Can you try with |
Yup! Running it with |
I stumbled upon box-project/box2#80, which recommended increasing the soft open file limit with |
You can find more information about that in #437, but maybe the issue is that this is happening before... Could you try to clone the project, edit |
It looks like that fixed it for me. I manually called diff --git a/src/Console/Command/Compile.php b/src/Console/Command/Compile.php
index 2a7ec70..069005a 100644
--- a/src/Console/Command/Compile.php
+++ b/src/Console/Command/Compile.php
@@ -223,6 +223,15 @@ HELP;
$check = $this->registerRequirementsChecker($config, $box, $logger);
+ $hardLimit = posix_getrlimit()['hard openfiles'];
+ $filesCount = 2048;
+
+ posix_setrlimit(
+ POSIX_RLIMIT_NOFILE,
+ $filesCount,
+ 'unlimited' === $hardLimit ? POSIX_RLIMIT_INFINITY : $hardLimit
+ );
+
$this->addFiles($config, $box, $logger, $io);
$this->registerStub($config, $box, $main, $check, $logger); |
Cool. Then I guess it could be dumped to a safe number beforehand as well then |
I also have this problem. described in OP. |
Could you try with 3.8.3? |
3.8.3 fixes the issue for me 🎉 Thanks @theofidry! |
So about a week ago, I ran the
box.phar
no problem built a PHAR successfully with 3.8.0. However, since then, I believe I've changed/updated PHP versions and now I'm getting this error on PHP 7.2.21.And for the life of me, I can't figure out what has changed that now I can't compile any PHARs.
The text was updated successfully, but these errors were encountered: