Skip to content
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

Getting "command opensshremotes/opensshremotesexplorer.[COMMAND]' not found #621

Closed
jonstelly opened this issue Jun 9, 2019 · 12 comments
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Milestone

Comments

@jonstelly
Copy link

Ubuntu 19.04 and VS Code installed via Snap, happens on two machines:

Version: 1.36.0-insider
Commit: c089daa858f34631f5f827ff8a0313bf1e2ded6d
Date: 2019-06-07T05:15:26.964Z
Electron: 4.2.3
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Linux x64 5.0.0-16-generic snap

Steps to Reproduce:

  1. Open the Remote SSH Explorer
  2. Click on Configure or Refresh buttons, or try to run any commands >remote-ssh: *
  3. Get an error like command 'opensshremotes.*' not found

I've tried disabling all other extensions and restarting VS Code, still get the same errors. Looking in the developer tools window I see an interesting error (below). I'm logging on via active directory integration roughly following this guide and from some googling it looks like this error seems to happen because there is no user entry in /etc/passwd.

Is there anything I can do to either help collect more data, or some sort of work-around I could try besides logging in as a local user instead of an AD/sssd one?

[Extension Host] Here is the error stack:  SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
	at Object.userInfo (os.js:249:11)
	at Object.<anonymous> (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:1756)
	at n (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:313)
	at Object.<anonymous> (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:32315)
	at n (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:313)
	at Object.defineProperty.value (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:26909)
	at n (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:313)
	at /home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:1112
	at Object.<anonymous> (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:1:1122)
	at Object.<anonymous> (/home/jon/.vscode-insiders/extensions/ms-vscode-remote.remote-ssh-0.42.0/out/extension.js:3:3)
	at Module._compile (internal/modules/cjs/loader.js:693:30)
	at Object.Module._extensions..js (internal/modules/cjs/loader.js:704:10)
	at Module.load (internal/modules/cjs/loader.js:602:32)
	at tryModuleLoad (internal/modules/cjs/loader.js:541:12)
	at Function.Module._load (internal/modules/cjs/loader.js:533:3)
	at Function.define._installInterceptor.i._load (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:487:611)
	at Function.t._load (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:754:268)
	at Function.t.getExtensionPathIndex.then.i._load (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:678:176)
	at Module.require (internal/modules/cjs/loader.js:640:17)
	at require (internal/modules/cjs/helpers.js:20:18)
	at Function.i [as __$__nodeRequire] (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/loader.js:31:381)
	at /snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:740:716
	at I._doActivateExtension (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:740:824)
	at I._activateExtension (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:739:692)
	at I.<anonymous> (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:736:595)
	at Generator.next (<anonymous>)
	at n (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:13:388)
	at new Promise (<anonymous>)
	at n (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:13:165)
	at Object.actualActivateExtension (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:736:297)
	at p._activateExtension (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:476:21)
	at define._activateExtensions.r.length.Promise.all.o.map.e (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:475:628)
	at Array.map (<anonymous>)
	at p._activateExtensions (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:475:616)
	at p._activateExtensions (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:475:675)
	at p.activateByEvent (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:473:477)
	at I._activateByEvent (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:738:329)
	at define.$activateByEvent._readyToRunExtensions.wait.then.t (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:746:516) (at define._activateExtension.s._host.actualActivateExtension.then.t (/snap/code-insiders/167/usr/share/code-insiders/resources/app/out/vs/workbench/services/extensions/node/extensionHostProcess.js:476:223))

Does this issue occur when you try this locally?: Yes
Does this issue occur when you try this locally and all extensions are disabled?: Yes

@da2r-20
Copy link

da2r-20 commented Jun 11, 2019

Also reproduced on:
Version: 1.35.0
OS: OSX 10.14.5

For me, it occurs when the remote machine is no longer accessible
and I cancel the modal "Try to reconnect" window

@cipri-tom
Copy link

I have exactly the same conditions as doronAtuar (same version of VSCode and OSX).

And I also clicked 'Cancel' on the 'Trying to reconnect' modal.
It appears that this crashes the extension, which then invalidates all the commands:

Screenshot 2019-06-11 at 09 38 45

@agimenodev
Copy link

Using archlinux, I have the same issue:

  • Install the extension remote development first time, works.
  • Open another instance of VSC in another project, I don't see the green icon, left-bottom, access through the menu, got command 'opensshremotesexplorer.configure' not found

@roblourens
Copy link
Member

@jonstelly There was a similar issue opened, #579, and the user said

The problem was an outdated nscd cache

I don't know what that means but does that mean anything to you?

@roblourens roblourens added the info-needed Issue requires more information from poster label Jun 19, 2019
@jonstelly
Copy link
Author

I had to go look, but it doesn't look like nscd is installed by default on Ubuntu (not 19.04 at least).

From tracking down what code I could, I'm guessing the remoting extension references:

nodejs os.userInfo()

which calls:

this libuv function (pull request)

to try and get some user info. This is happening on the client (not on the remote host) but this method from libuv won't return anything for my user since my user account is an active directory login using sssd which doesn't have a corresponding local/passwd account.

I can't see the remoting extension code, but it seems like to support non-local logins on Linux, the extensions will need to catch this error and provide some fallback implementation. The data returned is pretty basic stuff:

typedef struct uv_passwd_s {
    char* username;
    long uid;
    long gid;
    char* shell;
    char* homedir;
} uv_passwd_t;

and I wouldn't be surprised if the username is the only thing the extension is interested in, so finding a fallback should be straight forward (I hope! I really want to be able to use this remoting feature from my underpowered laptop).

Let me know if there's any other diagnostic information I can help collect.

@roblourens
Copy link
Member

Thanks for the details, I was expecting this was a Node issue (and the other issue was expressed as a native crash!) but in the Node docs I see

Throws a SystemError if a user has no username or homedir.

So we should handle that on our end.

@roblourens roblourens self-assigned this Jun 19, 2019
@roblourens roblourens added bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH and removed info-needed Issue requires more information from poster labels Jun 19, 2019
@roblourens roblourens added this to the June 2019 milestone Jun 19, 2019
@roblourens
Copy link
Member

Do you not have a home dir? Where is your user .ssh folder?

@jonstelly
Copy link
Author

jonstelly commented Jun 20, 2019

Home is /home/jon, .ssh folder is under there.

Just to validate my assumption I wrote a couple quick tests and it seems my assumption is incorrect. The node os.userInfo() method returns data, so does libuv's uv_os_get_passwd. Maybe the object.userInfo() noted in the stack trace I posted isn't the userInfo method from node? Or maybe it's using an older version of libuv? I tried opening remoting in VS Code again (since I installed the libuv1 package) but am still getting the same behavior

Testing libuv

Requires apt install libuv1-dev

main.c

#include <stdio.h>
#include <stdlib.h>
#include <uv.h>

int main() {
    uv_passwd_t *pwd = malloc(sizeof(uv_passwd_t));

    int ret = uv_os_get_passwd(pwd);

    printf("ret: %d\n", ret);
    printf("uid: %lu\n", pwd->uid);
    printf("gid: %lu\n", pwd->gid);
    printf("username: %s\n", pwd->username);
    printf("homedir: %s\n", pwd->homedir);
    printf("shell: %s\n", pwd->shell);

    free(pwd);
    return ret;
}

Command: gcc main.c /usr/lib/x86_64-linux-gnu/libuv.a -pthread && ./a.out
Output:

ret: 0
uid: 888801111
gid: 888800555
username: jon
homedir: /home/jon
shell: /bin/bash

Testing Node

nodetest.js

var os = require('os');
console.log("Platform: " + os.platform());
console.log("Architecture: " + os.arch());
console.log("Type: " + os.type());
console.log("Release: " + os.release());
console.log("User: " + JSON.stringify(os.userInfo()));

Command: node ./nodetest.js
Output:

Platform: linux
Architecture: x64
Type: Linux
Release: 5.0.0-17-generic
User: {"uid":888801111,"gid":888800555,"username":"jon","homedir":"/home/jon","shell":"/bin/bash"}

@roblourens
Copy link
Member

Thanks for trying that. It does look like if you don't have an entry in /etc/passwd then that method should throw, so I don't know where that info is coming from. Anyway, I can still just get your home dir from the environment variable instead of os.userInfo.

@roblourens roblourens modified the milestones: June 2019, July 2019 Jun 27, 2019
@tecosaur
Copy link

tecosaur commented Jul 19, 2019

I'm also getting this issue (Linux, Solus), is there any short term fix available?
ATM the extension is completely unusable for me.

@roblourens
Copy link
Member

I fixed this to fall back on $HOME, if that is set in your environment, then it should work in monday's nightly build of remote-ssh.

@jonstelly
Copy link
Author

The nightly build fixes my issue, thanks, @roblourens!

@rebornix rebornix added the verified Verification succeeded label Aug 2, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug ssh Issue in vscode-remote SSH verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants