amplify-backend icon indicating copy to clipboard operation
amplify-backend copied to clipboard

Unable to answer prompt when quitting sandbox mode

Open kokokosal opened this issue 1 year ago • 5 comments

Environment information

System:
  OS: Windows 10 10.0.19044
  CPU: (12) x64 AMD Ryzen 5 PRO 4650U with Radeon Graphics
  Memory: 3.45 GB / 15.33 GB
Binaries:
  Node: 20.11.0 - C:\Program Files\nodejs\node.EXE
  Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
  npm: 9.3.1 - C:\Program Files\nodejs\npm.CMD
  pnpm: 8.15.5 - ~\AppData\Roaming\npm\pnpm.CMD
NPM Packages:
  @aws-amplify/backend: 0.13.0-beta.15
  @aws-amplify/backend-cli: 0.12.0-beta.17
  aws-amplify: 6.0.27
  aws-cdk: 2.135.0
  aws-cdk-lib: 2.135.0
  typescript: 5.4.3
AWS environment variables:
  AWS_DEFAULT_REGION = us-east-1
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_PROFILE = myprofile
  AWS_SDK_LOAD_CONFIG = 1
  AWS_STS_REGIONAL_ENDPOINTS = regional
No CDK environment variables

Description

While running amplify sandbox, pressing Ctrl+C to quit shows a prompt that can't be answeredx, because Powershell immediately asks about terminating batch job.

image

kokokosal avatar Apr 04 '24 17:04 kokokosal

Hey @kokokosal, thank you for reaching out. I was unable to reproduce the immediate prompt on a Powershell window but did notice the second prompt after the delete.

? Would you like to delete all the resources in your sandbox environment (This cannot be undone)? y
[Sandbox] Deleting all the resources in the sandbox environment...
amplify-repro-yketh-sandbox-0021362c4d: destroying... [1/1]
amplify-repro-yketh-sandbox-0021362c4d-auth179371D7-11OG3OAPCC8JH |   0 | 11:34:18 a.m. | DELETE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-repro-yketh-sandbox-0021362c4d-auth179371D7-11OG3OAPCC8JH User Initiated
amplify-repro-yketh-sandbox-0021362c4d-auth179371D7-11OG3OAPCC8JH |   0 | 11:34:20 a.m. | DELETE_IN_PROGRESS   | AWS::Cognito::IdentityPoolRoleAttachment | auth/amplifyAuth/IdentityPoolRoleAttachment (amplifyAuthIdentityPoolRoleAttachment045F17C8)
amplify-repro-yketh-sandbox-0021362c4d-auth179371D7-11OG3OAPCC8JH |   0 | 11:34:20 a.m. | DELETE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)
amplify-repro-yketh-sandbox-0021362c4d |   0 | 11:34:15 a.m. | DELETE_IN_PROGRESS   | AWS::CloudFormation::Stack | amplify-repro-yketh-sandbox-0021362c4d User Initiated
amplify-repro-yketh-sandbox-0021362c4d |   0 | 11:34:17 a.m. | DELETE_IN_PROGRESS   | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)
amplify-repro-yketh-sandbox-0021362c4d |   0 | 11:34:17 a.m. | DELETE_IN_PROGRESS   | AWS::CloudFormation::Stack | auth.NestedStack/auth.NestedStackResource (auth179371D7)
amplify-repro-yketh-sandbox-0021362c4d |   1 | 11:34:18 a.m. | DELETE_COMPLETE      | AWS::CDK::Metadata         | auth/CDKMetadata/Default (CDKMetadata)

 ✅  amplify-repro-yketh-sandbox-0021362c4d: destroyed

[Sandbox] Finished deleting.
Terminate batch job (Y/N)? y

wanted to get some additional information, Did you observe this in a VScode-integrated terminal or on a separate terminal window? The version of the PowerShell being used v5.1 or v7?

ykethan avatar Apr 05 '24 15:04 ykethan

This happens within VSCode terminal's Powershell.

$PSVersionTable 
Name                           Value
----                           -----
PSVersion                      5.1.19041.4170
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.4170
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

kokokosal avatar Apr 05 '24 18:04 kokokosal

Hey @kokokosal, thank you for the information. tried to reproduce the issue on both v5 and v7 powershell terminal on a separate windows and Vscode integrated terminal but did not observe an immediate exit/re-prompt on the terminal. But i was able to reproduce the prompt when I ctrl + c twice. To ensure was there was double exit/ctrl + c input provided on the terminal?

ykethan avatar Apr 08 '24 13:04 ykethan

I am pressing ctrl+c only once when encountering the error.

Two new clues or red herrings-

  1. Sometimes, and I can't pinpoint why it's inconsistent, pressing Enter while it says "File written: amplifyconfiguration.json" brings up the "delete all resources" prompt with a blue "N" prefilled as the answer. At that point, pressing enter does nothing. Pressing ctrl+c here invokes the original error by showing the prompt a second time, and with the Terminate message. image

  2. When I press Ctrl+C, the Terminate Batch Job prompt appears with "cmd" listed briefly as the shell, instead of powershell. amplify_shells

kokokosal avatar Apr 09 '24 04:04 kokokosal

@kokokosal thank you for the information and apologies on the delay. This appears to be side effect of .cmd, we do not have control over the additional prompt as its the default behaviour baked into the shell. but did find a GitHub issue providing additional information: https://github.com/microsoft/terminal/issues/217

ykethan avatar Apr 19 '24 18:04 ykethan

Closing the issue due to inactivity. Do you reach out to us if you need any assistance with Amplify.

ykethan avatar May 07 '24 20:05 ykethan