Skip to content

CDK CLI errors when run as a non-existent user #7937

@jonathanmorley

Description

@jonathanmorley

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

Metadata

Metadata

Assignees

Labels

bugThis issue is a bug.effort/smallSmall work item – less than a day of effortp1package/toolsRelated to AWS CDK Tools or CLI

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions