Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accents in unquoted environment variables with spaces cause Compose v2 to fail #8741

Closed
jpetazzo opened this issue Oct 4, 2021 · 5 comments
Labels

Comments

@jpetazzo
Copy link

jpetazzo commented Oct 4, 2021

Description

In a .env file, if there is a variable with a space, no quotes, and accents in the word(s) after the space, Compose refuses to start, with an error like the following one:

unexpected character "©" in variable name near "café\n"

Steps to reproduce the issue:

Create the following files:

mkdir -p /tmp/compose-v2-envaccents
cd /tmp/compose-v2-envaccents

cat >docker-compose.yml <<EOF
version: "3"

services:
  env:
    image: alpine
EOF

cat >.env <<EOF
WHAT=Pause café
EOF

Then docker-compose up.

Describe the results you received:

With Compose v1, it works correctly.

With Compose v2, I get the following error message and Compose refuses to start the stack:

unexpected character "©" in variable name near "café\n"

Describe the results you expected:

Stack starts correctly.

Additional information you deem important (e.g. issue happens only occasionally):

Note that this only happens when the accents are AFTER the space, and if the variable is NOT quoted.

Output of docker compose version:

Docker Compose version v2.0.1

Similar or related issues:

This could be related to #8626 and/or #8740, which are also related to .env parsing in Compose v2.

However, since it's a different error behavior altogether, I'm opening a separate issue to make sure it's tracked properly.

Thanks!

@nigurr
Copy link

nigurr commented Oct 4, 2021

+1 Any environment variable value with space is broken.
Surprised to see such regression

@ulyssessouza
Copy link
Collaborator

Seems related to #8763

@solvaholic
Copy link

Surprised to see such regression

See also #8507

@stale
Copy link

stale bot commented May 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 2, 2022
@stale
Copy link

stale bot commented Jun 12, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants