Skip to content

[FrameworkBundle] lint:container should check if referenced env variables exist #58105

@ostrolucky

Description

@ostrolucky

Description

It's common mistake in our teams to define environment variable for one environment (eg. staging), but not the other (eg. production). Deploying such application with such configuration works and even most of the routes, but once one of the route needs service that requires the env var, at that point things blow up with this error

Noticed exception 'Symfony\Component\DependencyInjection\Exception\EnvNotFoundException' with message 'Environment variable not found: "PM_DC_TOKEN".' in /srv/api/vendor/symfony/dependency-injection/EnvVarProcessor.php:221

So I thought one neat way how I can avoid such issues in future is to add CI job which runs bin/console lint:container - both during CI run and during deployment, however this command does not complain about this. I'm wondering what else I can do?

symfony version I use: 7.1.3

Example

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy