Skip to content

Environemt Variables are not accessible in Maintenance Tasks #159

@DanielSchwiperich

Description

@DanielSchwiperich

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 😄 )

parameters:
    database_host: db
    database_port: 3306
    database_user: root
    database_password: '%env(DEFAULT_PASSWORD)%'
    database_name: '%env(PROJECT_NAME)%'
    secret: ...

When running the rebuilding contao cache weg get

[Symfony\Component\DependencyInjection\Exception\EnvNotFoundException]  
  Environment variable not found: "DEFAULT_PASSWORD".                     
                                                                          

--------------------------------------------------------
Exception occured: The command "/usr/local/bin/php '-q' '/var/www/share/project/vendor/bin/contao-console' 'cache:clear' '--env=prod' '--no-warmup'" failed.
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions