box
box copied to clipboard
File contents are missing in compressed zip
Bug report
Question | Answer |
---|---|
Box version | 3.8.4@120b0a3 2019-12-13 17:22:43 UTC |
PHP version | 7.3.6 |
Platform with version | Debian (docker php) |
Github Repo | https://github.com/phpDocumentor/phpDocumentor |
We were using the GZ compression but for some reason, we got a report that a number of warnings were triggered during the execution of phpdocumentor when phar.readonly=off
after some debugging I found that some of the files included in the phar were empty.
After disabling the compression the warnings are gone. Linked issue: https://github.com/phpDocumentor/phpDocumentor/issues/2161
I'm genuinely confused this does not make any sense. But good news is I've got some leads :)
So first of all, as you can see here, there is nothing fancy in the compression it's mostly the raw PHAR extension API. The main difference is in the way it is done to avoid hitting the file description limit (it is bumped just before in Compile.php
).
You are however mentioning phar.readonly=off
and I noticed phpDocumentor switched to Symfony. So it leads me to two things:
- When you have
phar.readonly=on
, to compile your PHAR, Box will restart the process to setphar.readonly=off
instead. The same is done if xdebug is enabled to disable it in order to speed things up. I however hardly see how this could be the cause so if it is it would require more extensive investigation. - The compiler is not compiled correctly
I have strong suspicions on the second one because if that is the case, then the container will try to dump the "compiled" version in the PHAR and that is not possible unless you have phar.readonly=off
. But even so you will change the PHAR signature and it won't work for everyone, a PHAR must be seen as putting your application in a read-only environment.
I strongly suggest you to read this doc entry in details and giving it another go.
If that turns out to be unhelpful, I would like if possible:
- details on the building process
- the output with
--debug
, especially the configuration file dump (in.box_dump
)
Thanks for the feedback I'm going giving it a try to find out what is going on.
Had a quick look: this looks more related to the Symfony cache not working well with the compression. So a bug yes but likely on Symfony side
@jaapio did you manage to make it work?
It's a long time ago, but I think this is still an issue. I never tried it since I created this issue.
But it's ok for me to close this issue for now. I will create a new issue when I have time to provide proper feedback.