Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

cdk: await unfriendly, "Subprocess exited with error 13" #25871

Closed
Qlub53 opened this issue Jun 6, 2023 · 2 comments
Closed

cdk: await unfriendly, "Subprocess exited with error 13" #25871

Qlub53 opened this issue Jun 6, 2023 · 2 comments
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Comments

@Qlub53
Copy link

Qlub53 commented Jun 6, 2023

Describe the bug

Having a cdk program do await, even before new cdk.App();, always seems to end up with:

Subprocess exited with error 13

Expected Behavior

cdk executes await lines as normal.

Current Behavior

Subprocess exited with error 13

Reproduction Steps

error13.zip, where line 12-19 of bin/error13.ts are salient.

// `cdk` won't wait for user input
readline.createInterface({ input, output }).question(`Question 1: `, answer => console.log(answer));

// `cdk` exits with error 13
await new Promise(resolve => readline.createInterface({ input, output }).question(`Question 2: `, answer => console.log(answer)));

// `cdk` exits with error 13
await new Promise(resolve => setTimeout(() => resolve, 3000));

Steps:

  1. Unzip error13.zip
  2. cd to upzipped location
  3. npm install
  4. cdk synth --all or cdk deploy --all

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.69.0

Framework Version

No response

Node.js Version

16.8.0

OS

macOS 12.5

Language

Typescript

Language Version

4.6.3

Other information

No response

@Qlub53 Qlub53 added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jun 6, 2023
@github-actions github-actions bot added the package/tools Related to AWS CDK Tools or CLI label Jun 6, 2023
@pahud
Copy link
Contributor

pahud commented Jun 6, 2023

This probably requires async func call but according to the previous discussion here #8273 (comment), it's an anti-pattern and is not supported by CDK.

If you need receive interactive user input like readline, maybe you should consider using read in bash to read in user input as a variable and pass it to CDK app through context variables with -c.

@pahud pahud added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. p2 effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Jun 6, 2023
@github-actions
Copy link

github-actions bot commented Jun 8, 2023

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

@github-actions github-actions bot added closing-soon This issue will automatically close in 4 days unless further comments are made. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. and removed closing-soon This issue will automatically close in 4 days unless further comments are made. labels Jun 8, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug This issue is a bug. closed-for-staleness This issue was automatically closed because it hadn't received any attention in a while. effort/medium Medium work item – several days of effort p2 package/tools Related to AWS CDK Tools or CLI response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Projects
None yet
Development

No branches or pull requests

2 participants