Open mohammedTBB opened 2 years ago
Hi @mohammedTBB. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
@magento give me 2.4-develop instance
- upcoming 2.4.x release
For more details, review the Magento Contributor Assistant documentation.
Add a comment to assign the issue: @magento I am working on this
To learn more about issue processing workflow, refer to the Code Contributions.
Join Magento Community Engineering Slack and ask your questions in #github channel.
:warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.
:clock10: You can find the schedule on the Magento Community Calendar page.
:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel
Hi @engcom-Dash. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.Issue: Clear Description
label to the issue by yourself.Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.2.4-develop
branch@magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure. 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.Hi @mohammedTBB ,
We are trying to reproduce the issue in 2.4.5 magento instance....But we are not able to reproduce the issue. We are getting expected result and it is not reproducible.
Steps: 1.install 2.4.5 magento instance 2.Go to category page 3.Select the product 4.got to product page 5.No error occurring
Let us know if we missing anything!
Thanks!!!
Maybe the Anowave E-commerce 3rd party package script (i.e. CrashReporter.php) detects an issue that triggers a call to Zend/DbStatement.php... which in turn then executes the deprecated functionality in M2 zendframework? Perhaps wouldn't be reproduceable unless Anowave EC extension tries to report the "crash". We've had a several of that kind of circumstance in debugging php8.1 compatibility issues in 3rd party extensions: fix the first bit of deprecated code, test and that reveals a new one downstream... rinse and repeat.
Hi @engcom-Hotel. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:
[ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).Details
If the issue has a valid description, the label Issue: Format is valid
will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid
appears.
[ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description
label to the issue by yourself.
[ ] 3. Add Component: XXXXX
label(s) to the ticket, indicating the components it may be related to.
[ ] 4. Verify that the issue is reproducible on 2.4-develop
branchDetails
- Add the comment @magento give me 2.4-develop instance
to deploy test instance on Magento infrastructure.
- If the issue is reproducible on 2.4-develop
branch, please, add the label Reproduced on 2.4.x
.
- If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!
[ ] 5. Add label Issue: Confirmed
once verification is complete.
[ ] 6. Make sure that automatic system confirms that report has been added to the backlog.
Hello @mohammedTBB,
Thanks for the report and collaboration!
We have checked this issue in the Magento 2.4.5, 2.4.4, and 2.4-develop branches. And also examine the file vendor/magento/zendframework1/library/Zend/Db/Statement.php
and found that the suggested possible fix as below:
if ($sql === null) {
return '';
}
is already there in line no. 201
.
Hello @n2diving-dgx,
Can you please suggest a way to reproduce the issue? Does we need to install the Anowave E-commerce
, and the try to throw an issue. Please suggest.
Thanks
@engcom-Hotel: if you read the error message carefully, you'll see that the error happens on line 222. Which means that the check on line 201 already passed.
So this most likely means that the second preg_replace
call failed, which would explain why the $sql
value changes to null
.
Also, we have a third preg_replace
call, which could potentially also fail, so maybe that one needs to be checked as well?
Hello @engcom-Hotel
yes there is check in line 201 but then the value of $sql changed.
what worked for us is adding the check at line 222
to reproduce the error it is essential to have the plugin amasty google rich snippets, knowing that disabling this plugin the error is no longer showing.
what seems to happen that the plugin amasty google rich snippets calls a zendfremwork funcion where the error happen.
Hello @hostep @mohammedTBB,
Thanks for the reply!
I agree with your point @hostep, we need to add the checks after each preg_replace
call here ie. line numbers i.e. 210 & 222.
I have also gone through the preg_replace documentation, it can be returned as null
, in case of error occurred.
Hence confirming the issue.
Thanks
:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/AC-6632 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-Hotel. Thank you for verifying the issue.
Issue Available: @engcom-Hotel, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
@mohammedTBB @hostep @n2diving-dgx does anyone of you know how to reproduce this issue? From what I can read, it does not always occur? I have the same situation for a client.
@hostep the error sometimes occurs on production. But the problem for me is that I don't know how to reproduce this locally.
Any ideas?
The only thing I can think of, is to patch the code on production with some extra lines that try to detect this occurrence and add a bunch of logging to try to see what the $sql
variable contains just before it turns into null
...
And then hope that after a few days you'll find something interesting in your log files which can then hopefully explain what's going on.
I stumbled across this recently. If you go to the Customer Grid in the admin and search:
':{}{}{":]a''a'a':{}{}{"a:]{":a'a':{}{}{":]a'']a''a'a':{}{}:]{":a'a':{}{}{":]a'']a''a'a':{}{}:]{":a'a':{}{}{":]a:]{":a'a':{}{}{":]a'']a''a'a':{}{}:]{":a'a':{}{:]{":a'a':{}{}{":]a'']a''a'a':{}{}:]{":a'a':]{":a'a':{}{}{":]a'']a''a'a':{}{}:]{"::]{":a'a':{}{}{":]a'']a''a'a':{}{}a'a':{}{}{":]a'']a''a'a':{}{}:{}{}{":]a'']a''a'a':{}{}}{":]a'']a''a'a':{}{}'']a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':{}{}{":]a''a'a':{}{}{"a:]a''a'a':{}':':
You create an exception that stems from the same problem.
Note that you may hit a server error if the request URI is too long. You may need to adjust server config.
You have to be in production mode or have error reporting off because of a check done here:
vendor/magento/framework/App/ErrorHandler.php:54
$errorNo = $errorNo & error_reporting();
if ($errorNo == 0) {
return false;
}
Exception:
[2023-01-18T19:42:07.045616+00:00] report.CRITICAL: Exception: Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /chroot/home/website/html/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222 in /chroot/home/website/html/vendor/magento/framework/App/ErrorHandler.php:62
Stack trace:
#0 [internal function]: Magento\Framework\App\ErrorHandler->handler(8192, 'preg_replace():...', '/chroot/home/mt...', 222)
I hit the same issue but on a different case. I have magento 2.4.5. When trying to rollback my database I got this: Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/xxxxxxx/vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222
This breaks the rollback of the database so I think is critical. At the moment I cannot restore my database! Any suggestions?
Preconditions and environment
Steps to reproduce
1- Go to category page 2- Choose a product and go to product page (not all products)
Expected result
No error
Actual result
Exception #0 (Exception): Deprecated Functionality: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /vendor/magento/zendframework1/library/Zend/Db/Statement.php on line 222
Additional information
Possible solution:
Need to add this check after each
preg_replace
call i.e.210
&222
. The simplest way to reproduce this issue is by setting$sql
asnull
and then runningbin/magento setup:upgrade
command. The below error will occur:Release note
No response
Triage and priority