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.5k stars 424 forks source link

Unable to login to amazon q developer using vs code #5387

Closed abhishek17n closed 2 months ago

abhishek17n commented 2 months ago

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

Question

Unable to login to amazon q developer using vs code.

abhishek17n commented 2 months ago

The Builder ID authentication fails as the default browser never opens

abhishek17n commented 2 months ago

amazonqdeveloper

abhishek17n commented 2 months ago

024-07-27 21:57:02.261 [debug] called startBuilderIdSetup() 2024-07-27 21:57:02.261 [info] selected AWS ID sign in 2024-07-27 21:57:02.261 [info] auth: Updating connection state of fc2dcae1-0c8c-4fe8-8fef-bb66c5ed39a1 to authenticating 2024-07-27 21:57:02.261 [info] codewhisperer: connection changed to authenticating: fc2dcae1-0c8c-4fe8-8fef-bb66c5ed39a1 2024-07-27 21:57:02.263 [debug] SSO token cache: read failed (file not found) key: fc2dcae1-0c8c-4fe8-8fef-bb66c5ed39a1 2024-07-27 21:57:02.263 [info] current client registration id=undefined expires at undefined key = fc2dcae1-0c8c-4fe8-8fef-bb66c5ed39a1 2024-07-27 21:57:02.264 [debug] auth: SSO registration cache: read failed (file not found) key: {"startUrl":"https://view.awsapps.com/start","region":"us-east-1","scopes":["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations","codewhisperer:transformations","codewhisperer:taskassist"]} 2024-07-27 21:57:02.270 [debug] auth: SSO registration cache: read failed (file not found) key: {"startUrl":"https://view.awsapps.com/start","region":"us-east-1","scopes":["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations","codewhisperer:transformations","codewhisperer:taskassist"]} 2024-07-27 21:57:02.270 [debug] API request (oidc.us-east-1.amazonaws.com /client/register): { clientName: 'AWS IDE Extensions for VSCode', clientType: 'public', scopes: [ 'codewhisperer:completions', 'codewhisperer:analysis', 'codewhisperer:conversations', 'codewhisperer:transformations', 'codewhisperer:taskassist' ], grantTypes: [ 'authorization_code', 'refresh_token' ], redirectUris: [ 'http://127.0.0.1/oauth/callback' ], issuerUrl: 'https://view.awsapps.com/start' } 2024-07-27 21:57:07.272 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' } 2024-07-27 21:57:07.370 [debug] API request (oidc.us-east-1.amazonaws.com /client/register): { clientName: 'AWS IDE Extensions for VSCode', clientType: 'public', scopes: [ 'codewhisperer:completions', 'codewhisperer:analysis', 'codewhisperer:conversations', 'codewhisperer:transformations', 'codewhisperer:taskassist' ], grantTypes: [ 'authorization_code', 'refresh_token' ], redirectUris: [ 'http://127.0.0.1/oauth/callback' ], issuerUrl: 'https://view.awsapps.com/start' } 2024-07-27 21:57:12.375 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' } 2024-07-27 21:57:12.474 [debug] API request (oidc.us-east-1.amazonaws.com /client/register): { clientName: 'AWS IDE Extensions for VSCode', clientType: 'public', scopes: [ 'codewhisperer:completions', 'codewhisperer:analysis', 'codewhisperer:conversations', 'codewhisperer:transformations', 'codewhisperer:taskassist' ], grantTypes: [ 'authorization_code', 'refresh_token' ], redirectUris: [ 'http://127.0.0.1/oauth/callback' ], issuerUrl: 'https://view.awsapps.com/start' } 2024-07-27 21:57:17.487 [error] API response (oidc.us-east-1.amazonaws.com /client/register): { name: 'TimeoutError' } 2024-07-27 21:57:17.491 [error] ssoSetup encountered an error: Error: Failed to connect to AWS Builder ID [FailedToConnect] -> TimeoutError: Connection timed out after 5000 ms 2024-07-27 21:57:17.491 [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 5000 ms 2024-07-27 21:57:17.491 [debug] telemetry: auth_addConnection 2024-07-27 21:57:17.534 [debug] Webview called command "errorNotification" with args: [ { id: 'defaultFailure', text: 'Failed to setup.' } ] 2024-07-27 21:57:17.535 [debug] Webview called command "emitUiClick" with args: [ 'auth_continueButton' ] 2024-07-27 21:57:17.535 [debug] telemetry: ui_click

jpinkney-aws commented 2 months ago

Hi, it looks like your auth session is timing out after 5 minutes.

Do you have any other extensions (or VSCode settings) that might block opening the link in your default browser? VSCode has a bisect tool that might help figure this out: https://code.visualstudio.com/blogs/2021/02/16/extension-bisect. Additionally, can you try clicking "Copy" and copy/pasting your link into the browser and try authentication that way?

abhishek17n commented 2 months ago

Hello, I could install visual studio code in another laptop and authenticate amazon q successfully but not in original laptop,

abhishek17n commented 2 months ago

I have switched to Linux to work and install vs code and amazon q without issues.