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

Package version tracker: conflicts with third-party plugins #21165

Closed
jeherve opened this issue Sep 23, 2021 · 1 comment · Fixed by #21173
Closed

Package version tracker: conflicts with third-party plugins #21165

jeherve opened this issue Sep 23, 2021 · 1 comment · Fixed by #21173
Assignees
Labels
[Package] Connection [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended

Comments

@jeherve
Copy link
Member

jeherve commented Sep 23, 2021

This issue is triggered when using a third-party plugin, Passwords Evolved (W.org / GitHub).

Steps to reproduce

  • On a brand new site, install the Passwords Evolved plugin.
  • Then, install, activate, and connect Jetpack version 10.0.
  • Then, update from version 10.0 to 10.1.

You'll notice the following fatal on all pages from that point on:

PHP Fatal error:  Uncaught InvalidArgumentException: Container doesn't have a value stored for the "password.generator" key. in /wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php:94
Stack trace:
#0 /wp-content/plugins/passwords-evolved/src/Plugin.php(79): PasswordsEvolved\DependencyInjection\Container->offsetGet('password.genera...')
#1 /wp-content/plugins/passwords-evolved/pluggable.php(60): PasswordsEvolved\Plugin->get_password_generator()
#2 /wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-client.php(109): wp_generate_password(10, false)
#3 /wp-content/plugins/jetpack/vendor/automattic/jetpack-connection/src/class-client.php(26): Automattic\Jetpack\Connection\Client::build_signed_request(Array, '{"package_versi...')
#4 /srv/users/user6dae in /wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 94

References:

This tracks back to the requests we added in #20365. @kbrown9 Do you think you could take a look?

Thank you!


Originally reported here:

@jeherve jeherve added [Type] Bug When a feature is broken and / or not performing as intended [Pri] Normal [Package] Connection labels Sep 23, 2021
@kbrown9
Copy link
Member

kbrown9 commented Sep 23, 2021

Thanks for digging into this issue, @jeherve!

It looks like Passwords Evolved sets the password.generator key during the after_setup_theme action, but the Package Version Tracker is sending the request before that action fires. I think I can just hook the request to a later action to resolve this error.

kbrown9 added a commit that referenced this issue Sep 23, 2021
Fixes #21165

Send the package versions to wpcom on the init hook instead of plugins loaded
to prevent a conflict with a third party plugin. The plugin isn't ready until the
'after_setup_theme' action has fired.
samiff added a commit that referenced this issue Sep 27, 2021
Fixes #21165

Send the package versions to wpcom on the init hook instead of plugins loaded
to prevent a conflict with a third party plugin. The plugin isn't ready until the
'after_setup_theme' action has fired.

Co-authored-by: Jeremy Herve <[email protected]>
Co-authored-by: Samiff <[email protected]>
retrofox pushed a commit that referenced this issue Oct 1, 2021
Fixes #21165

Send the package versions to wpcom on the init hook instead of plugins loaded
to prevent a conflict with a third party plugin. The plugin isn't ready until the
'after_setup_theme' action has fired.

Co-authored-by: Jeremy Herve <[email protected]>
Co-authored-by: Samiff <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Connection [Pri] Normal [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants