Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle][Cache] Do not process cache aliases that are not present in the container#29384
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
nicolas-grekas commentedNov 30, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I don't think that works: the container in |
allflame commentedNov 30, 2018
@nicolas-grekas You defined default value for pdo here ->scalarNode('default_pdo_provider')->defaultValue('doctrine.dbal.default_connection')->end() and used existing loop that calls |
nicolas-grekas commentedNov 30, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
That default config leads to the creation an alias named Please provide a reproducer if you still think there is a bug - or at least more details. |
allflame commentedNov 30, 2018
@nicolas-grekas I probably can provide a minimal installation on Monday, but I think I'm either missing a point or can't explain myself well. |
nicolas-grekas commentedNov 30, 2018
Everything works when playing with eg the website-skeleton - even without Doctrine. So yes, I don't see the issue right now. Looking forward to your reproducer :) |
allflame commentedNov 30, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Ok, i think I found the problem. <serviceid="cache.default_pdo_provider"alias="doctrine.dbal.default_connection"public="false"/> This will obviously crash if To be clear: I believe that the suggested fix shouldn't be taken as is since I do not know what the initial intention of the feature was, but creating alias to a non-existent service shouldn't be done either. |
nicolas-grekas commentedNov 30, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Do you experience the issue or not? If this is purely theoretical, then you should know there are tons of services that rely on this behavior. Or if it's something that can be reproduced, please, really, describe how you get it. |
nicolas-grekas commentedNov 30, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OH OK! Then that's the issue. There can be way more things that could break with this strategy. services:test.my_service:alias:my_servicepublic:true |
allflame commentedNov 30, 2018
@nicolas-grekas This works if you need to mock couple of them. If you have dozens this is not that good of approach.
but this behavior causes a lot of side effects as well (#29359). |
nicolas-grekas commentedDec 1, 2018
While merging unrelated PRs, one of them made me remind we have a way to deal with such situations. |
allflame commentedDec 1, 2018
@nicolas-grekas Hey, thanks for the update. I do have a workaround by just setting up default_pdo_driver to null in the config though. |
nicolas-grekas commentedDec 1, 2018
Thanks for reporting and for the discussion. |
…only if the package is installed (nicolas-grekas)This PR was merged into the 4.2 branch.Discussion----------[FrameworkBundle] define doctrine as default_pdo_provider only if the package is installed| Q | A| ------------- | ---| Branch? | 4.2| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#29384| License | MIT| Doc PR | -Commits-------cf75012 [FrameworkBundle] define doctrine as default_pdo_provider only if the package is installed
1484117
Introduced a major problem when framework-bundle is used WITHOUT doctrine.
On kernel compilation this results in ServiceNotFoundException: You have requested a non-existent service "doctrine.dbal.default_connection".
This is due to the fact there is no check whether such definition is present in the container
Since there is no clear view as how to handle such a situation (remove default value from configuration or ignore those that are not present) I chose the latter.