-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[Windows] White spaces in environment variables' names prevent containers from starting #15251
Comments
hi @javakhishvili thanks for the report ... it seems odd that the existence of just having an application installed would break things ... you are not even running the container with intelli j ... does the application inject environment variables for all sessions? |
It indeed does. IntelliJ Idea adds the variable to the user's profile. Fun fact: running a container from within IntelliJ works just fine. Perhaps, it uses the API calls directly. |
@n1hility PTAL |
@baude cool thanks |
Ok, investigated this. I clean installed windows and then intelli idea. When running a container, I did not observe any failure. I also could not find any variable related to intellij. Is it possible you might be using an older version by chance? In Linux, environment variable 'keys' are not allowed to have spaces by definition. Perhaps windows does allow this, but when interacting with Podman machine (which is Linux), this will most certainly crash things. @javakhishvili any ideas here? |
Hey @baude There's an easier way to reproduce this issue, though. Check this out:
Now we have a compatibility issue between Windows (white spaces are allowed in env var keys) and *nix (no whites paces are allowed). So we can't pass such variables to the Linux VM. Would it make sense to emit a warning and filter out such variables instead? |
Looks like Podman is examining the environment even when it is not using it... But would like to know why we are parsing the users environment. |
I'm not sure it should be removed. I'm setting up a better windows dev environment so i can get a better look. It might be a case of being aggressive with checking the formats. And it might be misplaced .. hold tight |
IMO skipping non-mappable Windows env entries as @javakhishvili suggests is probably the right approach. If someone is passing an env into a container, then they need to conform to the posix/unix/linux requirements anyway, so no harm done there. |
The weird thing here from his example is he was not passing the environment into a container? From @javakhishvili example it looks like Podman is examining the users environment regardless if it is using it in a container, or am I mistaken. |
@rhatdan You're right. It doesn't depend on whether the var is passed to a container or not. |
Fixes: containers#15251 Signed-off-by: Daniel J Walsh <[email protected]>
Fixes: containers#15251 Signed-off-by: Daniel J Walsh <[email protected]>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
podman run
errors out if there is a host environment variable defined with a white space in its name.Steps to reproduce the issue:
Install IntelliJ Idea
Try running a container
Describe the results you received:
Describe the results you expected:
Although personally I wouldn't use white spaces in my environment variables' names, apparently it is a valid scenario in Windows. Such variables should not prevent podman from starting containers.
Output of
podman version
:Output of
podman info
:Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
Yes
Additional environment details (AWS, VirtualBox, physical, etc.):
A physical Windows box with IntelliJ Idea installed.
The text was updated successfully, but these errors were encountered: