Skip to content
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

Problem w/ the auto-loader in 3.16.0 #861

Closed
pbiron opened this issue Apr 22, 2024 · 11 comments
Closed

Problem w/ the auto-loader in 3.16.0 #861

pbiron opened this issue Apr 22, 2024 · 11 comments
Labels
Milestone

Comments

@pbiron
Copy link

pbiron commented Apr 22, 2024

I just updated to the newly released v3.16.0 and the site crashed w/ a WSOD. Appears there's a problem in the composer auto-loader in the new version

Warning: require(path-to-site/plugins/query-monitor/vendor/composer/../symfony/deprecation-contracts/function.php): Failed to open stream: No such file or directory in path-to-site/plugins/query-monitor/vendor/composer/autoload_real.php on line 42

Fatal error: Uncaught Error: Failed opening required 'path-to-site/plugins/query-monitor/vendor/composer/../symfony/deprecation-contracts/function.php' (include_path='.;C:\php\pear') in path-to-site/plugins/query-monitor/vendor/composer/autoload_real.php:42 Stack trace: #0 path-to-/site/plugins/query-monitor/vendor/composer/autoload_real.php(46): {closure}('6e3fae29631ef28...', 'path-to-site...') #1 path-to-site/plugins/query-monitor/vendor/autoload.php(25): ComposerAutoloaderInitad25d53a23099da4b0886b4f6754360e::getLoader() #2 path-to-site/plugins/query-monitor/wp-content/db.php(78): require_once('path-to-site...') #3 path-to-site/wp-includes/load.php(675): require_once('path-to-site...') #4 path-to-site/wp-settings.php(131): require_wp_db() #5 path-to-site/wp-config.php(105): require_once('path-to-site...') #6 path-to-site/wp-load.php(50): require_once('path-to-site...') #7 path-to-site/wp-admin/admin.php(34): require_once('path-to-site...') #8 path-to-site/wp-admin/plugins.php(10): require_once('path-to-site...') #9 {main} thrown in path-to-site/plugins/query-monitor/vendor/composer/autoload_real.php on line 42

@johnbillion johnbillion added this to the 3.16.1 milestone Apr 22, 2024
@johnbillion
Copy link
Owner

This Composer configuration has been nothing but a nightmare. I need to find a way to make it determinate and testable.

@johnbillion
Copy link
Owner

I've shipped a fix for this directly to wordpress.org as 3.16.1 because evidently there is an issue with the Composer configuration in the build action here on GitHub.

@slackday
Copy link

slackday commented Apr 22, 2024

Sorry but I get the same problem but for another file myclabs/deep-copy/src/DeepCopy/deep_copy.php

Warning: require(/app/web/app/plugins/query-monitor/vendor/composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php): Failed to open stream: No such file or directory in /app/web/app/plugins/query-monitor/vendor/composer/autoload_real.php on line 42

Fatal error: Uncaught Error: Failed opening required '/app/web/app/plugins/query-monitor/vendor/composer/../myclabs/deep-copy/src/DeepCopy/deep_copy.php' (include_path='.:/usr/share/php') in /app/web/app/plugins/query-monitor/vendor/composer/autoload_real.php:42 Stack trace: #0 /app/web/app/plugins/query-monitor/vendor/composer/autoload_real.php(46): {closure}() #1 /app/web/app/plugins/query-monitor/vendor/autoload.php(25): ComposerAutoloaderInitad25d53a23099da4b0886b4f6754360e::getLoader() #2 /app/web/app/plugins/query-monitor/query-monitor.php(56): require_once('...') #3 /app/web/wp/wp-settings.php(517): include_once('...') #4 /app/web/wp-config.php(10): require_once('...') #5 /app/web/wp/wp-load.php(55): require_once('...') #6 /app/web/wp/wp-blog-header.php(13): require_once('...') #7 /app/web/index.php(5): require('...') #8 {main} thrown in /app/web/app/plugins/query-monitor/vendor/composer/autoload_real.php on line 42

edit

3.16.1 was not available on wpackagist when I tested. Same problem as @pbiron now.

Thanks for looking into it so quickly @johnbillion :)

edit 2

Downgrade to 3.15 works

@pbiron
Copy link
Author

pbiron commented Apr 22, 2024

unfortunately, 3.16.1 fatals as well, with a slightly different error message

Fatal error: Uncaught Error: Class "QM_Activation" not found in path-to-site/plugins/query-monitor/query-monitor.php:58

@johnbillion
Copy link
Owner

I think I need to get rid of the dependency on the Composer autoloader and ship my own. It's just a simple class mapping, so the rest of the Composer autoloading functionality isn't needed.

@pbiron
Copy link
Author

pbiron commented Apr 22, 2024

I just cloned the repo to my local machine and did a composer dump-autoload from the command-line. And that seems to produce a usable auto-loader. The vendor dir resulting from that CLI (which has the working auto-loader) is attached here.

vendor.zip

@johnbillion
Copy link
Owner

Shipped 3.16.2 with that class map back in place. Bleugh.

@pbiron
Copy link
Author

pbiron commented Apr 22, 2024

success: 3.16.2 works!

Thanx for jumping on this so quickly!

@jakeparis
Copy link

jakeparis commented May 9, 2024

Not sure if it's worth making a new issue, but

  • I have an autoloader-related problem
  • in version 3.16.2

I am able to install/activate the plugin (via wp-cli) with no problem, but the site then throws a critical error:

PHP Fatal error:  Cannot declare class ComposerAutoloaderInitad25d53a23099da4b0886b4f6754360e, because
 the name is already in use in /var/www/html/example.com/wp-content/plugins/query-monitor/vendor/com
poser/autoload_real.php on line 5

I'm happy to split this out into a separate issue if that's better.

@johnbillion
Copy link
Owner

@jakeparis Yeah that's a separate issue, probably not related to this one. Can you try deleting the wp-content/db.php file? Then deactivate and reactivate QM.

More info here: https://wordpress.org/support/topic/fatal-error-cannot-declare-class-composerautoloader/

@jakeparis
Copy link

Yes, fixed it. Thank you for that reference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants