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

Remote Containers system error uv_os_get_passwd #6913

Closed
mcw8d opened this issue Jul 8, 2022 · 25 comments · Fixed by devcontainers/cli#84
Closed

Remote Containers system error uv_os_get_passwd #6913

mcw8d opened this issue Jul 8, 2022 · 25 comments · Fixed by devcontainers/cli#84
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug containers Issue in vscode-remote containers verified Verification succeeded
Milestone

Comments

@mcw8d
Copy link

mcw8d commented Jul 8, 2022

Attempting to use the 'Remote-Containers: Clone Repository' commands results in an error dialog with the following text:

Command 'Remote-Containers: Clone Repository in Named Container Volume...' resulted in an error (A system error occurred (A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)))

This is happening with Remote-Containers version 0.241.3 and the pre-release 0.242.0. When I roll back to version 0.238.3 everything works as expected. This is affecting a number of folks on my team with similar local OS versions.

  • VSCode Version: 1.69.0
  • Local OS Version: Ubuntu 20.04
  • Remote OS Version: CentOS-7
  • Remote Extension/Connection Type: Containers
  • Logs: Does not appear to get to a point where a log is generated. If I use Remote-Containers: Show Previous Log I get the log for when I rolled back to Remote-Containers 0.238.3 and the container started as expected.

Steps to Reproduce:

  1. Press F1 to open the command palette.
  2. Select 'Remote-Containers: Clone Repository in Named Container Volume' or 'Remote-Containers: Clone Repository in Container Volume'
  3. An error dialog immediately pops up

Does this issue occur when you try this locally?: Yes I removed my docker.host setting and it still happens

@github-actions github-actions bot added the containers Issue in vscode-remote containers label Jul 8, 2022
@chrmarti chrmarti self-assigned this Jul 11, 2022
@chrmarti
Copy link
Contributor

Looks like nodejs/node#25714. We need to handle that.

@chrmarti chrmarti added this to the June 2022 Recovery milestone Jul 11, 2022
@thebestnom
Copy link

thebestnom commented Jul 11, 2022

Revert to 0.238.3 fixed for you too @mcw8d ?

@thebestnom
Copy link

@chrmarti it doesn't seem to be for the same reason as it\s happens on the local vscode and not on the container (which does have $HOME and passwd (also tried to add them anyway)
I can repreduce the issue on the local vscode (not the container) in the developer tool by running require("os").userInfo()

@chrmarti
Copy link
Contributor

chrmarti commented Jul 11, 2022

@thebestnom nodejs/node#25714 mentions "Docker container", but I think the same is true on the local machine depending on its configuration. (E.g., you mention LDAP, maybe your user account does not have an /etc/passwd entry?)

@thebestnom
Copy link

thebestnom commented Jul 11, 2022

@chrmarti I do have /etc/passwd (even though Im on ldap), and running userInfo on normal node (not from dev-tools) does works, somehow just vscode can't use it (tried strace but couldn't find the root cause)

@thebestnom
Copy link

image
image
@chrmarti

@chrmarti
Copy link
Contributor

What is the Node.js version you are using? (VS Code is currently using Electron based on Node.js 16.13.2.)

@thebestnom
Copy link

@chrmarti tried them all just to be sure already 😅 but this one specifically is v10.19.0

@thebestnom
Copy link

image

@chrmarti
Copy link
Contributor

@deepak1556 Do you know if Electron's os.userInfo() is somehow different from the one in the same Node version?

@chrmarti chrmarti added the bug Issue identified by VS Code Team member as probable bug label Jul 11, 2022
@mcw8d
Copy link
Author

mcw8d commented Jul 11, 2022

@thebestnom reverting back to 0.238.3 did work for me and my co-worker.

In case it is relevant, the computer I'm on is using LDAP and my user does not have an entry in /etc/passwd. I downloaded Node v16.13.2 and I'm seeing the same behavior as @thebestnom: calling userInfo from command line Node works fine, but dev tools in VSCode local throws the uv_os_get_passwd exception.

@mcw8d
Copy link
Author

mcw8d commented Jul 11, 2022

As a test, I downloaded the latest .tar.gz version of VSCode and that seems to work just fine. I am able to use the 0.241.3 version of Remote Containers as expected and I am also able to successfully call require("os").userInfo(); from the developer tools in VSCode local.
When I ran into this issue I was using VSCode installed through the snap store. Could this be a sandboxing issue with the snap distribution?

@chrmarti
Copy link
Contributor

@thebestnom also seem to see this with the snap (looking through #6928).

@deepak1556
Copy link

@chrmarti Electron does not carry any custom patches for the userInfo implementation. The underlying implementation in libuv relies on getpwuid_r https://github.com/libuv/libuv/blob/c4d73c306b87e32acba3a77f933da72ac5604659/src/unix/core.c#L1257-L1259 which seems to be a problem for snaps. Very likely related to https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1606212

@charlesroelli
Copy link

I had a similar error too when launching a remote container in VS Code 1.69.0 installed with snap on Ubuntu 20.04:

[86 ms] Remote-Containers 0.241.3 in VS Code 1.69.0 (92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9).
[85 ms] Start: Resolving Remote
[121 ms] SystemError: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
        at new SystemError (node:internal/errors:233:5)
        at new NodeError (node:internal/errors:336:7)
        at Object.userInfo (node:os:347:11)
        at Eo (/home/$USER/.vscode/extensions/ms-vscode-remote.remote-containers-0.241.3/dist/extension/extension.js:394:5490)
        at /home/$USER/.vscode/extensions/ms-vscode-remote.remote-containers-0.241.3/dist/extension/extension.js:401:7264
        at _withProgress (/snap/code/100/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:45034)
        at _.withProgress (/snap/code/100/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:83:44788)
        at Object.withProgress (/snap/code/100/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:106:42345)
        at ACe (/home/$USER/.vscode/extensions/ms-vscode-remote.remote-containers-0.241.3/dist/extension/extension.js:401:7088)
        at H9 (/home/$USER/.vscode/extensions/ms-vscode-remote.remote-containers-0.241.3/dist/extension/extension.js:401:6364)
        at processTicksAndRejections (node:internal/process/task_queues:96:5)
        at async Object.resolve (/home/$USER/.vscode/extensions/ms-vscode-remote.remote-containers-0.241.3/dist/extension/extension.js:396:8954)
        at async w.$resolveAuthority (/snap/code/100/usr/share/code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:97:21430)

Downgrading to Remote-Containers version 0.238.3 seems to fix the issue. Not sure if it's relevant, but now the shell prompt inside the container looks something like

I have no name!@21cc6a2d1b81:/project# 

@chrmarti
Copy link
Contributor

I'm not seeing this with Ubuntu 21.04, VS Code 1.69.1 snap and Remote-Containers 0.241.3. Not sure what might make the difference, will investigate adding a fallback for when this occurs.

@deepak1556
Copy link

@chrmarti might want to test with Ubuntu 20.04 since the reports have this version in common, can confirm if the issue is addressed in newer versions.

@chrmarti
Copy link
Contributor

Works for me with Ubuntu 20.04 (tested running os.userInfo() with the Electron binary from the snap).

@thebestnom
Copy link

@chrmarti Ill remind you that both @mcw8d and I are ldap users and don't have entry in /etc/passwd

@thebestnom
Copy link

Also tested again on 1.69.1 and didn't fix

@charlesroelli
Copy link

Oops, I totally forgot to mention I use an LDAP account (not present in /etc/passwd) on my machine too. When I use another non-LDAP account on the same machine to launch the remote container in VS Code, then the error in #6913 (comment) doesn't occur and everything works fine with Remote-Containers 0.241.3.

@thebestnom
Copy link

@chrmarti is it released?

@chrmarti
Copy link
Contributor

@thebestnom It is now available with Remote-Containers 0.243.0-pre-release (switch Remote-Containers to pre-releases from the Extensions viewlet). Let me know if that fixes it, thanks!

@thebestnom
Copy link

@chrmarti Working as expected, thanks!

@mcw8d
Copy link
Author

mcw8d commented Jul 22, 2022

I got a chance to test today and it is working as expected for me as well. Thank you @chrmarti !

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2022
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 containers Issue in vscode-remote containers verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants