Magento 2.2.8 upgrade - Problem with “Unable to unregister protocol phar” during compile
-
24-02-2021 - |
Question
First, some background. I have 6 Magento 2.2.x sites on a development server. 4 of the 6 upgraded just fine. I used the same standard composer upgrade process on all of them. They're on a single apache/php environment via virtualhosts so they all have the same resources.
On 2 of them, I get this error when trying to compile (edited to remove the domain):
[Exception]
Warning: stream_wrapper_unregister(): Unable to unregister protocol phar:// in [DOCUMENT ROOT PATH]/html/app/bootstrap.php on line 11
I can't seem to get any further information about where the issue actually is. I've reset the files & database to pre-upgrade state and it compiles fine (one is 2.2.7, the other is 2.2.5) -- but if I repeat the upgrade, then it errors again.
Any information about how to troubleshoot further would be greatly appreciated.
Solution
So in the end, the road block was 2 custom modules that use the app/bootstrap.php
Between 2.2.7 and 2.2.8 there was a commit to bootstrap.php that only added:
`stream_wrapper_unregister('phar');`
Phar is enabled (verified with phpinfo(); ) but it doesn't seem to have the stream_wrapper enabled as that doesn't list specifically for Phar, but does list for other extensions, like bzip. So the Magento 2.2.8 code change just fires off a disable without a check to see if it IS enabled first -- apparently.
For now, we've modified the custom modules not not require bootstrap.php