Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

MFA token code message is hidden #7848

Closed
4 tasks done
g-grass opened this issue Aug 1, 2021 · 1 comment · Fixed by #7866 or #9954
Closed
4 tasks done

MFA token code message is hidden #7848

g-grass opened this issue Aug 1, 2021 · 1 comment · Fixed by #7866 or #9954
Assignees
Labels
bug Something isn't working p3 platform Issues tied to the general CLI platform

Comments

@g-grass
Copy link

g-grass commented Aug 1, 2021

Before opening, please confirm:

  • I have installed the latest version of the Amplify CLI (see above), and confirmed that the issue still persists.
  • I have searched for duplicate or closed issues.
  • I have read the guide for submitting bug reports.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

How did you install the Amplify CLI?

npm (6.14.13)

If applicable, what version of Node.js are you using?

v14.17.3

Amplify CLI Version

5.2.1

What operating system are you using?

Mac (Mojave 10.14.6)

Amplify Categories

Not applicable

Amplify Commands

push

Describe the bug

  • I'm sorry if this is a misunderstanding. This happened when I created a new project, referring to the official tutorial.
  • When I ran the amplify push command, it seemed to freeze with the following message displayed.
It requires MFA authentication. The MFA device is
  arn:aws:iam::012345678910:mfa/sample-mfa
⠙ Fetching updates to backend environment: dev from the cloud.
  • However, when I pressed the Enter key in this state, the following error message was output:
  arn:aws:iam::012345678910:mfa/sample-mfa
⠙ Fetching updates to backend environment: dev from the cloud.
>> Must have length equal to 6
  • This was the first time I noticed that I was waiting for a MFA token code to be entered.

Expected behavior

  • I hope it looks like this:
It requires MFA authentication. The MFA device is
  arn:aws:iam::012345678910:mfa/sample-mfa
? Enter the MFA token code:

Reproduction steps

  • Is is basically in line with the official tutorial.
  1. amplify init
$ amplify init
Note: It is recommended to run this command from the root of your app directory
? Enter a name for the project debugapp
The following configuration will be applied:

Project information
| Name: debugapp
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: angular
| Source Directory Path: src
| Distribution Directory Path: dist/amplify-app
| Build Command: npm run-script build
| Start Command: ng serve

? Initialize the project with the above configuration? Yes
Using default provider  awscloudformation
? Select the authentication method you want to use: AWS profile

For more information on AWS Profiles, see:
https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-profiles.html

? Please choose the profile you want to use sample_profile
Adding backend environment dev to AWS Amplify Console app: xxx
  1. amplify add api
$ amplify add api
? Please select from one of the below mentioned services: GraphQL
? Provide API name: debugapp
? Choose the default authorization type for the API API key
? Enter a description for the API key: ***
? After how many days from now the API key should expire (1-365): 1
? Do you want to configure advanced settings for the GraphQL API No, I am done.
? Do you have an annotated GraphQL schema? No
? Choose a schema template: Single object with fields (e.g., “Todo” with ID, name, description)


The following types do not have '@auth' enabled. Consider using @auth with @model
         - Todo
Learn more about @auth here: https://docs.amplify.aws/cli/graphql-transformer/auth


GraphQL schema compiled successfully.

Edit your schema at /xxx_dir/schema.graphql or place .graphql files in a directory at /xxx_dir/schema
? Do you want to edit the schema now? Yes
? Choose your default editor: Visual Studio Code
Couldn’t find selected code editor (vscode) on your machine.
? Try opening with system-default editor instead? Yes
Successfully added resource debugapp locally
  1. amplify status
$ amplify status
Current Environment: dev

| Category | Resource name | Operation | Provider plugin   |
| -------- | ------------- | --------- | ----------------- |
| Api      | debugapp      | Create    | awscloudformation |
  1. amplify push
$ amplify push
⠋ Fetching updates to backend environment: dev from the cloud.Profile sample_profile is configured to assume role
  arn:aws:iam::012345678910:role/sample-role
It requires MFA authentication. The MFA device is
  arn:aws:iam::012345678910:mfa/sample-mfa
⠙ Fetching updates to backend environment: dev from the cloud.

GraphQL schema(s)

# Put schemas below this line

Log output

The arns are dummy.
# Put your logs below this line
$ amplify push
⠋ Fetching updates to backend environment: dev from the cloud.Profile sample_profile is configured to assume role
  arn:aws:iam::012345678910:role/sample-role
It requires MFA authentication. The MFA device is
  arn:aws:iam::012345678910:mfa/sample-mfa
⠙ Fetching updates to backend environment: dev from the cloud.


## amplify-cli.log
2021-08-01T07:46:00.899Z|info : amplify push core  
2021-08-01T07:46:00.965Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2021-08-01T07:46:07.269Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig([“sample_profile”])
2021-08-01T07:46:07.271Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"output":"json","role_arn”:”[***]5678910:role/[***]e-[***]le","mfa_serial":"arn:aws:iam::012345678910:mfa/sample_mfa”,”region":"us-east-1","source_profile":"default"}])
2021-08-01T07:46:07.271Z|info : amplify-provider-awscloudformation.system-config-manager.getCacheFilePath([“/xxx_dir/.amplify/awscloudformation"])
2021-08-01T07:46:07.272Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileConfig(["default"])
2021-08-01T07:46:07.272Z|info : amplify-provider-awscloudformation.system-config-manager.getProfiledAwsConfig.profileConfig([{"output":"json","region":"us-east-1"}])
2021-08-01T07:46:07.272Z|info : amplify-provider-awscloudformation.system-config-manager.getProfileCredentials(["default"])

Additional information

aws config

  • .aws/credential
[default]
aws_access_key_id = ***
aws_secret_access_key = ***
region = us-east-1
aws_mfa_device = arn:aws:iam::012345678910:mfa/sample-mfa
  • .aws/config
[profile sample_profile]
output = json
role_arn = arn:aws:iam::012345678910:role/sample-role
mfa_serial = arn:aws:iam::012345678910:mfa/sample-mfa
region = us-east-1
source_profile = default

[default]
output = json
region = us-east-1

workarounds

  • ⠙ Fetching updates to backend environment: dev from the cloud. was displayed, it was still possible to perform an amplify push by entering the code.
  • I have also confirmed that the message ? Enter the MFA token code: appears momentarily when I press arrow keys while ⠙ Fetching updates to backend environment: dev from the cloud. is displayed.

other

@johnpc johnpc added bug Something isn't working platform Issues tied to the general CLI platform labels Aug 2, 2021
@johnpc johnpc added this to To do in Bug bash via automation Aug 2, 2021
@johnpc johnpc self-assigned this Aug 3, 2021
@johnpc johnpc moved this from To do to In progress in Bug bash Aug 3, 2021
@renebrandel renebrandel added this to To estimate in Bug triage Aug 5, 2021
@johnpc johnpc moved this from In progress to Approved and ready to merge in Bug bash Aug 13, 2021
Bug bash automation moved this from Approved and ready to merge to Done Aug 25, 2021
Bug triage automation moved this from To estimate to Closed Aug 25, 2021
@cjihrig
Copy link
Contributor

cjihrig commented Aug 27, 2021

Reopening, as the fix was causing E2E test failures and was reverted.

@cjihrig cjihrig reopened this Aug 27, 2021
@josefaidt josefaidt self-assigned this Feb 16, 2022
@johnpc johnpc mentioned this issue Mar 10, 2022
2 tasks
@johnpc johnpc linked a pull request Mar 15, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p3 platform Issues tied to the general CLI platform
Projects
Bug bash
  
Done
5 participants