Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Dotenv] Fatal error for valid environment variable syntax. #31530

Copy link
Copy link
Closed
@dspiegel

Description

@dspiegel
Issue body actions

Symfony version(s) affected: 4.2.8

Description
Dotenv returns error for valid environment variable syntax.

How to reproduce

  1. Add variable to .env like FOOBAR="${FOOBAR:=production}"
  2. Run ./bin/console cache:clear

Error:
Script cache:clear --no-warmup --env %PUBLIC_DIR% returned with error code 255
Fatal error: Uncaught Symfony\Component\Dotenv\Exception\FormatException: Unclosed braces on variable expansion in "/export/home/dave/Projects/iprd/4.2/iprd-tools/.env" ...${SYMFONY_ENV:=dev}

Bash test of .env file works as expected
$ unset FOOBAR
$ . .env
$ echo $FOOBAR
production

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.