Skip to content

JetBrains server starts without loading user's bashrc #13815

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

Closed
huweiATgithub opened this issue Oct 12, 2022 · 0 comments · Fixed by #14916
Closed

JetBrains server starts without loading user's bashrc #13815

huweiATgithub opened this issue Oct 12, 2022 · 0 comments · Fixed by #14916
Assignees
Labels

Comments

@huweiATgithub
Copy link

Objective

I ran into an issue when using PyCharm with the workspace-full.
The server-ide started without the initialization steps defined in .bashrc.

Description and how to reproduce

  • Launch any workspace with PyCharm and workspace-full image.

  • Create a python script and run it using PyCharm's run configuration.

    import subprocess
    import os
    
    path_available_to_jb = os.getenv("PATH").split(":")
    print(list(p for p in path_available_to_jb if "java" in p))
    print(subprocess.check_output(['java', "--help"]))
  • Get outputs: empty list for the first print and FileNotFoundError for the subprocess.check_output
    image

  • Navigate to a terminal to print the PATH
    image

Reasons?

Workspace-full install java by sdkman.
As we can see, it makes java available using sdkman's initialization script which is sourced by .bashrc. (.profile also source .bashrc)

How Gitpod adds IDE layers to the user's image and how the server-side ide is launched is not well documented.

I guess the JB server started neither sourcing $HOME/.bashrc nor $HOME/.profile. (non-interactive and non-login?)

Workarounds

One might add the java path into PATH by docker ENV instruction.

However, it might be common that users having some of their initialization in the .bashrc. I don't know if starting the JB server-ide in a well-prepared shell (bash -i or bash -l?) is a good idea.

@huweiATgithub huweiATgithub changed the title Feedback Issue: Jetbrain server starts withou loading user's bashrc Feedback Issue: JetBrains server starts without loading user's bashrc Oct 12, 2022
@gtsiolis gtsiolis changed the title Feedback Issue: JetBrains server starts without loading user's bashrc JetBrains server starts without loading user's bashrc Nov 21, 2022
@akosyakov akosyakov self-assigned this Nov 24, 2022
@akosyakov akosyakov moved this to In Progress in 🚀 IDE Team Nov 24, 2022
Repository owner moved this from In Progress to Done in 🚀 IDE Team Nov 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants