Skip to content

Boolean Environment Variable Processor Not Working #45868

@NeuralFramework

Description

@NeuralFramework

Symfony version(s) affected

6.0.4

Description

It is not possible to add boolean values in symfony through the environment variables in the .env file or through the environment variables of the server operating system. Within yaml configuration files it is not possible to assign a string value and be converted to boolean

I have a system generated in kubernetes, in which depending on certain conditions and the different load balancers, values must be assigned to the environment variables to the PODS, in this case some variables are assigned a value "true" or "false" . Internal symfony configurations and some installed bundles require boolean values in the configuration files located in the "config/packages" path.

According to the symfony documentation https://symfony.com/doc/current/configuration/env_var_processors.html it is possible to get the environment variable and give it boolean format

image

Now values have been assigned in the symfony .env file with these parameters and it generates the following error message

image

now we generate several options in the configuration file as shown in the image

image

image

How to reproduce

I have a system generated in kubernetes, in which depending on certain conditions and the different load balancers, values must be assigned to the environment variables to the PODS, in this case some variables are assigned a value "true" or "false" . Internal symfony configurations and some installed bundles require boolean values in the configuration files located in the "config/packages" path.

According to the symfony documentation https://symfony.com/doc/current/configuration/env_var_processors.html it is possible to get the environment variable and give it boolean format

image

Now values have been assigned in the symfony .env file with these parameters and it generates the following error message

image

now we generate several options in the configuration file as shown in the image

image

image

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions