Fix PECL migration: verify PHP extensions actually load, repair if broken#2826
Merged
Conversation
…if not The PECL to OS package migration left systems broken when the OS package was already installed: pecl uninstall deleted the dpkg-owned .so, the mods-available .ini (a dpkg conffile) was removed and never restored, and phpdismod -v ALL left the modules disabled. Re-running the update never repaired this since the migration only triggered on PECL registry state. The block is now state-based instead of history-based: after cleaning up PECL leftovers, each extension is checked with php -m (not loaded, or loaded twice via stale enable symlinks = broken). If any of them is broken, all three packages are purged and reinstalled as one unit (they are interdependent), stale enable symlinks are removed, and the result is verified again. This auto-heals already broken installations on their next update run and is a no-op on healthy systems. Fixes #2820
53a72b3 to
064d752
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The PECL→OS package migration could leave systems without working redis/igbinary/smbclient extensions (
Memcache OC\Memcache\Redis not available for local cache), and re-running the update never repaired them because the migration only triggered on PECL registry state.The block is now state-based: after removing PECL leftovers, each extension is health-checked with
php -m(not loaded, or loaded twice via stale enable symlinks = broken). If anything is broken, all three packages are purged and reinstalled as one unit (php-redis depends on php-igbinary), stale enable symlinks are removed, conffiles are force-restored, and the result is verified again.occ upgrade)Fixes #2820