-
Notifications
You must be signed in to change notification settings - Fork 345
commands don't work because of no PATH variable in docker images #437
Comments
I've seen the this behavior as well, with containers built with the latest theia. Oddly, my theia terminals are fine on a fresh container, but after a while new terminals have a badly truncated $PATH. Here's a session in a new terminal:
So, from the above I can see the $PATH is correct in the |
@dukengn could you please try to reproduce this issue? You can fetch one of the image mentioned from dockerhub. e.g.: |
I tried briefly with the |
I can not reproduce this issue on my side as well. Tried with Edit: I also tried with the |
Could you share any extra details you may remember? On which OS is your host, and how do you start your containers? |
My setup is fairly unusual; I've continued investigating this issue, and my best guess is that something's going wrong with the system |
... continuing to investigate, I believe I was wrong about any involvement with /etc/profile or /etc/bashrc, neither of which would be invoked by calling just
I'm at a loss on how to further troubleshoot this. In case it helps, here are the container files used to create my image:
The final container runs the
As expected, the robot says "My PATH is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/robot/go/bin:/usr/local/go/bin:/opt/gopherbot" Is there something I can do to help track this down? |
Hello, I have changed my docker-compose.yml file to use the latest theia-python image. I'm running on debian buster and docker 19.03.12 This is how i run the container
|
I really have no idea why that happens. Here's an interesting, related area in the code. https://github.com/eclipse-theia/theia/blob/master/packages/terminal/src/node/shell-process.ts#L42 function setUpEnvVariables(customEnv?: { [key: string]: string | null }): { [key: string]: string } {
const processEnv: { [key: string]: string } = {};
const prEnv: NodeJS.ProcessEnv = process.env;
Object.keys(prEnv).forEach((key: string) => {
processEnv[key] = prEnv[key] || '';
});
if (customEnv) {
for (const envName of Object.keys(customEnv)) {
processEnv[envName] = customEnv[envName] || '';
}
}
return processEnv;
} From what I understand, the shell process associated to the terminal starts with the exact same environment as its parent process, the Theia backend process - the entries are copied one-by-one above. There's a provision for adding custom environment variables, that I assume is unused by default. Oh, looking at the code made me think of one thing: make sure you do not have something funky defined in this preference: |
Closing according to feedback from issue creator @solipsist01 confirming this no longer happens in our vanilla images. |
I am having the same issue with my image which is a slight variation of the official one.
works fine for a bit, and then the path is broken with all the symptomps above.
I have a suspicion this is caused by the golang extension, I have the broken version up and running now, tell me if you want me to run any commands for debugging. Cheers |
Hi @alekc , Thanks for the detailed problem report. We are looking into it. |
This issue is related to issue eclipse-theia/theia#9392, The description of the problem is very detailed. |
Perhaps it's me, but the latest docker images don't have a default PATH in the terminal
I have tested this with the theia-full and theia-python images.
commands like ls or cat don't work in the terminal. I have to set the path manually.
for now i have pulled theiaide/theia-python:1.6.0-next.e36195e0 and here path works as expected
The text was updated successfully, but these errors were encountered: