Errors in ~/.config/Code/logs/<date and time>/window1/exthost/exthost.log
2024-07-08 12:09:54.179 [error] Activating extension amazonwebservices.amazon-q-vscode failed due to an error:
2024-07-08 12:09:54.179 [error] SystemError: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
at new SystemError (node:internal/errors:257:5)
at new NodeError (node:internal/errors:368:7)
at Object.userInfo (node:os:365:11)
Solution
Move getUserInfo/getUsername into fs.ts since they depend on the filesystem.
If userInfo fails, fallback to (in order of precedence):
process.env.USER
getUserHomeDir() directory name
"unknown-user"
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Problem
Both AWS Toolkit and Amazon Q fail to start when the effective user account is defined externally (e.g. by AD/LDAP). #5277
Bisected to #5215 which calls os.userInfo in getUsername (env.ts).
When the effective user ID does not have a matching entry in /etc/passwd, userInfo throws an exception. Discussed in:
Steps to reproduce
~/.config/Code/logs/<date and time>/window1/exthost/exthost.log
Solution
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.