question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CDK CLI errors when run as a non-existent user

See original GitHub issue

A regression in 1.37 means that the CDK CLI will error out if it is run by a user not in /etc/passwd

Reproduction Steps

npx cdk init app --language=typescript
npm install
docker run -u 502:502 -v $(pwd):/app -w /app node ./node_modules/.bin/cdk list

Error Log

SystemError [ERR_SYSTEM_ERROR]: A system error occurred: uv_os_get_passwd returned ENOENT (no such file or directory)
    at Object.userInfo (os.js:268:11)
    at cdkHomeDir (/app/node_modules/aws-cdk/lib/util/directories.ts:7:21)
    at Object.cdkCacheDir (/app/node_modules/aws-cdk/lib/util/directories.ts:11:20)
    at new AccountAccessKeyCache (/app/node_modules/aws-cdk/lib/api/aws-auth/account-cache.ts:25:44)
    at Object.<anonymous> (/app/node_modules/aws-cdk/lib/api/aws-auth/sdk.ts:38:42)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19)

Environment

  • CLI Version : >= 1.37
  • Framework Version:
  • OS : Tested in Docker on MacOS
  • Language : Typescript

This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
jonathanmorleycommented, May 12, 2020

The error goes away if you mount an /etc/passwd containing a user with UID 502

❯ docker run -it -u 502:502 -v $(pwd)/etc_passwd:/etc/passwd -v $(pwd):/app -w /app node ./node_modules/.bin/cdk list
CdkTempStack

or if you provide a CDK_HOME env var

❯ docker run -it -u 502:502 -v $(pwd):/app -e CDK_HOME=foo -w /app node ./node_modules/.bin/cdk list
CdkTempStack
0reactions
github-actions[bot]commented, Jul 7, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK.
Read more >
awslabs/aws-cdk - Gitter
Because I this looks like the toolkit is trying to bootstrap the same account/region multiple times (I'm assuming all your XXXXXXXXXXXX are the...
Read more >
[Solved] AWS DynamoDB errors ResourceNotFoundException
Solution. DynamoDB responds with this error when you're trying to run an operation against non-existent or not active table. Troubleshooting steps:.
Read more >
aws/aws-cdk v2.32.0 on GitHub - NewReleases.io
New release aws/aws-cdk version v2.32.0 on GitHub. ... cli: CLI errors when run as a non-existent user (#21018) (e6015a9), closes #7937; core: entrypoint ......
Read more >
Cdk use existing vpc - cattolimonica.it
The CDK CLI will search for the specified VPC in the the stack's region and account, and import the subnet configuration. aws vpc...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found