You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
I'd suggest putting this check behind a flag because I'm pretty sure there are many use cases where linting happens at a time where not all env vars are available. Up for a PR?
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
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
The text was updated successfully, but these errors were encountered: