Closed kiwicommerceltd closed 2 months ago
Hi @kiwicommerceltd. Thank you for your report. To speed up processing of this issue, 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@magento I am working on this
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.
@kiwicommerceltd, I think your file setup/src/Magento/Setup/Console/Style/MagentoStyle.php
is outdated. It should have ProgressBar
declared as return type in Magento 2.4.7-p2, but that doesn't seem to be the case for you.
I suspect that the composer file marshalling failed and you are left with old files from an older Magento version in setup/src
.
Can you try the following?
rm -R vendor/magento/magento2-base/
composer install
And see if that solves it? It should overwrite the files in setup
with the correct files in theory.
@hostep That is not the case actually because the deployment is going through the pipeline, so while upgrading Magento the fresh code getting pulled
Sorry, but that's the only explanation I have, can you please double check?
This is how the file should look in 2.4.7-p2: https://github.com/magento/magento2/blob/2.4.7-p2/setup/src/Magento/Setup/Console/Style/MagentoStyle.php#L322, note that it has a return type defined : ProgressBar
According to your error message, your file is missing the return type definition. Which is how the file was in for example Magento 2.4.6-p7 and earlier versions: https://github.com/magento/magento2/blob/2.4.6-p7/setup/src/Magento/Setup/Console/Style/MagentoStyle.php#L322
So please double check, I think something is going wrong in your deploy pipeline then?
@hostep The issue has been resolved now, I completely removed the setup folder and replaced This works for me. Thanks for your suggestions that helped me
Preconditions and environment
Steps to reproduce
Upgrade to Magento 2.4.7-p2 PHP version 8.1.29 composer install bin/magento setup:di:compile
Expected result
Compile command executed successfully
Actual result
Fatal error: Declaration of Magento\Setup\Console\Style\MagentoStyle::createProgressBar($max = 0) must be compatible with Symfony\Component\Console\Style\OutputStyle::createProgressBar(int $max = 0): Symfony\Component\Console\Helper\ProgressBar in /home/web/build/setup/src/Magento/Setup/Console/Style/MagentoStyle.php on line 322
Additional information
No response
Release note
No response
Triage and priority