aws / aws-toolkit-vscode

Amazon Q, CodeCatalyst, Local Lambda debug, SAM/CFN syntax, ECS Terminal, AWS resources
https://marketplace.visualstudio.com/items?itemName=AmazonWebServices.amazon-q-vscode
Apache License 2.0
1.47k stars 408 forks source link

CodeWhisperer Invocation Exception #3331

Closed gianpaj closed 1 year ago

gianpaj commented 1 year ago

Problem

Steps to reproduce the issue

try to use extension

Expected behavior

work

System details (run the AWS: About Toolkit command)

2023-04-14 14:03:46 [ERROR]: log level: info
2023-04-14 14:03:46 [INFO]: Retrieving AWS endpoint data
2023-04-14 14:03:46 [INFO]: OS: Darwin arm64 22.4.0
2023-04-14 14:03:46 [INFO]: Visual Studio Code extension host:  1.77.3
2023-04-14 14:03:46 [INFO]: AWS Toolkit:  1.68.0
2023-04-14 14:03:46 [INFO]: node: 16.14.2
2023-04-14 14:03:46 [INFO]: electron: 19.1.11
2023-04-14 14:03:46 [WARN]: AwsContext: no default region in credentials profile, falling back to us-east-1: 
2023-04-14 14:05:52 [ERROR]: CodeWhisperer Invocation Exception : 
2023-04-14 14:05:53 [ERROR]: CodeWhisperer Invocation Exception : 
2023-04-14 14:06:00 [ERROR]: CodeWhisperer Invocation Exception : 
awsanakkala commented 1 year ago

@gianpaj Thank you for reporting the issue. Can you please describe the steps that resulted in this error?

gianpaj commented 1 year ago

I tried the autotomplete. Press that tab button on a typescript file

justinmk3 commented 1 year ago

Can you increase the log level to "VERBOSE", then provide the logs (remove any private info!):

  1. In VSCode settings, ensure that "aws log level" is "verbose".
  2. Perform the steps to reproduce the issue.
  3. Use the AWS: View Toolkit Logs command to get the logs.

Also:

gianpaj commented 1 year ago

Hi @justinmk3 ,

I tried again here are the logs

2023-04-21 18:46:35 [ERROR]: log level: verbose
2023-04-21 18:46:35 [INFO]: endpoints: retrieving AWS endpoints data
2023-04-21 18:46:35 [VERBOSE]: loading file resource: "/Users/gpalumbo/.vscode/extensions/amazonwebservices.aws-toolkit-vscode-1.69.0/resources/endpoints.json"
2023-04-21 18:46:35 [INFO]: OS: Darwin arm64 22.4.0
2023-04-21 18:46:35 [INFO]: Visual Studio Code extension host:  1.77.3
2023-04-21 18:46:35 [INFO]: AWS Toolkit:  1.69.0
2023-04-21 18:46:35 [INFO]: node: 16.14.2
2023-04-21 18:46:35 [INFO]: electron: 19.1.11
2023-04-21 18:46:35 [VERBOSE]: Telemetry is now enabled
2023-04-21 18:46:35 [WARN]: AwsContext: no default region in credentials profile, falling back to us-east-1: 
2023-04-21 18:46:35 [VERBOSE]: downloading: https://api.github.com/repos/devfile/api/releases/latest
2023-04-21 18:46:35 [VERBOSE]: codecatalyst: not a devenv, getThisDevEnv() returned empty
2023-04-21 18:46:35 [VERBOSE]: downloading: https://idetoolkits.amazonwebservices.com/endpoints.json
2023-04-21 18:46:35 [VERBOSE]: downloaded: https://api.github.com/repos/devfile/api/releases/latest
2023-04-21 18:46:35 [VERBOSE]: loading file resource: "/Users/gpalumbo/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/sam.schema.json"
2023-04-21 18:46:35 [VERBOSE]: downloaded: https://idetoolkits.amazonwebservices.com/endpoints.json
2023-04-21 18:46:36 [VERBOSE]: E-Tag, W/"8d98f6c5c3a34de16898833a5d43ecfc74718e5e92942c7005c525674e76543f", matched. No content downloaded from: https://raw.githubusercontent.com/aws/serverless-application-model/main/samtranslator/schema/schema.json
2023-04-21 18:46:36 [VERBOSE]: loading file resource: "/Users/gpalumbo/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/sam.schema.json"
2023-04-21 18:46:36 [VERBOSE]: E-Tag, W/"8d98f6c5c3a34de16898833a5d43ecfc74718e5e92942c7005c525674e76543f", matched. No content downloaded from: https://raw.githubusercontent.com/aws/serverless-application-model/main/samtranslator/schema/schema.json
2023-04-21 18:46:36 [VERBOSE]: loading file resource: "/Users/gpalumbo/Library/Application Support/Code/User/globalStorage/amazonwebservices.aws-toolkit-vscode/devfile.schema.json"
2023-04-21 18:46:56 [ERROR]: CodeWhisperer Invocation Exception : 
2023-04-21 18:46:56 [VERBOSE]: CodeWhisperer Invocation Exception : Error: The requested operation is not recognized by the service.
2023-04-21 18:46:56 [VERBOSE]: Request ID: , timestamp(epoch): 1682099216143, timezone: Europe/Dublin, datetime: 4/21/2023, 6:46:56 PM, vscode version: '1.77.3', extension version: '1.69.0', filename: 'index.ios.js', left context of line:  '', line number: 11, character location: 0, latency: 780.8831670284271 ms.
2023-04-21 18:46:56 [VERBOSE]: Recommendations:

When I manually press on Invoce service, I get

image
2023-04-21 18:48:57 [ERROR]: API response (oidc.us-east-1.amazonaws.com /token): {
  name: 'InvalidGrantException',
  '$fault': 'client',
  '$metadata': {
    httpStatusCode: 400,
    requestId: 'db06d658-71f7-4587-9cc9-19449a8a18e8',
    extendedRequestId: undefined,
    cfId: undefined
  },
  error: 'invalid_grant',
  error_description: 'Invalid grant provided',
  message: 'UnknownError'
}
gianpaj commented 1 year ago

fixed by re-logging in, thanks. I can cancel GitHub Copilot now :)

justinmk3 commented 1 year ago

Thanks for the followup! This should be improved by https://github.com/aws/aws-toolkit-vscode/pull/3359 (not released yet).