aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.81k stars 821 forks source link

Verbose option for CLI #7509

Open connor4312 opened 3 years ago

connor4312 commented 3 years ago

Before opening, please confirm:

How did you install the Amplify CLI?

npm

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

16.3.0

Amplify CLI Version

4.51.4

What operating system are you using?

Wdinows

Amplify Categories

Not applicable

Amplify Commands

Not applicable

Describe the bug

https://github.com/aws-amplify/amplify-cli/issues/501 was locked, but was never fully resolved (see followup discussion on the issue).

In my particular case, I'm facing this error:

UPDATE_FAILED      GraphQLSchema AWS::AppSync::GraphQLSchema Sat Jun 12 2021 10:42:30 GMT-0700 (Pacific Daylight Time) The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: <snip>; S3 Extended Request ID:  <snip>; Proxy: null)

and I'm having to manually debug into the CLI to see what the request is actually trying to do in order to have a hint of how to fix it.

Expected behavior

There should be a --verbose option on the CLI

Reproduction steps

N/A

GraphQL schema(s)

No response

Log output

No response

Additional information

No response

akshbhu commented 3 years ago

Hi @connor4312

From the error it seems , Appsync not able to locate graphql schema from deployment bucket. Can you also tell me what categories you added or modified before you got this error?

For the logs option : you can check log output of cli here ~/.amplify/logs/amplify-cli-<issue-date>.log

connor4312 commented 3 years ago

I was able to figure out what was wrong (ordering issue in how I pushed things). However the logs didn't contain anything helpful, it would have been nice to be able to trace the calls made and see the one that failed in the CLI.

akshbhu commented 3 years ago

Glad to know it is working for you.

The logs I mentioned contains CLI calls which can help you determine where it failed.

I am closing this issue for now as it seems to be solved

connor4312 commented 3 years ago

@akshbhu it's not solved, the request is for a --verbose option for the CLI so I would not need to manually add console.logs within the amplify CLI source to find the issue

akshbhu commented 3 years ago

Okay , Since current logs doesnt provide enough support to triage issues , I am marking this as feature request.

akshbhu commented 3 years ago

Hi @connor4312

Can you also describe what logs do you want to see from amplify cli side. We already have a mechanism to print cfn logs.

connor4312 commented 3 years ago

Ideally a log of all the http requests being made, with complete details (request/response) on the specific failure

thejasonfisher commented 2 years ago

We need a debugging/verbose option that prints the exact resource or table being processed, before the processing happens. This is the only way to see what is broken when an exception occurs that ruins the state of the application.

Why is this difficult?

crzyjcky commented 2 years ago

hi @akshbhu I am having the issue where amplify mock api is hanging, but doesn't give any useful information.

Checking the log file at ~/.amplify/logs/amplify-cli-<issue-date>.log is not helpful at all.

2022-05-21T17:32:24.252Z|info : amplify version core  
2022-05-21T17:32:36.858Z|info : amplify api mock  
2022-05-21T17:32:36.897Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}
2022-05-21T17:38:53.251Z|info : amplify help core  {"help":true,"yes":false}
2022-05-21T17:39:22.990Z|info : amplify version core  {"version":true,"yes":false}
2022-05-21T17:39:27.557Z|info : amplify version core  {"version":true,"yes":false}
2022-05-21T17:39:31.283Z|info : amplify help core  {"verbose":true,"yes":false}
2022-05-21T17:39:50.265Z|info : amplify help core  {"verbose":true,"yes":false}
2022-05-21T17:39:58.379Z|info : amplify api mock  {"verbose":true,"yes":false}
2022-05-21T17:39:58.418Z|info : amplify-cli-core.banner-message/index.ts.fetch banner messages from https://aws-amplify.github.io/amplify-cli/banner-message.json({}

We need a way to show a more detailed debug log. Is there a way to ether adding a verbose flag, or set the output level somewhere in a config file?