Closed msyhr closed 4 years ago
@krisdass I think it shouldn't be required, but definitely let us know if it is
@ihor-sviziev : since this was reported by many people, I think we need to do something properly about this.
Could we maybe add the following to the composer.json
file?
"conflict": {
"ext-psr": "*"
},
@hostep good point, but I hope it will be fixed on the php extension side soon, so it will not be correct. Let's wait at least for some response. PS: issue already reported https://github.com/jbboehr/php-psr/issues/78
@ihor-sviziev Even if it is fixed on the extension level, there will be instances that could not/will not upgrade that easily. Could we at least update documentation (https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements-tech.html) and add another note that "specific version XX.XX of extension PSR can caused issue"?
Hi @ihor-sviziev, I was able to set the project and run commands after disabling php psr module. I will check & update about codesiffer & code beautifier tool output !
Thanks @ihor-sviziev
:white_check_mark: Confirmed by @ihor-sviziev
Thank you for verifying the issue. Based on the provided information internal tickets MC-38918
were created
Issue Available: @ihor-sviziev, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.
I created PR for updating docs in order to highlight that psr
php extension might cause such issues.
https://github.com/magento/devdocs/pull/8185
Hi @ihor-sviziev. Thank you for working on this issue. Looks like this issue is already verified and confirmed. But if you want to validate it one more time, please, go though the following instruction:
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
.Ok... we got responce from the author of psr
extension, seems like PHP 7 API isn't supporting default values, so it can't be fixed for php 7.3 and php 7.4, but could be fixed for php 8.0, and it will be done in https://github.com/jbboehr/php-psr/pull/79.
So currently we have three options:
psr
php extension with Magento 2 to the docs - I already did in https://github.com/magento/devdocs/pull/8185, hope someone will review it soonpsr
extension in the magento2For now I think adding just a warning to the docs should be enough, I still thinking about implementation of 2nd or maybe 3rd option.
@zenfork and any others using Devilbox running into this issue, I can confirm disabling the psr extension solves the issue.
You'll need to edit the entry to add "psr" in the .env of your devilbox root.
PHP_MODULES_DISABLE=oci8,PDO_OCI,pdo_sqlsrv,sqlsrv,rdkafka,swoole,psr,phalcon
Hey. I have a question. Why we need create proxy for LoggerInterface object? What this profit we have from this "optimization"?
Maybe make sense remove proxy from DI class and this is fix problem in install.
@pusachev TBH I don't really know. Feel free to investigate it 😃
This issue is also related to an upgrade
:
2.3.4 -> 2.4.0
2.3.5 -> 2.4.0
2.3.6 -> 2.4.0
and the same with upgrade to 2.4.1
@qsolutions-pl FYI we added info that psr
extension causing issue to the docs in https://github.com/magento/devdocs/pull/8185:
https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html
@pusachev @ihor-sviziev I bumped into this same issue and was able to solve it by removing the PSR extension (Ubuntu with PHP 7.3: apt-get remove php7.3-psr
).
However, the question of @pusachev intrigued me: Why is the proxy needed in the first place?
I tried it and this gave the error Circular dependency: Magento\Framework\Logger\Monolog depends on Magento\Framework\Interception\PluginListGenerator
. In other words, the reason why a DI proxy is needed is to fix the circular dependency at constructor time, while at the moment a method of PluginListGenerator
is called where logging is needed, this issue is fixed already. So, there is no (easy) way to remove the proxy itself.
@jissereitsma I believe the only one valid fix will be introducing some not dynamically created logger proxy with the same logic inside
Hi @msyhr, @ihor-sviziev, @engcom-Delta.
Thank you for your report and collaboration!
The related internal Jira ticket MC-38918
was closed as Complete
.
The fix will be available with the upcoming 2.4.3
release.
@sidolov @sivaschenko @gabrieldagama i don’t see any commits related to internal ticket if using search https://github.com/magento/magento2/search?q=MC-38918&type=commits . Could you please provide us some info how we can find the fix ?
Hi @ihor-sviziev, this issue was manually closed on our Jira Project because the GitHub one was already closed for some time. Apparently, our bot has added the message about the fix, but, there is no fix.
If this still an issue, please feel free to reopen it!
Thanks!
@gabrieldagama, @sdzhepa: this is really bad behavior of the bot, I've seen this happening a few times before in other tickets. Placing automated comments like these put people at ease, they believe that an issue will actually be fixed if a bot leaves this comment even if we can't find a reference to it in the commits (because we've grown accustomed by now that publishing code to github can sometimes take a few days or weeks even if a ticket is already closed before that happens).
Can you investigate this bot and fix it so it doesn't leave incorrect comments like these anymore in the future?
Thanks!
There was nothing I could do (module:enable etc.) due to this error.
I add to \Magento\Framework\Code\Generator\EntityAbstract::extractParameterDefaultValue before return $value this code
if($this->getSourceClassName() === '\Psr\Log\LoggerInterface' && $parameter->name === 'context') {$value = new ValueGenerator(array(), ValueGenerator::TYPE_ARRAY);}
I got same error , anyone knows how to solve it? Thanks in advance
@ahmedch1 make sure you don't have installed psr php extension. If you have such - please remove it
@jissereitsma great mate your solution works like charm, a dozen thank you
Preconditions (*)
Steps to reproduce (*)
composer create-project --repository=https://repo.magento.com/ magento/project-community-edition magento2
php bin/magento setup:install --base-url=http://241.loc/ --db-host=mysql --db-name=241 --db-user=root --db-password= --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --search-engine=elasticsearch7 --elasticsearch-host=elastic --elasticsearch-port=9200
Expected result (*)
Actual result (*)
Fatal error: Declaration of Psr\Log\LoggerInterface\Proxy::emergency($message, array $context) must be compatible with Psr\Log\LoggerInterface::emergency($message, array $context = NULL) in /shared/httpd/24/htdocs/magento2/generated/code/Psr/Log/LoggerInterface/Proxy.php on line 93
The proxy generated has functions like below:public function alert($message, array $context)
However, if you change them directly to:
public function alert($message, array $context = array())
The command will then run successfully, however it will break all bin/magento setup:xxx commands the next time the code is regenerated.