-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Environemt Variables are not accessible in Maintenance Tasks #159
Comments
Have you confirmed that the environment variables are actually available via the PHP CLI in general? |
I can confirm this issue, the manager currently unsets all environment variables. Long story short, probably something I need to fix :( |
Note to myself: |
same problem here. @DanielSchwiperich have you got a workaround? |
Are there an workaround or any news about that problem? I will need Environment variables in .env in fact of deploying on different stages |
I just like to add another error backtrace related to this issue.
|
@JanMalte this looks like Symfony is not correctly decoding your environment variables, not something about the Contao Manager? |
The usage of Symfony does not escape the env values and it therefor worked in previous contao versions which didn't escaped the values. Source: Documentation: Discussions: |
DSN paths need to be URL encoded. This issue is about environment variables allegedly not being resolved. |
@JanMalte in any case environment variables in the Instead you should use the environment variables directly in your Also, this has nothing to do with the Contao Manager. |
Using Adding a complete Especially when using I'm now using services:
web:
image: contao-project:apache-bundle
volumes:
- ./contao-parameters.yml:/var/www/html/config/parameters.yml
- contao_uploads:/var/www/html/files/uploads/
depends_on:
- db
environment:
- MYSQL_DATABASE
- MYSQL_USER
- MYSQL_PASSWORD
- DATABASE_URL=mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/${MYSQL_DATABASE}
- SECRET_KEY
- MAIL_HOST
- MAIL_USER
- MAIL_PASS
- MAILER_DSN=smtp://${MAIL_USER}:${MAIL_PASS}@${MAIL_HOST} However, the framework:
trusted_proxies: "172.0.1.0/24" |
You misunderstood. The issue is that you are tyring to use environment variables in your parameters.yml. |
Yes, just like explained in the symfony docs: https://symfony.com/doc/current/configuration.html#configuration-based-on-environment-variables Anyway, we don't have to discuss this any further. I just wanted to put the information here in the issue, because I always find it via Google when I stumble across exactly this circumstance in a project. |
The Symfony docs use environment variables directly, they don't use the |
We are using environment variables in the parameters.yml. But the manager is not using / accessing them in for example maintenance tasks.
This is what the paramters.yml looks like (it's a docker dev setup, so no rant about the env name pls 😄 )
When running the rebuilding contao cache weg get
The text was updated successfully, but these errors were encountered: