-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DI] ServiceContainer build error after upgrading to 4.1.4 #28296
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
Comments
Hello, thanks for the report. |
Hello. |
We have this problem in 3.4.15, I'll check if I can work out a small reproduction too. |
@nicolas-grekas seems its indeed caused by #28060 for some service definitions with method-calls this condition + continue here now prevents them from being added to https://github.com/symfony/symfony/pull/28060/files#diff-f7b23d463cba27ac5e4cb677f2be7623R509 So they are not dumped here: Which leads to the Exception. Unfortunately I don't fully understand all that logic so I cannot fix it 😄 🙈 |
Also have some issue. if services have calls method but are public: false, it throw exception. |
Can confirm, that a simple |
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
It looks like |
|
It fixes my original problem. I'm just not sure, that adding a new dependency is the right way to fix a bug introduced in a patch release. |
You no longer see the "Cannot dump ..." error? Did you in-fact also remove the DI 4.1.3 instance, allowing update back to 4.1.4? |
@hal869 yes, it fixes my demo repository here: https://github.com/mmarton/symfony-di-error-poc
|
well, then, hm :-/ still 'here', clearly. poking around for 'why' ... p.s.
generally agree |
I can confirm that requiring symfony/proxy-manager-bridge fixes the issue. |
https://github.com/hal869/symfony-28296.git
and
|
I cannot confirm that
PHP config:
|
Thanks to the reproducer, I managed to reduce the reproducer to a config like: services:
foo:
class: c
public: true
arguments:
- '@bar'
- !service
class: c
properties:
p: !service
class: c
properties:
p: !service
class: c
bar:
class: c
public: true
properties:
p: !service
class: c
arguments: ['@foo'] Indirectly related to proxy-manager indeed. On it now... |
Can you please report if applying #28366 fixes your issue? |
|
@hal869 this must be related to some issue when applying the patch. |
This PR was merged into the 3.4 branch. Discussion ---------- [DI] Fix dumping some complex service graphs | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28296 (and its duplicates #28355 & #28362 ~+ possibly #28304~) | License | MIT | Doc PR | - Commits ------- 769fd4b [DI] Fix dumping some complex service graphs
didn't worked for me, I blacklisted the
See liip/LiipFunctionalTestBundle#448 for an example. |
I'm using Symfony 3.4 and this do not solved my problem. I have no service with this properties, but i keep getting the error: In PhpDumper.php line 1761:
Cannot dump definitions which have method calls. I'll keep on 3.4.14. |
This is solved but not tagged. |
I have this very same problem. I donwgraded to the |
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
…y/symfony#28296 that causes application build to fail
Symfony version(s) affected: 4.1.4
Description
After upgrading to v4.1.4 the following error shown when container tries to build.
RuntimeException Cannot dump definitions which have method calls.
Tace
RuntimeException Cannot dump definitions which have method calls. [Symfony\Component\DependencyInjection\Exception\RuntimeException] Cannot dump definitions which have method calls.Exception trace:
Symfony\Component\DependencyInjection\Dumper\PhpDumper->dumpValue() at /var/www/html/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:614
Symfony\Component\DependencyInjection\Dumper\PhpDumper->addServiceMethodCalls() at /var/www/html/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:516
Symfony\Component\DependencyInjection\Dumper\PhpDumper->addServiceInlinedDefinitions() at /var/www/html/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:792
Symfony\Component\DependencyInjection\Dumper\PhpDumper->addService() at /var/www/html/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:827
Symfony\Component\DependencyInjection\Dumper\PhpDumper->addServices() at /var/www/html/vendor/symfony/dependency-injection/Dumper/PhpDumper.php:194
Symfony\Component\DependencyInjection\Dumper\PhpDumper->dump() at /var/www/html/vendor/symfony/http-kernel/Kernel.php:704
Symfony\Component\HttpKernel\Kernel->dumpContainer() at /var/www/html/vendor/symfony/http-kernel/Kernel.php:541
Symfony\Component\HttpKernel\Kernel->initializeContainer() at /var/www/html/vendor/symfony/http-kernel/Kernel.php:123
Symfony\Component\HttpKernel\Kernel->boot() at /var/www/html/vendor/symfony/framework-bundle/Console/Application.php:65
Symfony\Bundle\FrameworkBundle\Console\Application->doRun() at /var/www/html/vendor/symfony/console/Application.php:145
Symfony\Component\Console\Application->run() at /var/www/html/bin/console:39
possibly BC break
possibly caused by: #28060
(or maybe i missed something and used it wrong)
How to reproduce
I have a monolog handler that requires EntityManagerInterface and a doctrine EventSubscriber that needs the monolog logger with the handler. It works fine when I downgrade to symfony/dependency-injection to v4.1.3
Files that requre to reproduce:
src/Monolog/DoctrineDBHandler.php
src/EventSubscriber/DoctrineLogSubscriber.php
config/services.yaml
config/packages/dev/monolog.yaml
The text was updated successfully, but these errors were encountered: