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

Critical error which triggered recovery mode #3081

Closed
osterchrisi opened this issue Feb 8, 2025 · 2 comments
Closed

Critical error which triggered recovery mode #3081

osterchrisi opened this issue Feb 8, 2025 · 2 comments
Labels
support Support case

Comments

@osterchrisi
Copy link

WooCommerce\WooCommerce\Logging\Logger\WooCommerceLogger::log($level, $message, array $context = []) must be compatible with Psr\Log\LoggerTrait::log($level, Stringable|string $message, array $context = []): void
Additional context
{
"error": {
"type": 64,
"file": "/home/public_html/wp-content/plugins/woocommerce-paypal-payments/modules/woocommerce-logging/src/Logger/WooCommerceLogger.php",
"line": 58
},
"remote-logging": true,
"backtrace": [
{
"file": "/home/public_html/wp-content/plugins/woocommerce/includes/class-woocommerce.php",
"line": 411,
"function": "critical",
"class": "WC_Logger",
"type": "->"
},
{
"function": "log_errors",
"class": "WooCommerce",
"type": "->"
}
]
}

Happens after update to 2.9.6.

@Jaykame
Copy link

Jaykame commented Feb 8, 2025

Reported here: 9389743-zen

@SydeKrystian SydeKrystian added the support Support case label Feb 10, 2025
@SydeKrystian
Copy link
Collaborator

Hello @osterchrisi

The fatal error is triggered because our plugin uses a previous version of psr/log , as defined in woocommerce-paypal-payments/blob/trunk/composer.json with "psr/log": "^1.1" . The more recent version that would be compatible with PHP 8.2 is this one: https://packagist.org/packages/psr/log#3.0.0. The Psr/log version 3.0.0 requires PHP version 8.0.0 or higher and uses Union types in its arguments, which PayPal Payments doesn’t support yet.

Most likely, some other plugin on your site implements the library psr/log in version 3.0.0 which is not compatible with the version used in PayPal Payments.

The first step would be to confirm if its this one, so you may want to perform a full conflict test. We recommend temporarily activating the default theme Storefront and disabling all other plugins except for WooCommerce and PayPal Payments, and then enabling other plugins one by one to see when the error occurs. Once you know which other plugin implements this version of the dependency, you could potentially ask the other plugin developer to consider downgrading the dependency version.

Alternatively, a potential workaround would be downgrading to PHP 7.4. For a complete fix, we are in the process of merging a crucial update that will address this compatibility issue permanently. You can follow the progress of this update through our GitHub repository:

Issue tracking: GitHub issue #1518
Pending resolution Pull Request: PR #1944

We anticipate integrating these changes by q2 with the release of PayPal Payments version 3.0+. This update will ensure that all dependency conflicts are resolved.

Should you need any more help, feel free to reach out.

Kind Regards,
Krystian

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

No branches or pull requests

3 participants