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.41k stars 349 forks source link

unable to login Amazon Q: "Connection timed out after 0 ms" #5200

Open umalingaswami opened 2 weeks ago

umalingaswami commented 2 weeks ago

unable to login Amazon Q

Steps to reproduce the issue

open vs code. install amazon q extension Choose free sign in Login amazon Q in the given url. Authentcation failed Unable to use Amazon Q chat

Expected behavior

Authentication success

System details (run AWS: About and/or Amazon Q: About)

umalingaswami commented 2 weeks ago

OS: Windows 11 Enterprise Visual Studio Code version: Version: 1.86.1 AWS Toolkit version: Amazon Q version: v1.9.0

justinmk3 commented 2 weeks ago

Can you provide the Amazon Q logs? In particular, look for permissions errors.

  1. In the vscode command palette, run Amazon Q: View Logs. This reveals the Output panel with Amazon Q Logs selected.
  2. Click the gear icon and choose Debug, then click it again and choose Set As Default.
  3. Perform the steps to reproduce the issue.
  4. Remove any private info from the logs.
ganesh-rao commented 2 weeks ago

I'm having the same issue. Here's my log:

2024-06-22 10:22:04.993 [info] Log level: info
2024-06-22 10:22:04.993 [info] Telemetry product: Amazon Q For VS Code
2024-06-22 10:22:05.045 [info] codewhisperer: active connection changed
2024-06-22 10:22:05.045 [info] codewhisperer: connection states
    connection isValid=false,
    connection isValidCodewhispererCoreConnection=false,
    connection isExpired=false,
    secondaryAuth isExpired=false,
    connection isUndefined=true
2024-06-22 10:22:05.238 [info] initialized 'submitFeedback' command with default feedback id: Amazon Q
2024-06-22 10:22:07.145 [warning] AwsContext: no default region in credentials profile, falling back to us-east-1:
2024-06-22 10:22:10.596 [info] selected AWS ID sign in
2024-06-22 10:22:10.596 [info] auth: Updating connection state of [private-randomly-generated-key-here] to authenticating
2024-06-22 10:22:10.596 [info] codewhisperer: connection changed to authenticating: [private-randomly-generated-key-here]
2024-06-22 10:22:10.599 [info] current client registration id=undefined
    expires at undefined
    key = [private-randomly-generated-key-here]
2024-06-22 10:22:15.698 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' }
2024-06-22 10:22:20.878 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' }
2024-06-22 10:22:25.985 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' }
2024-06-22 10:22:25.990 [error] webviewId="aws.amazonq.AmazonCommonAuth": Error: Webview error
     -> Error: Webview backend command failed: "startCodeWhispererBuilderIdSetup()"
     -> Error: Failed to connect to AWS Builder ID [FailedToConnect]
     -> TimeoutError: Connection timed out after 0 ms

Previously, the browser window/tab used to open to authenticate. This no longer happens.

justinmk3 commented 2 weeks ago

TimeoutError: Connection timed out after 0 ms

hmm...

nkomonen-amazon commented 1 week ago

This is something I'm looking in to in relation to the token refresh failures.

My first guess is to increase the timeout in the OIDC client.

ganesh-rao commented 1 week ago

Unsure if you did anything, but it appears to be working again.