Skip to content

Misconfigured environment is hard to debug #40071

Closed
@BackEndTea

Description

@BackEndTea

Symfony version(s) affected: 5.2

Description
When the environment (either when passing it with --env in CLI, or the APP_ENV env variable), is an empty string, a hard to debug error comes up:

In BaseNode.php line 340:
                                                                                                                  
  Configuration path "security.access_control" cannot be overwritten. You have to define all options for this path, and any of its sub-paths in one configuration section.             

How to reproduce

On a fresh symfony project run:

bin/console --env=''

When a non existing environment is provided, everything works 'normally'. The error only occurs if the environment is empty. e.g.

bin/console --env='foo'

Possible Solution

Detect an empty environment as a bug, and report it to the user.

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