Closed Nuranto closed 2 years ago
Hi @Nuranto. 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
i think we should report here https://github.com/magento/data-migration-tool/issues
Similar to this https://github.com/magento/magento2/pull/35596 which affects integration tests
Hi @engcom-November. 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.
Hi @Nuranto , Thank you for reporting and collaboration. Verified the issue by upgrading from 2.4.3-p1 to 2.4.4 but could not able to reproduce the issue. Steps performed:
you need install monolog v2.7.0 to able see problem
Thanks for the update @mrtuvn However, monolog is not part of https://github.com/magento/magento2 git repository. Community cannot able to provide fix for it in this repository. As per Magento devdocs, Magento uses Monolog by default. Monolog implemented as a preference for Psr\Log\LoggerInterface in the Magento application di.xml Kindly refer this guide to use the same for logging. Otherwise all questions, issue reports and fix for them should be addressed to the corresponding extension owners(support) Thank you.
@engcom-November
The facts
^2.6
of monolog, which means that 2.7.0 is the highest version that is installed when you composer create project
of magento https://github.com/magento/magento2/blob/28c1f28a2552de69158b40d1eaf84e45430c16f9/composer.json#L69<=2.7.0
for their monolog requirement, or fix their application code to be compatible.Either way there is an action for magento here, when you build a version of latest magento from scratch you will pull in a monolog version incompatible with some magento code.
The maintainer of monolog thinks the implementations by magento in the data migration tool and the integration test infrastructure is, and i quote, "madness".
See https://github.com/Seldaek/monolog/issues/1684#issuecomment-1152874168 and also see https://github.com/magento/magento2/pull/35596#issuecomment-1153655914 where this issue affects the ability to run tests, the thing that ensures we are able to deliver robust software.
Verified the issue again by installing Magento 2.4.4 project-community-edition with PHP 8.1 but could not able to reproduce the issue with below steps performed:
@engcom-November this issue i think you may also need to install https://github.com/magento/data-migration-tool#install-the-data-migration-tool
For my PR (#35596) to replicate you would need to run the integration tests but best to keep separate as they'd be separate codefixes :)
Verified the issue again on Magento 2.4.4 Project community edition with PHP 8.1.6 and the issue is reproducible on installing data-migration-tool. Error: PHP Fatal error: Declaration of Migration\Logger\Logger::addRecord(int $level, string $message, array $context = []): bool must be compatible with Monolog\Logger::addRecord(int $level, string $message, array $context = [], ?Monolog\DateTimeImmutable $datetime = null): bool in /var/www/html/mg244/project-community-edition/vendor/magento/data-migration-tool/src/Migration/Logger/Logger.php on line 34
This also occurs with PHP 7.4...
Confirming that composer require monolog/monolog:2.6.0
fixed the issue.
:white_check_mark: Jira issue https://jira.corp.magento.com/browse/AC-5973 is successfully created for this GitHub issue.
:white_check_mark: Confirmed by @engcom-November. Thank you for verifying the issue.
Issue Available: @engcom-November, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
Also reproducible when you run integration tests.
https://github.com/Seldaek/monolog/commit/3cba75ec0926eec177a4a2cd6c977ecddd0fc7c1
Mark Logger https://github.com/Final to discourage extension
Updating to use a handler seems like the right thing to do.
Just a notification that a further update to Monolog versions occurred ~3 hours ago - 2.8.0
https://github.com/Seldaek/monolog/releases/tag/2.8.0.
I had code like:
composer require monolog/monolog:"!=2.7.0" --no-update
Which I now changed to:
composer require monolog/monolog:"<2.7.0" --no-update
Looks like in Magento 2.4.5 we have a fix for this issue https://github.com/magento/magento2/commit/360fd1ba9d6e67185b7fbd3e00223cd948bb896e
The full AC-3556 fix is here: https://github.com/magento/magento2/commit/b2bfd0562c3ea5708fb836347404ce38b57040c4
Unfortunately the fix seems just like a workaround, because this problem might happen again in the future. It's probably wiser if Adobe listens to the recommendations of the author of the monolog library who suggests a more future proofed way to fix this.
Agreed @hostep
I did try and have some conversation about this back in June but was ignored.
https://github.com/magento/magento2/pull/35596#issuecomment-1153655914
My workaround was then taken in any case 🙃
Hi there,
I think you missed this one : vendor/magento/data-migration-tool/src/Migration/Logger/Logger.php
Hello,
As I can see this issue got fixed by the internal team Related commits: https://github.com/magento/magento2/commit/b2bfd0562c3ea5708fb836347404ce38b57040c4
Hence closing the issue.
Thanks
Preconditions and environment
Steps to reproduce
Expected result
Everything works fine
Actual result
Additional information
Monolog 2.7.0 has bee released yesterday, and have breaking changes.
Quick Solution : fix dependency to 2.6.0 Best Solution : fix compatibility issues
Note that everyone who upgrades to 2.4.4 from now will probably have this issue.
Quick solution for devs who don't want to wait for a fix & release :
composer require monolog/monolog:2.6.0
Release note
No response
Triage and priority