Skip to content

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

@u1735067

Description

@u1735067

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 #3405 (comment) and be related to #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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions