redhat-developer / redhat-developer/vscode-openshift-tools
Unable to set PATH on remote for `oc` / `openshiftToolkit.searchForToolsInPath=true` ignored?
@vrubezhny is already working on this.
Since Jul 9, 2025.
- Dominant language
- TypeScript
- Stars
- 123
- Forks
- 63
- Avg merge
- 6h 16m
- Merged PRs (30d)
- 74
Description
Type: Bug
Describe the bug
On a (old) remote EL7 system, bundled oc is failing (due to glibc version), but while a working oc is present in the PATH (set in shell rc files), it is ignored. This might correlate with https://github.com/redhat-developer/vscode-openshift-tools/issues/3405#issuecomment-1751037960 and be related to https://github.com/redhat-developer/vscode-openshift-tools/issues/4555.
After digging a bit before submitting this issue, it seems that when using Remote SSH, the PATH is not properly set from the rc/profile machinery, the default SSHd-given path is used, and I cannot find a way to alter the PATH as user (either by using ssh config or vscode config ; https://code.visualstudio.com/docs/supporting/faq#_resolving-shell-environment-fails seems to be only valid on local instances).
$ cat /proc/(vscode-pid)/environ | tr '\0' '\n' | grep PATH
PATH=/usr/local/bin:/usr/bin
Maybe a path for each binary could be added in settings, like for crc, or a more generic PATH-like setting could be added, to prepend the startup PATH with the provided value?
"openshiftToolkit.toolsPath": "/user/path1:/user/path2"
-> PATH="/user/path1:/user:path2:$PATH"
Expected Behavior
Extension tries to use PATH-installed oc
Current Behavior
Extension uses bundled oc and fails
Steps to Reproduce
- Work on a old EL7 remote ssh vscode, with openshifttoolkit extension installed, put a working
ocin PATH - Set
Openshift Toolkit: Search For Tools In Path (Force extension to search for `oc` and `odo` CLI tools in PATH locations before using bundled binaries.)to true ("openshiftToolkit.searchForToolsInPath": true) - Try to connect to a cluster
Logs
"/home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc" version --client
/home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc: /lib64/libc.so.6: version `GLIBC_2.33' not found (required by /home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc)
/home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc: /lib64/libc.so.6: version `GLIBC_2.34' not found (required by /home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc)
/home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc: /lib64/libc.so.6: version `GLIBC_2.32' not found (required by /home/user/.vscode-server/extensions/redhat.vscode-openshift-connector-1.19.0/out/tools/linux/oc)
oc config view -o json
/bin/sh: oc: command not found
Environment
Extension version: 1.19.0
VS Code version: Code 1.98.2
OS version: Win 11 21H2
Modes:
Remote OS version: Linux x64 3.10.x.el7.x86_64
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.