redhat-developer / redhat-developer/vscode-openshift-tools

Unable to set PATH on remote for `oc` / `openshiftToolkit.searchForToolsInPath=true` ignored?

Open
#5,190 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Work on a old EL7 remote ssh vscode, with openshifttoolkit extension installed, put a working oc in PATH
  2. 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)
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.