containers icon indicating copy to clipboard operation
containers copied to clipboard

Custom environment variables not exported in true SSH

Open jonbesga opened this issue 1 year ago • 6 comments

After creating a pod and specifying some environment variables. I can see how these variables are accessible from the Basic SSH and the JupyterLab Terminal. However, when doing "True SSH" these environment variables are nowhere to be seen

To reproduce

Environment variable specified in the Pod configuration:

image

Running echo $HF_TOKEN from the JupyterLab terminal or the Basic SSH will output the value.

Running echo $HF_TOKEN from the "True SSH" terminal will return an empty value

jonbesga avatar Sep 24 '24 09:09 jonbesga

+1 - getting same issue

aidando73 avatar Mar 23 '25 03:03 aidando73

Any news ?

JacopoBandoni avatar Jun 13 '25 09:06 JacopoBandoni

I'm also having this issue, no sign of my envs when using vscode remote which requires "true ssh" :(

tristanryerparke avatar Jun 20 '25 18:06 tristanryerparke

Hi, I ran into the same issue. Temporary workaround: adding the RUNPOD_ prefix (e.g. RUNPOD_HF_TOKEN). Vars without the prefix don’t show up, but the prefixed one is available in True SSH. Tested in a custom template based on runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04; I haven’t verified it on other images yet. Hope this helps!

sbite0138 avatar Jul 11 '25 13:07 sbite0138

It seems that there was a fix mentioned above merged two months ago. However, I am still encountering the problem.

leimao avatar Oct 08 '25 18:10 leimao

Hi, I ran into the same issue. Temporary workaround: adding the RUNPOD_ prefix (e.g. RUNPOD_HF_TOKEN). Vars without the prefix don’t show up, but the prefixed one is available in True SSH. Tested in a custom template based on runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel-ubuntu22.04; I haven’t verified it on other images yet. Hope this helps!

@sbite0138 Thanks for your suggestion. Your proposed workaround does not work for my custom template via True SSH. The environment variables are visible via "Fake" SSH though.

leimao avatar Oct 09 '25 00:10 leimao

Just in case this helps anyone: I run source /etc/rp_environment before using any commands that might need environment variables, which seems to do the trick in my "true SSH" connections. Not sure why these are not sourced automatically.

For reference, I'm using the runpod/pytorch:1.0.2-cu1281-torch280-ubuntu2404 image.

Muesli1 avatar Nov 29 '25 23:11 Muesli1

You shouldn't have to do that at all, which is just a little confusing. Are you still seeing problems with this, if so, can you please specific exactly what image or template id your pods were deployed with?

DeJayDev avatar Dec 15 '25 20:12 DeJayDev