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

Connection: compatibility issue when using Passwords Evolved plugin (PHP 8.1) #23835

Open
knutsp opened this issue Apr 6, 2022 · 8 comments
Open
Assignees
Labels
[Focus] Compatibility Ensuring our products play well with third-parties [Package] Connection [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [Type] Bug When a feature is broken and / or not performing as intended

Comments

@knutsp
Copy link

knutsp commented Apr 6, 2022

Impacted plugin

Jetpack

Steps to Reproduce

  1. Install Passwords Evolved plugin
  2. Install Jetpack 10.7 - Connect - Select Free plan
  3. Upgrade to Jetpack 10.8
  4. Navigate o a dashboard or front end page

A clear and concise description of what you expected to happen.

Everything to be as normal, no errors

What actually happened

Page displays "Fatal error occurred on this site" (or similar) message created by WordPress Fatal Error handler.

Other information

`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()
#1 /.../wp-content/plugins/passwords-evolved/pluggable.php(59): PasswordsEvolved\Plugin->get_password_generator()
#2 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(132): wp_generate_password()
#3 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(37): Automattic\Jetpack\Connection\Client::build_signed_request()

#4 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(453): Automattic\Jetpack\Connection\Client::remote_request()

#5 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-plan.php(51): Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog()

#6 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-plan.php(67): Automattic\Jetpack\Search\Plan->get_plan_info_from_wpcom()

#7 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-plan.php(71): Automattic\Jetpack\Search\Plan->get_plan_info()

#8 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/class-plan.php(97): Automattic\Jetpack\Search\Plan->get_plan_info()

#9 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/initializers/class-initializer.php(208): Automattic\Jetpack\Search\Plan->supports_search()

#10 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-search/src/initializers/class-initializer.php(51): Automattic\Jetpack\Search\Initializer::is_search_supported()

#11 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(233): Automattic\Jetpack\Search\Initializer::init()

#12 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(169): Automattic\Jetpack\Config->enable_search()

#13 /.../wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-config/src/class-config.php(114): Automattic\Jetpack\Config->ensure_feature()

#14 /.../wp-includes/class-wp-hook.php(307): Automattic\Jetpack\Config->on_plugins_loaded()

#15 /.../wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

#16 /.../wp-includes/plugin.php(474): WP_Hook->do_action()

#17 /.../wp-settings.php(450): do_action()

#18 /../wp-config.php(118): require_once('/.../...')

#19 /.../wp-load.php(55): require_once('/.../...')

#20 /.../wp-admin/admin.php(34): require_once('/...')

#21 /.../wp-admin/index.php(10): require_once('/...')

#22 {main}
thrown in /.../wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php on line 94`

Same happened with update to Jetpack 10.1, bit later fixed. See #21165

Operating System

Linux

OS Version

No response

Browser

Other / Not applicable

Browser Version(s)

No response

@knutsp knutsp added the [Type] Bug When a feature is broken and / or not performing as intended label Apr 6, 2022
@github-actions github-actions bot added the [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ label Apr 6, 2022
@jeherve
Copy link
Member

jeherve commented Apr 7, 2022

cc @kraftbj since you worked on #21243, although it seemed to work well with shutdown for a while. Not sure what's happening here.

@jeherve jeherve added [Package] Connection [Focus] Compatibility Ensuring our products play well with third-parties labels Apr 7, 2022
@jeherve jeherve changed the title Fatal error PHP 8.1 Connection: compatibility issue when using Passwords Evolved plugin Apr 7, 2022
@jeherve jeherve changed the title Connection: compatibility issue when using Passwords Evolved plugin Connection: compatibility issue when using Passwords Evolved plugin (PHP 8.1) Apr 7, 2022
@austinginder
Copy link

austinginder commented Jun 7, 2022

Seeing the same issue with latest version of Jetpack v11 and Passwords Evolved v1.3.2 using PHP 7.4.

2022/06/07 18:57:36 [error] 96849#96849: *211375 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Container doesn't have a value stored for the "password.generator" key. in /www/public/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php:94
Stack trace:
#0 /www/public/wp-content/plugins/passwords-evolved/src/Plugin.php(79): PasswordsEvolved\DependencyInjection\Container->offsetGet('password.genera...')
#1 /www/public/wp-content/plugins/passwords-evolved/pluggable.php(59): PasswordsEvolved\Plugin->get_password_generator()
#2 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(132): wp_generate_password(10, false)
#3 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(37): Automattic\Jetpack\Connection\Client::build_signed_request(Array, NULL)
#4 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client" while reading response header from upstream, client: 73.175.80.41, server: hcsv.org, request: "GET /wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s= HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7.4-fpm-hcsvs.sock:", host: "hcsv.org:28560", referrer: "https://hcsv.org/wp-admin/plugins.php?kinsta-cache-cleared=true"

Resolved I was able to resolve my issue but I'm not sure how I did that. Here are a few things I did:

  • I notice Jetpack wasn't syncing properly so I run a full sync over the command line wp jetpack sync start
  • Upgraded my site from PHP 7.4 to 8.1

@austinginder
Copy link

Just following up with a few observations. This PHP fatal error seems to go away if the WordPress sites are able to complete a full site sync with Jetpack or resolve Jetpack connection issues. Apparently I have a number of sites where the Jetpack connection is broken and needs to be manually resolved. Just thought I'd mention in case that helps with troubleshooting.

@jeherve
Copy link
Member

jeherve commented Jun 20, 2022

@austinginder Thanks for the extra details.

Could you clarify whether your sites use a specific way of loading plugins (e.g. all required via composer) or if they're installed regularly?

@austinginder
Copy link

austinginder commented Jun 20, 2022

No all of the plugins are loaded the standard way. These sites are just experiencing a common Jetpack connection issue. This is what wp jetpack status looks like.

Screenshot from 2022-06-18 21-51-20

Running wp jetpack test-connection reports "Error: It looks like your Jetpack connection is broken. Try disconnecting from WordPress.com then reconnecting.".

I also trying running wp jetpack sync start on these sites before I noticed the connection was broken and it endless says "Sent data to WordPress.com". After 24hrs of sending data to Jetpack I concluded it was just stuck in a loop and I killed the process.

I suspect fixing the Jetpack connection issue hides the fact that this plugin conflict exists, thus making it harder to reproduce.

@jeherve
Copy link
Member

jeherve commented Jun 21, 2022

Thanks for the extra details. I broke a test site to try to reproduce, but no luck. Even though my connection is broken and Sync is stuck, I do not get a fatal when activating the Passwords Evolved plugin. Did you maybe experience the fatal at a different time, when taking a different action on the site?
Screen Shot 2022-06-21 at 19 06 10

If you get the chance and have the option to do so, it may be worth trying to patch your installation with #24688, and see how that goes?

Thank you!

@austinginder
Copy link

@jeherve The PHP errors happen when attempting to sign into the backend. Front-end is fine. Couldn't even load the wp-login.php page.

I tried your patch and it actually made things worse. Both front-end and backend were giving PHP fatal errors.

Screenshot from 2022-06-21 14-38-52

Looks like the same errors in the error log.

2022/06/21 18:40:29 [error] 55743#55743: *154353 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught InvalidArgumentException: Container doesn't have a value stored for the "password.generator" key. in /www/public/wp-content/plugins/passwords-evolved/src/DependencyInjection/Container.php:94
Stack trace:
#0 /www/public/wp-content/plugins/passwords-evolved/src/Plugin.php(79): PasswordsEvolved\DependencyInjection\Container->offsetGet('password.genera...')
#1 /www/public/wp-content/plugins/passwords-evolved/pluggable.php(59): PasswordsEvolved\Plugin->get_password_generator()
#2 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(136): wp_generate_password(10, false)
#3 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-client.php(37): Automattic\Jetpack\Connection\Client::build_signed_request(Array, NULL)
#4 /www/public/wp-content/plugins/jetpack/jetpack_vendor/automattic/jetpack-connection/src/class-c" while reading response 

@cliffordp
Copy link

FYI: Issue remains on latest versions of Jetpack and Passwords Evolved :'(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Compatibility Ensuring our products play well with third-parties [Package] Connection [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] In Progress [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.

4 participants