Open mdbitz opened 9 months ago
I doubt this really has anything to do with Jetpack-the-plugin, or the autoloader. If I had appropriate access, I'd start the investigation by looking at these sites to see whether their copies of Boost and such are somehow missing files or have bad permissions set somehow.
This issue has been marked as stale. This happened because:
No further action is needed. But it's worth checking if this ticket has clear reproduction steps and it is still reproducible. Feel free to close this issue if you think it's not valid anymore — if you do, please add a brief explanation.
@mdbitz @anomiex – We were able to reproduce the error in WooPayments:
PHP Fatal error: Uncaught Error: Failed opening required '/srv/htdocs/wp-content/plugins/woocommerce-payments/includes/multi-currency/Settings.php' (include_path='/:.') in /srv/htdocs/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php:108
More details: p1730814615547449-slack-CGGCLBN58
TL;DR: The error happens once when updating the plugin. The new version had a directory moved, and the classes in this directory are PSR-4 autoloaded.
Any ideas on the best way to fix this?
Once when updating the plugin is a documented caveat of the autoloader, and likely would apply to most non-Jetpack autoloaders too.
The solution for that is for the plugin to avoid triggering autoloading of the moved classes in the update request after the update has happened. Failing that, they'd need to include a stub at the old path that loads from the new path (see this for example).
Thanks for the clarification @anomiex. The issue was happening because a hook was calling an autoloaded class after the upgrade process. Since the move to a new path is not really important for us, we opened a PR to fix the issue by maintaining the autoloaded paths.
Impacted plugin
Jetpack
Quick summary
We are seeing on the Atomic platform multiple fatal errors where the Autoloader "Failed opening required" files. The interesting aspect is that the file it fails to find can be non-jetpack plugins.
Steps to reproduce
Unknown -> can't reproduce on my test sites spun up on various pools.
A clear and concise description of what you expected to happen.
No Fatals errors should be triggered by Jetpack code flows.
What actually happened
No response
Impact
Some (< 50%)
Available workarounds?
No but the platform is still usable
Platform (Simple and/or Atomic)
Atomic
Logs or notes
Errors can be see in at-php-errors logstash name=jetpack