-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
DATABASE_URL gets corrupted when the container is compiled #36510
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
That's because of #34757. There is a combination of criteria that are required to hit this, which you listed. The extra compiler pass is the thing nobody does, which explains why this has not been reported before. I don't know how to detect this situation. Any idea anyone? |
Thanks for the quick response. I also managed to reproduce locally now. The compiler pass was a requirement specific to this project, but I don't think it's important in the end. You could have a similar value in any parameter (not environment variable) and get the same bug, is that correct?
No idea at all for me. |
Same issue leading to another corrupted argument: #37150 |
I have just written a reproduce-script for my other issues (#37150) but i guess it could also be used for this. This issue also affects version My thoughts for a possible solution: It appears that the The only other way to fix this (that comes to mind right now) would be to flag the services or arguments as "this is not a folder, do not change this!" explicitly. That would probably be a way safer method of dealing with this problem, but it has two downsides: a) The user has to know about this flag beforehand and b) It introduces some extra complexity in comparison with the other solution above. I don't think that there is an absolute way of detecting this situation safely without the user explicitly choosing whether to replace or not for every instance, simply because symfony cannot know the intended use of a value beforehand. |
Please check #37275 |
…tives (nicolas-grekas) This PR was merged into the 3.4 branch. Discussion ---------- [DI] tighten detection of local dirs to prevent false positives | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #36510 and #37150 | License | MIT | Doc PR | - Commits ------- b746dd9 [DI] tighten detection of local dirs to prevent false positives
Symfony version(s) affected: 4.4.* or 5.0.* -> I upgraded from 4.3 and this bug appeared.
Description
Given an environment variable like this:
The connection to the database fails. After investigation, I can see that the string gets transformed into the compiled container to something like this:
I suspect this is somehow related to #12784 (which is 6 years old, so not directly related).
How to reproduce
What is interesting about this project
/root
(or you could replaceroot
with anything I guess)The
Kernel
class has this addition that inlines the value of environment variables:Possible Solution
Additional context
Doctrine config:
The text was updated successfully, but these errors were encountered: