放大init UnauthorizedException

问题描述 投票:0回答:1

我正在使用以下文档学习放大器 https://docs.amplify.aws/angular/start/getting-started/installation/ https://docs.amplify.aws/angular/start/getting-started/setup/

但是在执行具有所需详细信息的“amplify init”命令时,它会给出错误:

UnauthorizedException.


As per 1st documentation link, successfully performed "amplify configure"

.

然后执行第二个链接中给出的“amplify init”步骤,详细信息如下

Project information
| Name: Amplify-App
| Environment: dev
| Default editor: Visual Studio Code
| App type: javascript
| Javascript framework: angular
| Source Directory Path: src
| Distribution Directory Path: dist
| Build Command: npm.cmd 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 **default**

After this error is displayed as below
**We are unable to process your request. Please reach out to your support representative.**

调试后使用:

 "amplify init --debug" below UnauthorizedException error is displayed
ProjectInitFault: We are unable to process your request. Please reach out to your support representative.
    at init (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-provider-awscloudformation\lib\amplify-service-manager.js:163:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.run (C:\snapshot\amplify-cli\build\node_modules\@aws-amplify\amplify-provider-awscloudformation\lib\initializer.js:96:9)

We are unable to process your request. Please reach out to your support representative.
UnauthorizedException: We are unable to process your request. Please reach out to your support representative.
    at Object.extractError (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\protocol\json.js:80:27)
    at Request.extractError (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\protocol\rest_json.js:61:8)
    at Request.callListeners (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:106:20)
    at Request.emit (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
    at Request.emit (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:686:14)
    at Request.transition (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:688:12)
    at Request.callListeners (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:116:18)
    at Request.emit (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:78:10)
    at Request.emit (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:686:14)
    at Request.transition (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:22:10)
    at AcceptorStateMachine.runTo (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\state_machine.js:14:12)
    at C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\state_machine.js:26:10
    at Request.<anonymous> (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:38:9)
    at Request.<anonymous> (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\request.js:688:12)
    at Request.callListeners (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:116:18)
    at callNextListener (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\sequential_executor.js:96:12)
    at IncomingMessage.onEnd (C:\snapshot\amplify-cli\build\node_modules\aws-sdk\lib\event_listeners.js:417:13)
    at IncomingMessage.emit (node:events:525:35)
    at IncomingMessage.emit (node:domain:489:12)
    at endReadableNT (node:internal/streams/readable:1359:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

我检查了存储在 C:/Users/user/.aws/credentials 文件中的访问密钥和秘密密钥,并且密钥与创建 IAM 用户时生成的相同。

如何进一步调试来解决上述问题?

angular aws-amplify init
1个回答
0
投票

我在 AWS 支持中心报告了问题。 根据支持中心的指示,我做了以下操作

  1. 更改了root用户密码并实施了MFA。
  2. 检查 CloudTrail 日志是否有任何异常活动。就我而言,不存在日志。
  3. 在“账单”部分检查未经授权的访问(如果有)。没有未经授权的访问。

执行步骤1后“amplify init”开始工作。

© www.soinside.com 2019 - 2024. All rights reserved.